summaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
authorDaniel Xu <dxu@dxuuu.xyz>2023-12-14 15:49:02 -0700
committerAlexei Starovoitov <ast@kernel.org>2023-12-14 17:12:49 -0800
commit8f0ec8c681755f523cf842bfe350ea40609b83a9 (patch)
tree09854f18f530083819738a3c283fe95d16952ee4 /include/net/xfrm.h
parent56925f389e152dcb8d093435d43b78a310539c23 (diff)
downloadlinux-8f0ec8c681755f523cf842bfe350ea40609b83a9.tar.gz
linux-8f0ec8c681755f523cf842bfe350ea40609b83a9.tar.bz2
linux-8f0ec8c681755f523cf842bfe350ea40609b83a9.zip
bpf: xfrm: Add bpf_xdp_get_xfrm_state() kfunc
This commit adds an unstable kfunc helper to access internal xfrm_state associated with an SA. This is intended to be used for the upcoming IPsec pcpu work to assign special pcpu SAs to a particular CPU. In other words: for custom software RSS. That being said, the function that this kfunc wraps is fairly generic and used for a lot of xfrm tasks. I'm sure people will find uses elsewhere over time. This commit also adds a corresponding bpf_xdp_xfrm_state_release() kfunc to release the refcnt acquired by bpf_xdp_get_xfrm_state(). The verifier will require that all acquired xfrm_state's are released. Co-developed-by: Antony Antony <antony.antony@secunet.com> Signed-off-by: Antony Antony <antony.antony@secunet.com> Acked-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz> Link: https://lore.kernel.org/r/a29699c42f5fad456b875c98dd11c6afc3ffb707.1702593901.git.dxu@dxuuu.xyz Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index c9bb0f892f55..1d107241b901 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -2190,4 +2190,13 @@ static inline int register_xfrm_interface_bpf(void)
#endif
+#if IS_ENABLED(CONFIG_DEBUG_INFO_BTF)
+int register_xfrm_state_bpf(void);
+#else
+static inline int register_xfrm_state_bpf(void)
+{
+ return 0;
+}
+#endif
+
#endif /* _NET_XFRM_H */