All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jason Xing <kerneljasonxing@gmail.com>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	bjorn@kernel.org, magnus.karlsson@intel.com,
	maciej.fijalkowski@intel.com, jonathan.lemon@gmail.com,
	sdf@fomichev.me, ast@kernel.org, daniel@iogearbox.net,
	hawk@kernel.org, john.fastabend@gmail.com, joe@dama.to,
	willemdebruijn.kernel@gmail.com, bpf@vger.kernel.org,
	netdev@vger.kernel.org, Jason Xing <kernelxing@tencent.com>
Subject: Re: [PATCH net-next v2] xsk: skip validating skb list in xmit path
Date: Wed, 16 Jul 2025 17:52:48 -0700	[thread overview]
Message-ID: <20250716175248.4f626bdb@kernel.org> (raw)
In-Reply-To: <CAL+tcoA1LMjxKgQb4WZZ8LeipbGU038is21M_y+kc93eoUpBCA@mail.gmail.com>

On Thu, 17 Jul 2025 08:06:48 +0800 Jason Xing wrote:
> To be honest, this patch really only does one thing as the commit
> says. It might look very complex, but if readers take a deep look they
> will find only one removal of that validation for xsk in the hot path.
> Nothing more and nothing less. So IMHO, it doesn't bring more complex
> codes here.
> 
> And removal of one validation indeed contributes to the transmission.
> I believe there remain a number of applications using copy mode
> currently. And maintainers of xsk don't regard copy mode as orphaned,
> right?

First of all, I'm not sure the patch is correct. The XSK skbs can have
frags, if device doesn't support or clears _SG we should linearize,
right?

Second, we don't understand where the win is coming from, the numbers
you share are a bit vague. What's so expensive about a few skbs
accesses? Maybe there's an optimization possible to the validation,
which would apply more broadly, instead of skipping it for one trivial
case.

Third, I asked you to compare with AF_PACKET, because IIUC it should
have similar properties as AF_XDP in copy mode. So why not use that?

Lastly, the patch is not all that bad, sure. But the experience of
supporting generic XDP is a very mixed. All the paths that pretend
to do XDP on skbs have a bunch of quirks and bugs. I'd prefer that
we push back more broadly on any sort of pretend XDP.

  reply	other threads:[~2025-07-17  0:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16 12:27 [PATCH net-next v2] xsk: skip validating skb list in xmit path Jason Xing
2025-07-16 21:42 ` Stanislav Fomichev
2025-07-16 21:56 ` Jakub Kicinski
2025-07-16 23:37   ` Jason Xing
2025-07-16 23:43     ` Jakub Kicinski
2025-07-17  0:06       ` Jason Xing
2025-07-17  0:52         ` Jakub Kicinski [this message]
2025-07-17  1:12           ` Jason Xing
2025-07-17  2:52             ` Willem de Bruijn
2025-07-17  3:10               ` Jason Xing

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=20250716175248.4f626bdb@kernel.org \
    --to=kuba@kernel.org \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=joe@dama.to \
    --cc=john.fastabend@gmail.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kerneljasonxing@gmail.com \
    --cc=kernelxing@tencent.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=willemdebruijn.kernel@gmail.com \
    /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.