:p
atchew
Login
From: Geliang Tang <tanggeliang@kylinos.cn> There's a building error in v10: progs/mptcp_bpf_iters.c:24:8: error: call to undeclared function 'bpf_mptcp_sk'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 24 | msk = bpf_mptcp_sk((struct sock *)sk); | ^ progs/mptcp_bpf_iters.c:24:6: error: incompatible integer to pointer conversion assigning to 'struct mptcp_sock *' from 'int' [-Wint-conversion] 24 | msk = bpf_mptcp_sk((struct sock *)sk); bpf_mptcp_sk() definition is missing. It will be used in patch 4. Depends on: - "add mptcp_subflow bpf_iter" v10 Based-on: <cover.1729063444.git.tanggeliang@kylinos.cn> Geliang Tang (2): Squash to "bpf: Register mptcp common kfunc set" Squash to "selftests/bpf: Add mptcp_subflow bpf_iter test prog" net/mptcp/bpf.c | 6 ++++++ tools/testing/selftests/bpf/progs/mptcp_bpf.h | 1 + 2 files changed, 7 insertions(+) -- 2.43.0
From: Geliang Tang <tanggeliang@kylinos.cn> bpf_mptcp_sk() definition is missing. It will be used in patch 4. Please update the commit log: ''' MPTCP helper mptcp_sk() is used to convert struct sock to mptcp_sock. Helpers mptcp_subflow_ctx() and mptcp_subflow_tcp_sock() are used to convert between struct mptcp_subflow_context and sock. They all will be used in MPTCP BPF programs too. This patch defines corresponding wrappers of them, and put the wrappers into mptcp common kfunc set and register the set with the flag BPF_PROG_TYPE_UNSPEC to let them accessible to all types of BPF programs. ''' Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> --- net/mptcp/bpf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c index XXXXXXX..XXXXXXX 100644 --- a/net/mptcp/bpf.c +++ b/net/mptcp/bpf.c @@ -XXX,XX +XXX,XX @@ struct bpf_iter_mptcp_subflow_kern { __bpf_kfunc_start_defs(); +__bpf_kfunc static struct mptcp_sock *bpf_mptcp_sk(struct sock *sk) +{ + return mptcp_sk(sk); +} + __bpf_kfunc static struct mptcp_subflow_context * bpf_mptcp_subflow_ctx(const struct sock *sk) { @@ -XXX,XX +XXX,XX @@ __bpf_kfunc static bool bpf_mptcp_subflow_queues_empty(struct sock *sk) __bpf_kfunc_end_defs(); BTF_KFUNCS_START(bpf_mptcp_common_kfunc_ids) +BTF_ID_FLAGS(func, bpf_mptcp_sk) BTF_ID_FLAGS(func, bpf_mptcp_subflow_ctx) BTF_ID_FLAGS(func, bpf_mptcp_subflow_tcp_sock) BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_new, KF_ITER_NEW | KF_TRUSTED_ARGS) -- 2.43.0
From: Geliang Tang <tanggeliang@kylinos.cn> Export bpf_mptcp_sk(), it is used in this test program. Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> --- tools/testing/selftests/bpf/progs/mptcp_bpf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf.h b/tools/testing/selftests/bpf/progs/mptcp_bpf.h index XXXXXXX..XXXXXXX 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf.h +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf.h @@ -XXX,XX +XXX,XX @@ mptcp_subflow_tcp_sock(const struct mptcp_subflow_context *subflow) extern struct mptcp_sock *bpf_mptcp_sock_acquire(struct mptcp_sock *msk) __ksym; extern void bpf_mptcp_sock_release(struct mptcp_sock *msk) __ksym; +extern struct mptcp_sock *bpf_mptcp_sk(struct sock *sk) __ksym; extern struct mptcp_subflow_context * bpf_mptcp_subflow_ctx(const struct sock *sk) __ksym; extern struct sock * -- 2.43.0
From: Geliang Tang <tanggeliang@kylinos.cn> v2: - drop unused variable 'err'. There are two building errors in v10: progs/mptcp_bpf_iters.c:24:8: error: call to undeclared function 'bpf_mptcp_sk'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 24 | msk = bpf_mptcp_sk((struct sock *)sk); | ^ progs/mptcp_bpf_iters.c:24:6: error: incompatible integer to pointer conversion assigning to 'struct mptcp_sock *' from 'int' [-Wint-conversion] 24 | msk = bpf_mptcp_sk((struct sock *)sk); tools/testing/selftests/bpf/prog_tests/mptcp.c: In function 'test_iters_subflow': tools/testing/selftests/bpf/prog_tests/mptcp.c:546:13: error: unused variable 'err' [-Werror=unused-variable] 546 | int err; | ^~~ TEST-OBJ [test_progs] pe_preserve_elems.test.o bpf_mptcp_sk() definition is missing. It will be used in patch 4. An unused variable 'err' needs to be dropped. Depends on: - "add mptcp_subflow bpf_iter" v10 Based-on: <cover.1729063444.git.tanggeliang@kylinos.cn> Geliang Tang (3): Squash to "bpf: Register mptcp common kfunc set" Squash to "selftests/bpf: Add mptcp_subflow bpf_iter test prog" Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest" net/mptcp/bpf.c | 6 ++++++ tools/testing/selftests/bpf/prog_tests/mptcp.c | 1 - tools/testing/selftests/bpf/progs/mptcp_bpf.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) -- 2.43.0
From: Geliang Tang <tanggeliang@kylinos.cn> bpf_mptcp_sk() definition is missing. It will be used in patch 4. Please update the commit log: ''' MPTCP helper mptcp_sk() is used to convert struct sock to mptcp_sock. Helpers mptcp_subflow_ctx() and mptcp_subflow_tcp_sock() are used to convert between struct mptcp_subflow_context and sock. They all will be used in MPTCP BPF programs too. This patch defines corresponding wrappers of them, and put the wrappers into mptcp common kfunc set and register the set with the flag BPF_PROG_TYPE_UNSPEC to let them accessible to all types of BPF programs. ''' Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> --- net/mptcp/bpf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c index XXXXXXX..XXXXXXX 100644 --- a/net/mptcp/bpf.c +++ b/net/mptcp/bpf.c @@ -XXX,XX +XXX,XX @@ struct bpf_iter_mptcp_subflow_kern { __bpf_kfunc_start_defs(); +__bpf_kfunc static struct mptcp_sock *bpf_mptcp_sk(struct sock *sk) +{ + return mptcp_sk(sk); +} + __bpf_kfunc static struct mptcp_subflow_context * bpf_mptcp_subflow_ctx(const struct sock *sk) { @@ -XXX,XX +XXX,XX @@ __bpf_kfunc static bool bpf_mptcp_subflow_queues_empty(struct sock *sk) __bpf_kfunc_end_defs(); BTF_KFUNCS_START(bpf_mptcp_common_kfunc_ids) +BTF_ID_FLAGS(func, bpf_mptcp_sk) BTF_ID_FLAGS(func, bpf_mptcp_subflow_ctx) BTF_ID_FLAGS(func, bpf_mptcp_subflow_tcp_sock) BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_new, KF_ITER_NEW | KF_TRUSTED_ARGS) -- 2.43.0
From: Geliang Tang <tanggeliang@kylinos.cn> Export bpf_mptcp_sk(), it is used in this test program. Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> --- tools/testing/selftests/bpf/progs/mptcp_bpf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf.h b/tools/testing/selftests/bpf/progs/mptcp_bpf.h index XXXXXXX..XXXXXXX 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf.h +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf.h @@ -XXX,XX +XXX,XX @@ mptcp_subflow_tcp_sock(const struct mptcp_subflow_context *subflow) extern struct mptcp_sock *bpf_mptcp_sock_acquire(struct mptcp_sock *msk) __ksym; extern void bpf_mptcp_sock_release(struct mptcp_sock *msk) __ksym; +extern struct mptcp_sock *bpf_mptcp_sk(struct sock *sk) __ksym; extern struct mptcp_subflow_context * bpf_mptcp_subflow_ctx(const struct sock *sk) __ksym; extern struct sock * -- 2.43.0
From: Geliang Tang <tanggeliang@kylinos.cn> /home/tgl/mptcp_net-next/tools/testing/selftests/bpf/prog_tests/mptcp.c: In function 'test_iters_subflow': /home/tgl/mptcp_net-next/tools/testing/selftests/bpf/prog_tests/mptcp.c:546:13: error: unused variable 'err' [-Werror=unused-variable] 546 | int err; | ^~~ TEST-OBJ [test_progs] pe_preserve_elems.test.o Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> --- tools/testing/selftests/bpf/prog_tests/mptcp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index XXXXXXX..XXXXXXX 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -XXX,XX +XXX,XX @@ static void test_iters_subflow(void) struct mptcp_bpf_iters *skel; struct nstoken *nstoken; int cgroup_fd; - int err; cgroup_fd = test__join_cgroup("/iters_subflow"); if (!ASSERT_OK_FD(cgroup_fd, "join_cgroup: iters_subflow")) -- 2.43.0