[PATCH mptcp-next v13 1/9] Squash to "bpf: Register mptcp common kfunc set"

Geliang Tang posted 9 patches 1 year ago
There is a newer version of this series
[PATCH mptcp-next v13 1/9] Squash to "bpf: Register mptcp common kfunc set"
Posted by Geliang Tang 1 year ago
From: Geliang Tang <tanggeliang@kylinos.cn>

Instead of adding a new BPF function bpf_mptcp_send_info_to_ssk() in
v12, this patch uses a much more simpler approach, which using '__ign'
suffix for the argument of bpf_mptcp_subflow_ctx() to let BPF to
ignore the type check of this argument.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/bpf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
index a74173cc8998..c09d5526d976 100644
--- a/net/mptcp/bpf.c
+++ b/net/mptcp/bpf.c
@@ -224,11 +224,11 @@ struct bpf_iter_mptcp_subflow_kern {
 __bpf_kfunc_start_defs();
 
 __bpf_kfunc static struct mptcp_subflow_context *
-bpf_mptcp_subflow_ctx(const struct sock *sk)
+bpf_mptcp_subflow_ctx(const struct sock *sk__ign)
 {
-	if (sk && sk_fullsock(sk) &&
-	    sk->sk_protocol == IPPROTO_TCP && sk_is_mptcp(sk))
-		return mptcp_subflow_ctx(sk);
+	if (sk__ign && sk_fullsock(sk__ign) &&
+	    sk__ign->sk_protocol == IPPROTO_TCP && sk_is_mptcp(sk__ign))
+		return mptcp_subflow_ctx(sk__ign);
 
 	return NULL;
 }
-- 
2.43.0