From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: "Björn Töpel" <bjorn.topel@gmail.com>,
intel-wired-lan <intel-wired-lan@lists.osuosl.org>
Cc: Netdev <netdev@vger.kernel.org>,
"Björn Töpel" <bjorn.topel@intel.com>,
"Magnus Karlsson" <magnus.karlsson@gmail.com>,
"Karlsson, Magnus" <magnus.karlsson@intel.com>,
"Jakub Kicinski" <jakub.kicinski@netronome.com>,
"Daniel Borkmann" <daniel@iogearbox.net>,
ast@kernel.org
Subject: Re: [Intel-wired-lan] [PATCH v2 1/4] i40e: clean zero-copy XDP Tx ring on shutdown/reset
Date: Fri, 21 Sep 2018 11:17:30 -0700 [thread overview]
Message-ID: <36294f373ac94ec5858a54b55b98a5df49c7bffe.camel@intel.com> (raw)
In-Reply-To: <CAJ+HfNgYwWo1Cmx81SGSRAPEtVzKvogaWSL17vPuorYpx-U-Lw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]
On Fri, 2018-09-21 at 09:35 +0200, Björn Töpel wrote:
> > --- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
> > @@ -830,3 +830,33 @@ int i40e_xsk_async_xmit(struct net_device
> > *dev, u32 queue_id)
> >
> > return 0;
> > }
> > +
> > +/**
> > + * i40e_xsk_clean_xdp_ring - Clean the XDP Tx ring on shutdown
> > + * @xdp_ring: XDP Tx ring
> > + **/
> > +void i40e_xsk_clean_tx_ring(struct i40e_ring *tx_ring)
> > +{
> > + u16 ntc = tx_ring->next_to_clean, ntu = tx_ring-
> > >next_to_use;
> > + struct xdp_umem *umem = tx_ring->xsk_umem;
> > + struct i40e_tx_buffer *tx_bi;
> > + u32 xsk_frames = 0;
> > +
> > + while (ntc != ntu) {
> > + tx_bi = &tx_ring->tx_bi[ntc];
> > +
> > + if (tx_bi->xdpf)
> > + i40e_clean_xdp_tx_buffer(tx_ring, tx_bi);
> > + else
> > + xsk_frames++;
> > +
> > + tx_bi->xdpf = NULL;
> > +
> > + ntc++;
> > + if (ntc > tx_ring->count)
>
> This is an off-by-one error, and should be:
> if (ntc == tx_ring->count)
>
> Can you fix it up, or should I respin the patch?
I can fix it up.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-09-22 0:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-07 8:18 [PATCH v2 0/4] i40e AF_XDP zero-copy buffer leak fixes Björn Töpel
2018-09-07 8:18 ` [PATCH v2 1/4] i40e: clean zero-copy XDP Tx ring on shutdown/reset Björn Töpel
2018-09-21 7:35 ` [Intel-wired-lan] " Björn Töpel
2018-09-21 18:17 ` Jeff Kirsher [this message]
2018-09-07 8:18 ` [PATCH v2 2/4] net: xsk: add a simple buffer reuse queue Björn Töpel
2018-09-07 8:18 ` [PATCH v2 3/4] i40e: clean zero-copy XDP Rx ring on shutdown/reset Björn Töpel
2018-09-07 8:18 ` [PATCH v2 4/4] i40e: disallow changing the number of descriptors when AF_XDP is on Björn Töpel
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=36294f373ac94ec5858a54b55b98a5df49c7bffe.camel@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=ast@kernel.org \
--cc=bjorn.topel@gmail.com \
--cc=bjorn.topel@intel.com \
--cc=daniel@iogearbox.net \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jakub.kicinski@netronome.com \
--cc=magnus.karlsson@gmail.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@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 NNTP newsgroup(s).