netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	lorenzo.bianconi@redhat.com, davem@davemloft.net,
	kuba@kernel.org, brouer@redhat.com
Subject: Re: [PATCH net-next 1/4] net: xdp: introduce bulking for xdp tx return path
Date: Wed, 28 Oct 2020 12:59:51 +0200	[thread overview]
Message-ID: <20201028105951.GA52697@apalos.home> (raw)
In-Reply-To: <20201028102304.GA5386@lore-desk>

On Wed, Oct 28, 2020 at 11:23:04AM +0100, Lorenzo Bianconi wrote:
> > Hi Lorenzo,
> 
> Hi Ilias,
> 
> thx for the review.
> 
> > 
> > On Tue, Oct 27, 2020 at 08:04:07PM +0100, Lorenzo Bianconi wrote:
> 
> [...]
> 
> > > +void xdp_return_frame_bulk(struct xdp_frame *xdpf,
> > > +			   struct xdp_frame_bulk *bq)
> > > +{
> > > +	struct xdp_mem_info *mem = &xdpf->mem;
> > > +	struct xdp_mem_allocator *xa, *nxa;
> > > +
> > > +	if (mem->type != MEM_TYPE_PAGE_POOL) {
> > > +		__xdp_return(xdpf->data, &xdpf->mem, false);
> > > +		return;
> > > +	}
> > > +
> > > +	rcu_read_lock();
> > > +
> > > +	xa = bq->xa;
> > > +	if (unlikely(!xa || mem->id != xa->mem.id)) {
> > 
> > Why is this marked as unlikely? The driver passes it as NULL. Should unlikely be
> > checked on both xa and the comparison?
> 
> xa is NULL only for the first xdp_frame in the burst while it is set for
> subsequent ones. Do you think it is better to remove it?

Ah correct, missed the general context of the driver this runs in.

> 
> > 
> > > +		nxa = rhashtable_lookup(mem_id_ht, &mem->id, mem_id_rht_params);
> > 
> > Is there a chance nxa can be NULL?
> 
> I do not think so since the page_pool is not destroyed while there are
> in-flight pages, right?

I think so but I am not 100% sure. I'll apply the patch and have a closer look

Cheers
/Ilias

  reply	other threads:[~2020-10-29  0:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 19:04 [PATCH net-next 0/4] xdp: introduce bulking for page_pool tx return path Lorenzo Bianconi
2020-10-27 19:04 ` [PATCH net-next 1/4] net: xdp: introduce bulking for xdp " Lorenzo Bianconi
2020-10-28  9:27   ` Ilias Apalodimas
2020-10-28 10:23     ` Lorenzo Bianconi
2020-10-28 10:59       ` Ilias Apalodimas [this message]
2020-10-28 11:28         ` Lorenzo Bianconi
2020-10-28 11:34   ` Jesper Dangaard Brouer
2020-10-28 11:43     ` Lorenzo Bianconi
2020-10-29 13:52   ` Jesper Dangaard Brouer
2020-10-29 14:02     ` Lorenzo Bianconi
2020-10-29 14:08       ` Ilias Apalodimas
2020-10-27 19:04 ` [PATCH net-next 2/4] net: page_pool: add bulk support for ptr_ring Lorenzo Bianconi
2020-10-29  7:08   ` Ilias Apalodimas
2020-10-29 10:36     ` Lorenzo Bianconi
2020-10-29  7:25   ` Ilias Apalodimas
2020-10-29 10:37     ` Lorenzo Bianconi
2020-10-29 10:13   ` Jesper Dangaard Brouer
2020-10-29 10:31     ` Lorenzo Bianconi
2020-10-29 13:40       ` Jesper Dangaard Brouer
2020-10-27 19:04 ` [PATCH net-next 3/4] net: mvpp2: add xdp tx return bulking support Lorenzo Bianconi
2020-10-27 19:04 ` [PATCH net-next 4/4] net: mlx5: " Lorenzo Bianconi
2020-10-29 11:42   ` Shay Agroskin
2020-10-29 13:15     ` Lorenzo Bianconi

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=20201028105951.GA52697@apalos.home \
    --to=ilias.apalodimas@linaro.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    --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).