[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180326230442.6510c821@redhat.com>
Date: Mon, 26 Mar 2018 23:04:42 +0200
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: Alexander Duyck <alexander.duyck@...il.com>
Cc: Netdev <netdev@...r.kernel.org>,
BjörnTöpel <bjorn.topel@...el.com>,
"Karlsson, Magnus" <magnus.karlsson@...el.com>,
Eugenia Emantayev <eugenia@...lanox.com>,
Jason Wang <jasowang@...hat.com>,
John Fastabend <john.fastabend@...il.com>,
Eran Ben Elisha <eranbe@...lanox.com>,
Saeed Mahameed <saeedm@...lanox.com>,
Gal Pressman <galp@...lanox.com>,
Daniel Borkmann <borkmann@...earbox.net>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
Tariq Toukan <tariqt@...lanox.com>, brouer@...hat.com
Subject: Re: [bpf-next V5 PATCH 10/15] xdp: rhashtable with allocator ID to
pointer mapping
On Fri, 23 Mar 2018 09:56:50 -0700
Alexander Duyck <alexander.duyck@...il.com> wrote:
> > +void xdp_return_frame(void *data, struct xdp_mem_info *mem)
> > +{
> > + struct xdp_mem_allocator *xa;
> > +
> > + rcu_read_lock();
> > + if (mem->id)
> > + xa = rhashtable_lookup(mem_id_ht, &mem->id, mem_id_rht_params);
> > + rcu_read_unlock();
> > +
> > + if (mem->type == MEM_TYPE_PAGE_SHARED) {
> > + page_frag_free(data);
> > + return;
> > + }
> > +
> > + if (mem->type == MEM_TYPE_PAGE_ORDER0) {
> > + struct page *page = virt_to_page(data); /* Assumes order0 page*/
> > +
> > + put_page(page);
> > + }
> > +}
> > +EXPORT_SYMBOL_GPL(xdp_return_frame);
> >
>
> I'm not sure what the point is of getting the xa value if it is not
> going to be used. Also I would assume there are types that won't even
> need the hash table lookup. I would prefer to see this bit held off on
> until you have something that actually needs it.
I agree, fixed.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
Powered by blists - more mailing lists