From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0D8BBA2EEB for ; Wed, 11 Sep 2019 13:18:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0901B1E943; Wed, 11 Sep 2019 13:18:40 +0200 (CEST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id AD7901E938 for ; Wed, 11 Sep 2019 13:18:38 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id l11so24050394wrx.5 for ; Wed, 11 Sep 2019 04:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M+8nNXuqLBtC0tQaqaJNTUYj0Bf5qIbDrxIE//R3Bbo=; b=J58kflX2RSqdqEzL4HRkLmIPPdB/h9DfK5RiKXiqa+8YiuNA4NPs6ojIvOVBDNOsE7 EzPr36M96PRiJTvjeuZ15ucieK6RRN6WvAhqxoWWEiRke+SonYvcg9MrlgIH27HAhm6O dLldcXI3T+xy57C4WhqZA49Gem3fWy2R1O+B0jQHN+ClffQuOInxlR6NfIIZdeIgfMoO ArjoLXWR9w3VSU0zFSyVoocINcfRkQ1iRe2TIyvY6L6wRdr4cqDcbcU3AiLoBH3m7AZ9 +NEEtiUK5vAviMrxP+Fp+1h6oPs5g7eR2DhbfmypOI0PS1HMLIYY+qupSdhhlcpPpWX2 mDJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M+8nNXuqLBtC0tQaqaJNTUYj0Bf5qIbDrxIE//R3Bbo=; b=Espi0i37MZUxcVOT+Mgg6lCcgYHQ02h+rmN8+N54DeoT8/Vo6Vld1pDPMeRwNYC3CZ RVWEG3/QNj7UZKe1hCncfS61YIagqUKAosA27s++TU/Z2GpfNIb2XSxV3lWK3NU95R5a qYiQPd7x+W7d9e76gUu5hCRYn66xkO6bwNM6RQzY/+3em0caO8oJtzt2PahRe8IOg3b8 F9EUanjWWX2jR7ETwec0mt1Y8sHW/85Sn49xhQAT1SQF4UPotILla2q7qU9khVS7vTKs IlxnHfuMhzIFkxdfzridFQ3My4Dqy70+yKMmY9c1Pffz32znrRzpz8Jh1lrfYoT99ezp 4dAw== X-Gm-Message-State: APjAAAXGCchHORkAW0P50sbcB+nOhNC/NRoHv/dnje7TdavXQIWeeY9D /oN7QCHeA39pUlPUA2XyvqLoWg== X-Google-Smtp-Source: APXvYqzUPxWPwOWsamyp3ZMkeeZ4HzexyRfahzIlLbGIOcvhiuXvbXEFcEjO5M6TPWdss/N9eNxR9w== X-Received: by 2002:adf:f404:: with SMTP id g4mr28625677wro.353.1568200718282; Wed, 11 Sep 2019 04:18:38 -0700 (PDT) Received: from xps13 (110.8.30.213.rev.vodafone.pt. [213.30.8.110]) by smtp.gmail.com with ESMTPSA id p8sm16635076wrq.22.2019.09.11.04.18.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2019 04:18:38 -0700 (PDT) Date: Wed, 11 Sep 2019 12:18:34 +0100 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: olivier.matz@6wind.com, dev@dpdk.org Message-ID: <20190911121834.4ec73590@xps13> In-Reply-To: <20190911091908.123151-1-mb@smartsharesystems.com> References: <20190911091908.123151-1-mb@smartsharesystems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] mbuf: add bulk free function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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 Wed, 11 Sep 2019 09:19:08 +0000 Morten Br=C3=B8rup wrote: > Add function for freeing a bulk of mbufs. >=20 > Signed-off-by: Morten Br=C3=B8rup > --- > lib/librte_mbuf/rte_mbuf.h | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) >=20 > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > index 98225ec80..f2e174da1 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -1907,6 +1907,23 @@ static inline void rte_pktmbuf_free(struct rte_mbu= f *m) > } > } > =20 > +/** > + * Free a bulk of mbufs back into their original mempool. > + * > + * @param mbufs > + * Array of pointers to mbufs > + * @param count > + * Array size > + */ > +static inline void > +rte_pktmbuf_free_bulk(struct rte_mbuf **mbufs, unsigned count) > +{ > + unsigned idx =3D 0; > + > + for (idx =3D 0; idx < count; idx++) > + rte_pktmbuf_free(mbufs[idx]); > +} > + You can optimize this to use mempool bulk put operation.