All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Sitnicki <jakub@cloudflare.com>
To: Cong Wang <xiyou.wangcong@gmail.com>, Jiayuan Chen <mrpre@163.com>
Cc: bpf@vger.kernel.org,  martin.lau@linux.dev,  ast@kernel.org,
	edumazet@google.com,  davem@davemloft.net,  dsahern@kernel.org,
	kuba@kernel.org,  pabeni@redhat.com,
	 linux-kernel@vger.kernel.org, song@kernel.org,
	 john.fastabend@gmail.com,  andrii@kernel.org, mhal@rbox.co,
	 yonghong.song@linux.dev,  daniel@iogearbox.net,
	horms@kernel.org
Subject: Re: [PATCH bpf v2 0/2] bpf: fix wrong copied_seq calculation and add tests
Date: Mon, 16 Dec 2024 13:19:03 +0100	[thread overview]
Message-ID: <87o71bx1l4.fsf@cloudflare.com> (raw)
In-Reply-To: <Z14udC8bTilHb3Xs@pop-os.localdomain> (Cong Wang's message of "Sat, 14 Dec 2024 17:18:44 -0800")

On Sat, Dec 14, 2024 at 05:18 PM -08, Cong Wang wrote:
> On Sat, Dec 14, 2024 at 07:50:37PM +0100, Jakub Sitnicki wrote:
>> On Mon, Dec 09, 2024 at 11:27 PM +08, Jiayuan Chen wrote:
>> 
>> [...]
>> 
>> > We added test cases for bpf + strparser and separated them from
>> > sockmap_basic. This is because we need to add more test cases for
>> > strparser in the future.
>> >
>> > Fixes: e5c6de5fa025 ("bpf, sockmap: Incorrectly handling copied_seq")
>> >
>> > ---
>> 
>> I have a question unrelated to the fix itself -
>> 
>> Are you an active strparser+verdict sockmap user?
>> 
>> I was wondering if we can deprecate strparser if/when KCM time comes
>
> I am afraid not.
>
> strparser is very different from skb verdict, upper layer (e.g. HTTP)
> protocol messages may be splitted accross sendmsg() call's, strparser
> is the only place where we can assemble the messages and parse them as a
> whole.
>
> And I don't think we have to use KCM together with strparser. Therefore,
> even _if_ KCM can be deprecated, strparse still can't.

Thanks for the context. Good to know we have strparser users.

I also wanna ask - did you guys consider migrating
strp_data_ready->strp_read_sock->...->strp_recv to read_skb /
tcp_read_skb to prevent the duplicate copied_seq update?

tcp_bpf_read_sock looks awfully lot like tcp_read_skb.

I realize it is easier said than done because there is an interface
mismatch - desc.count used to stop reading, and desc.error to signal OOM
/ need to requeue is missing. And then there is the SW kTLS read_sock
callback that would need adapting as well.

Definitely more work, but maybe less code duplication in the long run?

      reply	other threads:[~2024-12-16 12:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 15:27 [PATCH bpf v2 0/2] bpf: fix wrong copied_seq calculation and add tests Jiayuan Chen
2024-12-09 15:27 ` [PATCH bpf v2 1/2] bpf: fix wrong copied_seq calculation Jiayuan Chen
2024-12-11  2:11   ` John Fastabend
2024-12-12  6:33     ` Jiayuan Chen
2024-12-13  1:36       ` John Fastabend
2024-12-13 14:07         ` Jiayuan Chen
2024-12-16  3:32           ` John Fastabend
2024-12-18  5:01             ` Jiayuan Chen
2024-12-09 15:27 ` [PATCH bpf v2 2/2] selftests/bpf: add strparser test for bpf Jiayuan Chen
2024-12-14 18:50 ` [PATCH bpf v2 0/2] bpf: fix wrong copied_seq calculation and add tests Jakub Sitnicki
2024-12-15  1:18   ` Cong Wang
2024-12-16 12:19     ` Jakub Sitnicki [this message]

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=87o71bx1l4.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=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mhal@rbox.co \
    --cc=mrpre@163.com \
    --cc=pabeni@redhat.com \
    --cc=song@kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    --cc=yonghong.song@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.