From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 02/13] mbuf: rte_pktmbuf_free_bulk() Date: Tue, 13 Dec 2016 13:41:11 -0800 Message-ID: <20161213134111.267100b4@xeon-e3> References: <0af54798c5e025c95e1315ef9b33f4c930177f24.1481590851.git.mirq-linux@rere.qmqm.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Return-path: Received: from mail-pg0-f42.google.com (mail-pg0-f42.google.com [74.125.83.42]) by dpdk.org (Postfix) with ESMTP id F28252C8 for ; Tue, 13 Dec 2016 22:41:19 +0100 (CET) Received: by mail-pg0-f42.google.com with SMTP id 3so73320pgd.0 for ; Tue, 13 Dec 2016 13:41:19 -0800 (PST) In-Reply-To: <0af54798c5e025c95e1315ef9b33f4c930177f24.1481590851.git.mirq-linux@rere.qmqm.pl> 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, 13 Dec 2016 02:08:15 +0100 (CET) Micha=C5=82 Miros=C5=82aw wrote: > Signed-off-by: Micha=C5=82 Miros=C5=82aw >=20 > --- > lib/librte_mbuf/rte_mbuf.h | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) >=20 > 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_mbu= f *m) > } > =20 > /** > + * 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 =3D 0; i < n; ++i) > + rte_pktmbuf_free(mp[i]); > +} Why not do something smarter that uses mempool_put_bulk?