aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/psp/types.h
diff options
context:
space:
mode:
authorRaed Salem <raeds@nvidia.com>2025-09-16 17:09:40 -0700
committerPaolo Abeni <pabeni@redhat.com>2025-09-18 12:32:07 +0200
commitfc724515741a1b86ca0457825fdb784ab038e92c (patch)
tree7ecbe2c1cc6fc824800874c2c2ca124228bd99a1 /include/net/psp/types.h
parentnet/mlx5e: Implement PSP operations .assoc_add and .assoc_del (diff)
downloadlinux-fc724515741a1b86ca0457825fdb784ab038e92c.tar.gz
linux-fc724515741a1b86ca0457825fdb784ab038e92c.zip
psp: provide encapsulation helper for drivers
Create a new function psp_encapsulate(), which takes a TCP packet and PSP encapsulates it according to the "Transport Mode Packet Format" section of the PSP Architecture Specification. psp_encapsulate() does not push a PSP trailer onto the skb. Both IPv6 and IPv4 are supported. Virtualization cookie is not included. Reviewed-by: Willem de Bruijn <willemb@google.com> Signed-off-by: Raed Salem <raeds@nvidia.com> Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com> Co-developed-by: Daniel Zahka <daniel.zahka@gmail.com> Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20250917000954.859376-14-daniel.zahka@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/net/psp/types.h')
-rw-r--r--include/net/psp/types.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/psp/types.h b/include/net/psp/types.h
index ec218747ced0..d9688e66cf09 100644
--- a/include/net/psp/types.h
+++ b/include/net/psp/types.h
@@ -20,6 +20,8 @@ struct psphdr {
__be64 vc[]; /* optional */
};
+#define PSP_ENCAP_HLEN (sizeof(struct udphdr) + sizeof(struct psphdr))
+
#define PSP_SPI_KEY_ID GENMASK(30, 0)
#define PSP_SPI_KEY_PHASE BIT(31)