From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: Re: [bpf-next V5 PATCH 10/15] xdp: rhashtable with allocator ID to pointer mapping Date: Mon, 26 Mar 2018 23:04:42 +0200 Message-ID: <20180326230442.6510c821@redhat.com> References: <152180742196.20167.5168801400337773178.stgit@firesoul> <152180752969.20167.10855856167552164450.stgit@firesoul> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Netdev , =?UTF-8?B?QmrDtnJuVMO2cGVs?= , "Karlsson, Magnus" , Eugenia Emantayev , Jason Wang , John Fastabend , Eran Ben Elisha , Saeed Mahameed , Gal Pressman , Daniel Borkmann , Alexei Starovoitov , Tariq Toukan , brouer@redhat.com To: Alexander Duyck Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37074 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751076AbeCZVEw (ORCPT ); Mon, 26 Mar 2018 17:04:52 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 23 Mar 2018 09:56:50 -0700 Alexander Duyck 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