From: =?iso-8859-2?Q?Micha=B3_Miros=B3aw?= Subject: Re: [PATCH 02/13] mbuf: rte_pktmbuf_free_bulk() Date: Wed, 14 Dec 2016 03:09:23 +0100 Message-ID: <20161214020922.w7osbxj5mvuso7rx@rere.qmqm.pl> References: <0af54798c5e025c95e1315ef9b33f4c930177f24.1481590851.git.mirq-linux@rere.qmqm.pl> <20161213134111.267100b4@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org To: Stephen Hemminger Return-path: Received: from rere.qmqm.pl (rere.qmqm.pl [84.10.57.10]) by dpdk.org (Postfix) with ESMTP id D4FC82C4F for ; Wed, 14 Dec 2016 03:09:23 +0100 (CET) Content-Disposition: inline In-Reply-To: <20161213134111.267100b4@xeon-e3> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Dec 13, 2016 at 01:41:11PM -0800, Stephen Hemminger wrote: > On Tue, 13 Dec 2016 02:08:15 +0100 (CET) > Michał Mirosław wrote: > > > Signed-off-by: Michał Mirosław > > > > --- > > lib/librte_mbuf/rte_mbuf.h | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > > > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > > index ead7c6e..a95d99f 100644 > > --- a/lib/librte_mbuf/rte_mbuf.h > > +++ b/lib/librte_mbuf/rte_mbuf.h > > @@ -1248,6 +1248,21 @@ static inline void rte_pktmbuf_free(struct rte_mbuf *m) > > } > > > > /** > > + * Free multiple packet mbufs back into their original mempool(s). > > + * > > + * @param mp > > + * Pointer to array of packet mbufs to be freed. > > + * @param n > > + * Count of packet mbufs to free. > > + */ > > +static inline void rte_pktmbuf_free_bulk(struct rte_mbuf **mp, uint32_t n) > > +{ > > + uint32_t i; > > + for (i = 0; i < n; ++i) > > + rte_pktmbuf_free(mp[i]); > > +} > > Why not do something smarter that uses mempool_put_bulk? I haven't noticed there even is something like it implemented. I'll have a look. It can be implemented in another patch, though. Best Regards, Michał Mirosław