From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id F1B5637B4 for ; Thu, 26 Jul 2018 11:59:03 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2018 02:59:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,404,1526367600"; d="scan'208";a="77981021" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.86]) ([10.237.220.86]) by orsmga002.jf.intel.com with ESMTP; 26 Jul 2018 02:59:01 -0700 To: Naga Suresh Somarowthu , dev@dpdk.org Cc: remy.horton@intel.com, reshma.pattan@intel.com References: <1532429671-1606-1-git-send-email-naga.sureshx.somarowthu@intel.com> <1532538360-8773-1-git-send-email-naga.sureshx.somarowthu@intel.com> <1532538360-8773-2-git-send-email-naga.sureshx.somarowthu@intel.com> From: "Burakov, Anatoly" Message-ID: Date: Thu, 26 Jul 2018 10:59:00 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1532538360-8773-2-git-send-email-naga.sureshx.somarowthu@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v6 1/4] test: add ring pmd based packet rx/tx for UT 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: , X-List-Received-Date: Thu, 26 Jul 2018 09:59:04 -0000 On 25-Jul-18 6:05 PM, Naga Suresh Somarowthu wrote: > Added ring pmd based packet rx/tx helper functions > for verifying Latency, Bitrate and pdump lib UTs. > > Signed-off-by: Naga Suresh Somarowthu > Reviewed-by: Reshma Pattan > --- > + ret = test_get_mempool(mp, poolname); > + if (ret < 0) > + return -1; > + if (rte_pktmbuf_alloc_bulk(*mp, pbuf, NUM_PACKETS) != 0) { > + printf("%s() line %u: rte_pktmbuf_alloc_bulk failed", __func__, > + __LINE__); > + return -1; > + } > + return 0; > +} > + > +/* sample test to deallocate the allocated buffers */ > +void > +test_put_mbuf_to_pool(struct rte_mempool *mp, struct rte_mbuf **pbuf) > +{ > + int itr = 0; > + > + for (itr = 0; itr < NUM_PACKETS; itr++) > + rte_pktmbuf_free(pbuf[itr]); > + rte_mempool_free(mp); > +} The name and description of the above function is a little misleading. It says it will deallocate buffers, but nowhere does it say that it will also deallocate the mempool. Is that intentional? Other than that, Reviewed-by: Anatoly Burakov -- Thanks, Anatoly