XDP-Newbies Archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Alasdair McWilliam <alasdair.mcwilliam@outlook.com>
Cc: Magnus Karlsson <magnus.karlsson@gmail.com>,
	"magnus.karlsson@intel.com" <magnus.karlsson@intel.com>,
	"xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>
Subject: Re: [PATCH bpf] xsk: fix corrupted packets for XDP_SHARED_UMEM
Date: Fri, 9 Sep 2022 13:04:01 +0200	[thread overview]
Message-ID: <YxsdjrpSpeS96RUA@boxer> (raw)
In-Reply-To: <331B1170-98A9-4C99-B16B-2EDAC6634392@outlook.com>

On Fri, Sep 09, 2022 at 10:15:22AM +0000, Alasdair McWilliam wrote:
> Hi,
> 
> Just to confirm the two patches provided also fixed our internal software as well.
> 
> I’ve seen the patches have made their way to the mainline code so thank you again.

Hey Alasdair,
Great!

> 
> Would you like us to test the 4k ring size fix still?

Yes, this would be much appreciated.
To do so, could you pick up the following:

https://lore.kernel.org/intel-wired-lan/20220901104040.15723-1-maciej.fijalkowski@intel.com/

Let us know of the result.
Maciej

> 
> KR
> Alasdair
> 
> 
> 
> > On 12 Aug 2022, at 11:37, Maciej Fijalkowski <maciej.fijalkowski@intel.com> wrote:
> > 
> > On Fri, Aug 12, 2022 at 10:29:28AM +0000, Alasdair McWilliam wrote:
> >> Maciej, Magnus,
> >> 
> >>>> I have just sent patches and CCed you on them which should address the
> >>>> issue you are observing. I will be grateful if you could test them on your
> >>>> side and get back to us with results. If this won't help then we'll need
> >>>> to dig this more.
> >> 
> >>>> What ring size you're using?
> >> 
> >> I’ve applied both of those patches on top of the patch from Magnus the
> >> other day (including the if (!pool->unaligned) tweak below).
> >> 
> >> With both NIC tx and rx rings at 4096, using xdpsock_multi, all queues
> >> now seem to see process packets, which is good, but only up to ~4096
> >> packets before stalling.
> >> 
> >> However, your additional question about ring size got me to try a tx/rx
> >> ring size of 2048 each, and it springs to life! 2Mpps l2fwd per queue on
> >> 8 queues with xdpsock_multi. Repeated with 4 queues, 2 queues etc and
> >> all looking good.
> > 
> > Awesome!
> > 
> >> 
> >> Seems ICE doesn’t like a 4096 ring size atm. :-)
> > 
> > I have a fix for that, but please give me few days to clean this up. I
> > will be able to share it with you next week and I would really appreciate
> > if you could test this as well.
> > 
> >> 
> >> 
> >>> Thank you so much for testing Alasdair. I believe your tests are
> >>> successful in terms of not getting corrupted packets anymore, which is
> >>> the only thing the patch I sent will fix. So we still have two
> >>> problems to fix for you:
> >>> 
> >>> 1: RSS not working correctly for E810, which is what Maciej is
> >>> addressing in his patch set
> >>> 2: The queue stalls after 4K packets.
> >>> 
> >>> I can take a look at #2 using the application you sent, but after
> >>> applying my patch and Maciej's.
> >> 
> >> 
> >>>>>> static int xp_init_dma_info(struct xsk_buff_pool *pool, struct xsk_dma_map *dma_map)
> >>>>>> {
> >>>>>> +   u32 i;
> >>>>>> +
> >>>>>> +   for (i = 0; i < pool->heads_cnt; i++) {
> >>>>>> +           struct xdp_buff_xsk *xskb = &pool->heads[i];
> >>>>>> +
> >>>>>> +           xp_init_xskb_dma(xskb, pool, dma_map->dma_pages, xskb->orig_addr);
> >>>>>> +   }
> >>>>>> +
> >>> 
> >>> This for loop needs to be protected with an if (!pool->unaligned), but
> >>> I will not send out a new version here. It will be in the version sent
> >>> to the netdev mailing list.
> >> 
> >> To confirm I applied this as well before applying Maciej’s patches.
> >> 
> >> Now we can now run xdpsock_multi with ring sizes at 2048 okay, I’ll spin
> >> up our software stack on this patched kernel to validate that side of
> >> things too.
> > 
> > Glad to hear that! I'll ping you once I have a fix for 4k rings.
> > 
> > Thanks,
> > Maciej
> > 
> >> 
> >> Thank you both!!
> >> Alasdair
> 

      reply	other threads:[~2022-09-09 11:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 11:55 [PATCH bpf] xsk: fix corrupted packets for XDP_SHARED_UMEM Magnus Karlsson
2022-08-11 17:20 ` Alasdair McWilliam
2022-08-11 18:22   ` Maciej Fijalkowski
2022-08-12  5:59     ` Magnus Karlsson
2022-08-12 10:29       ` Alasdair McWilliam
2022-08-12 10:37         ` Maciej Fijalkowski
2022-09-09 10:15           ` Alasdair McWilliam
2022-09-09 11:04             ` Maciej Fijalkowski [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=YxsdjrpSpeS96RUA@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=alasdair.mcwilliam@outlook.com \
    --cc=magnus.karlsson@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=xdp-newbies@vger.kernel.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 read-only IMAP folder(s) and NNTP newsgroup(s).