From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Geliang Tang <geliang.tang@suse.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next] Squash to "bpf: add bpf_skc_to_mptcp_sock_proto"
Date: Tue, 26 Apr 2022 17:17:34 -0700 (PDT) [thread overview]
Message-ID: <39951b3-5ec-09-6547-991ff81e2f1@linux.intel.com> (raw)
In-Reply-To: <a412b57378176f189e112a36443ac133fa90566c.1650947043.git.geliang.tang@suse.com>
On Tue, 26 Apr 2022, Geliang Tang wrote:
> Update as Daniel suggested.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Looks good to squash, thanks. The 'base' bpf tests pass, which is what
Daniel noted as failing.
- Mat
> ---
> include/linux/bpf.h | 1 +
> include/net/mptcp.h | 2 +-
> kernel/bpf/verifier.c | 1 +
> kernel/trace/bpf_trace.c | 2 ++
> net/core/filter.c | 3 ++-
> net/mptcp/Makefile | 2 --
> 6 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> index bdb5298735ce..2493f9601842 100644
> --- a/include/linux/bpf.h
> +++ b/include/linux/bpf.h
> @@ -2249,6 +2249,7 @@ extern const struct bpf_func_proto bpf_skc_to_tcp_timewait_sock_proto;
> extern const struct bpf_func_proto bpf_skc_to_tcp_request_sock_proto;
> extern const struct bpf_func_proto bpf_skc_to_udp6_sock_proto;
> extern const struct bpf_func_proto bpf_skc_to_unix_sock_proto;
> +extern const struct bpf_func_proto bpf_skc_to_mptcp_sock_proto;
> extern const struct bpf_func_proto bpf_copy_from_user_proto;
> extern const struct bpf_func_proto bpf_snprintf_btf_proto;
> extern const struct bpf_func_proto bpf_snprintf_proto;
> diff --git a/include/net/mptcp.h b/include/net/mptcp.h
> index 6b07011c060d..4d761ad530c9 100644
> --- a/include/net/mptcp.h
> +++ b/include/net/mptcp.h
> @@ -284,7 +284,7 @@ static inline int mptcpv6_init(void) { return 0; }
> static inline void mptcpv6_handle_mapped(struct sock *sk, bool mapped) { }
> #endif
>
> -#if defined(CONFIG_MPTCP) && defined(CONFIG_BPF_JIT) && defined(CONFIG_BPF_SYSCALL)
> +#if defined(CONFIG_MPTCP) && defined(CONFIG_BPF_SYSCALL)
> struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk);
> #else
> static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk) { return NULL; }
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 9c1a02b82ecd..40602ec20c6a 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -517,6 +517,7 @@ static bool is_ptr_cast_function(enum bpf_func_id func_id)
> func_id == BPF_FUNC_skc_to_tcp_sock ||
> func_id == BPF_FUNC_skc_to_tcp6_sock ||
> func_id == BPF_FUNC_skc_to_udp6_sock ||
> + func_id == BPF_FUNC_skc_to_mptcp_sock ||
> func_id == BPF_FUNC_skc_to_tcp_timewait_sock ||
> func_id == BPF_FUNC_skc_to_tcp_request_sock;
> }
> diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
> index b26f3da943de..c7bf10cf2fa5 100644
> --- a/kernel/trace/bpf_trace.c
> +++ b/kernel/trace/bpf_trace.c
> @@ -1685,6 +1685,8 @@ tracing_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
> return &bpf_skc_to_udp6_sock_proto;
> case BPF_FUNC_skc_to_unix_sock:
> return &bpf_skc_to_unix_sock_proto;
> + case BPF_FUNC_skc_to_mptcp_sock:
> + return &bpf_skc_to_mptcp_sock_proto;
> case BPF_FUNC_sk_storage_get:
> return &bpf_sk_storage_get_tracing_proto;
> case BPF_FUNC_sk_storage_delete:
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 4bcf13b1d0e2..a0dd6f6b17f8 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -11282,10 +11282,11 @@ const struct bpf_func_proto bpf_skc_to_unix_sock_proto = {
>
> BPF_CALL_1(bpf_skc_to_mptcp_sock, struct sock *, sk)
> {
> + BTF_TYPE_EMIT(struct mptcp_sock);
> return (unsigned long)bpf_mptcp_sock_from_subflow(sk);
> }
>
> -static const struct bpf_func_proto bpf_skc_to_mptcp_sock_proto = {
> +const struct bpf_func_proto bpf_skc_to_mptcp_sock_proto = {
> .func = bpf_skc_to_mptcp_sock,
> .gpl_only = false,
> .ret_type = RET_PTR_TO_BTF_ID_OR_NULL,
> diff --git a/net/mptcp/Makefile b/net/mptcp/Makefile
> index 4004347db47e..6e7df47c9584 100644
> --- a/net/mptcp/Makefile
> +++ b/net/mptcp/Makefile
> @@ -11,6 +11,4 @@ mptcp_crypto_test-objs := crypto_test.o
> mptcp_token_test-objs := token_test.o
> obj-$(CONFIG_MPTCP_KUNIT_TEST) += mptcp_crypto_test.o mptcp_token_test.o
>
> -ifeq ($(CONFIG_BPF_JIT),y)
> obj-$(CONFIG_BPF_SYSCALL) += bpf.o
> -endif
> --
> 2.34.1
>
>
>
--
Mat Martineau
Intel
next prev parent reply other threads:[~2022-04-27 0:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 4:26 [PATCH mptcp-next] Squash to "bpf: add bpf_skc_to_mptcp_sock_proto" Geliang Tang
2022-04-26 4:26 ` [PATCH mptcp-next] Squash to "selftests: bpf: test bpf_skc_to_mptcp_sock" Geliang Tang
2022-04-26 6:16 ` Squash to "selftests: bpf: test bpf_skc_to_mptcp_sock": Tests Results MPTCP CI
2022-04-27 0:20 ` [PATCH mptcp-next] Squash to "selftests: bpf: test bpf_skc_to_mptcp_sock" Mat Martineau
2022-04-27 0:22 ` Mat Martineau
2022-04-27 15:27 ` Geliang Tang
2022-04-27 21:47 ` Mat Martineau
2022-04-28 2:51 ` Geliang Tang
2022-04-27 16:33 ` Matthieu Baerts
2022-04-26 6:17 ` Squash to "bpf: add bpf_skc_to_mptcp_sock_proto": Tests Results MPTCP CI
2022-04-27 0:17 ` Mat Martineau [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-05-17 7:43 [PATCH mptcp-next] Squash to "bpf: add bpf_skc_to_mptcp_sock_proto" Geliang Tang
2022-03-30 7:08 Geliang Tang
2022-03-30 13:29 ` Matthieu Baerts
2022-03-30 14:22 ` Geliang Tang
2022-03-30 14:51 ` Matthieu Baerts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39951b3-5ec-09-6547-991ff81e2f1@linux.intel.com \
--to=mathew.j.martineau@linux.intel.com \
--cc=geliang.tang@suse.com \
--cc=mptcp@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.