From: Jakub Sitnicki <jakub@cloudflare.com>
To: Liu Jian <liujian56@huawei.com>
Cc: john.fastabend@gmail.com, daniel@iogearbox.net,
lmb@cloudflare.com, edumazet@google.com, davem@davemloft.net,
kuba@kernel.org, yoshfuji@linux-ipv6.org, dsahern@kernel.org,
ast@kernel.org, andrii@kernel.org, kafai@fb.com,
songliubraving@fb.com, yhs@fb.com, kpsingh@kernel.org,
netdev@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH] bpf, sockmap: Do not read sk_receive_queue in tcp_bpf_recvmsg if strparser enabled
Date: Mon, 18 Oct 2021 10:54:41 +0200 [thread overview]
Message-ID: <87v91ug1bi.fsf@cloudflare.com> (raw)
In-Reply-To: <20211015080142.43424-1-liujian56@huawei.com>
On Fri, Oct 15, 2021 at 10:01 AM CEST, Liu Jian wrote:
> If the strparser function of sk is turned on, all received data needs to
> be processed by strparser first.
>
> Fixes: 604326b41a6fb ("bpf, sockmap: convert to generic sk_msg interface")
> Signed-off-by: Liu Jian <liujian56@huawei.com>
> ---
[...]
> net/core/skmsg.c | 5 +++++
> net/ipv4/tcp_bpf.c | 9 ++++++---
> 3 files changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
> index 94e2a1f6e58d..25e92dff04aa 100644
> --- a/include/linux/skmsg.h
> +++ b/include/linux/skmsg.h
> @@ -390,6 +390,7 @@ void sk_psock_stop(struct sk_psock *psock, bool wait);
> int sk_psock_init_strp(struct sock *sk, struct sk_psock *psock);
> void sk_psock_start_strp(struct sock *sk, struct sk_psock *psock);
> void sk_psock_stop_strp(struct sock *sk, struct sk_psock *psock);
> +bool sk_psock_strparser_started(struct sock *sk);
> #else
> static inline int sk_psock_init_strp(struct sock *sk, struct sk_psock *psock)
> {
> @@ -403,6 +404,11 @@ static inline void sk_psock_start_strp(struct sock *sk, struct sk_psock *psock)
> static inline void sk_psock_stop_strp(struct sock *sk, struct sk_psock *psock)
> {
> }
> +
> +static inline bool sk_psock_strparser_started(struct sock *sk)
> +{
> + return false;
> +}
> #endif
>
> void sk_psock_start_verdict(struct sock *sk, struct sk_psock *psock);
> diff --git a/net/core/skmsg.c b/net/core/skmsg.c
> index e85b7f8491b9..dd64ef854f3e 100644
> --- a/net/core/skmsg.c
> +++ b/net/core/skmsg.c
> @@ -1105,6 +1105,11 @@ void sk_psock_start_strp(struct sock *sk, struct sk_psock *psock)
> sk->sk_write_space = sk_psock_write_space;
> }
>
> +bool sk_psock_strparser_started(struct sock *sk)
> +{
> + return sk->sk_data_ready == sk_psock_strp_data_ready;
What if kTLS is configured on the socket? I think this check won't work then.
> +}
> +
> void sk_psock_stop_strp(struct sock *sk, struct sk_psock *psock)
> {
> if (!psock->saved_data_ready)
[...]
next prev parent reply other threads:[~2021-10-18 8:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 8:01 [PATCH] bpf, sockmap: Do not read sk_receive_queue in tcp_bpf_recvmsg if strparser enabled Liu Jian
2021-10-18 8:54 ` Jakub Sitnicki [this message]
2021-10-18 13:53 ` John Fastabend
2021-10-19 3:03 ` liujian (CE)
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=87v91ug1bi.fsf@cloudflare.com \
--to=jakub@cloudflare.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=liujian56@huawei.com \
--cc=lmb@cloudflare.com \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
--cc=yoshfuji@linux-ipv6.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).