netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Eryk Kubanski <e.kubanski@partner.samsung.com>
Cc: Stanislav Fomichev <stfomichev@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"bjorn@kernel.org" <bjorn@kernel.org>,
	"magnus.karlsson@intel.com" <magnus.karlsson@intel.com>,
	"jonathan.lemon@gmail.com" <jonathan.lemon@gmail.com>
Subject: Re: Re: Re: Re: Re: [PATCH bpf v2] xsk: Fix out of order segment free in __xsk_generic_xmit()
Date: Wed, 11 Jun 2025 15:10:15 +0200	[thread overview]
Message-ID: <aEmANxmvCLMXdQpi@boxer> (raw)
In-Reply-To: <20250610091125eucms1p3b7b0b19a533caffddce07c75596f3714@eucms1p3>

On Tue, Jun 10, 2025 at 11:11:25AM +0200, Eryk Kubanski wrote:
> > I've come with something as below. Idea is to embed addr at the end of
> > linear part of skb/at the end of page frag.
> 
> Are you sure that this is safe for other components?
> 
> So instead of storing entire array at the skb_shared_info (skb->end),
> we store It 8-bytes per PAGE fragment and 8-byte at skb->end.
> Technically noone should edit skb past-the-end, it
> looks good to me.
> 
> In xsk_cq_submit_locked() you use only xskq_prod_write_addr.
> I think that this may cause synchronization issues on reader side.
> You don't perform ATOMIC_RELEASE, so this producer incrementation
> is atomic (u32) but it doesn't synchronize address write.
> 
> I think that you should accumulate local producer and
> store it with ATOMIC_RELEASE after writing descriptors.
> In current situation someone may see producer incrementation,
> but address stored in this bank doesn't need to be synchronized yet.

Hi Eryk, yes I missed the smp_store_release that __xskq_prod_submit does -
magic of late night refactors :) but main point was to share the approach
in terms of addr storage.

As you also said IFF_TX_SKB_NO_LINEAR case needs to be addressed as well
as it uses the same skb destructor. Since these pages come directly from
umem we don't need this quirk, we should be able to get the addr from
page.

  reply	other threads:[~2025-06-11 13:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250530103506eucas1p1e4091678f4157b928ddfa6f6534a0009@eucas1p1.samsung.com>
2025-05-30 10:34 ` [PATCH bpf v2] xsk: Fix out of order segment free in __xsk_generic_xmit() e.kubanski
2025-05-30 11:56   ` Eryk Kubanski
2025-05-30 16:07   ` Stanislav Fomichev
2025-06-02  9:27     ` Eryk Kubanski
2025-06-02 15:28       ` Stanislav Fomichev
2025-06-02 15:58         ` Eryk Kubanski
2025-06-02 16:03         ` Maciej Fijalkowski
2025-06-02 16:18           ` Eryk Kubanski
2025-06-04 13:50             ` Maciej Fijalkowski
2025-06-04 14:15               ` Eryk Kubanski
2025-06-09 19:41                 ` Maciej Fijalkowski
2025-06-10  9:35                   ` Eryk Kubanski
     [not found]       ` <CGME20250530103506eucas1p1e4091678f4157b928ddfa6f6534a0009@eucms1p3>
2025-06-10  9:11         ` Eryk Kubanski
2025-06-11 13:10           ` Maciej Fijalkowski [this message]
2025-07-03 23:37       ` Jason Xing
2025-07-04 12:34         ` Maciej Fijalkowski
2025-07-04 15:29           ` Jason Xing
2025-06-04 14:41   ` kernel test robot

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=aEmANxmvCLMXdQpi@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=bjorn@kernel.org \
    --cc=e.kubanski@partner.samsung.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=stfomichev@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 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).