From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <huawei.xie@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id A34F8902
 for <dev@dpdk.org>; Fri, 26 Feb 2016 10:07:28 +0100 (CET)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by fmsmga102.fm.intel.com with ESMTP; 26 Feb 2016 01:07:27 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.22,498,1449561600"; d="scan'208";a="895222730"
Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206])
 by orsmga001.jf.intel.com with ESMTP; 26 Feb 2016 01:07:28 -0800
Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by
 FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Fri, 26 Feb 2016 01:07:25 -0800
Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by
 fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Fri, 26 Feb 2016 01:07:25 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by
 SHSMSX104.ccr.corp.intel.com ([169.254.5.132]) with mapi id 14.03.0248.002;
 Fri, 26 Feb 2016 17:07:16 +0800
From: "Xie, Huawei" <huawei.xie@intel.com>
To: Olivier MATZ <olivier.matz@6wind.com>, Panu Matilainen
 <pmatilai@redhat.com>, "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [dpdk-dev] [PATCH v6 1/2] mbuf: provide rte_pktmbuf_alloc_bulk
 API
Thread-Index: AQHRXqe5goBJK/BsE0CGoql1zgn6kQ==
Date: Fri, 26 Feb 2016 09:07:16 +0000
Message-ID: <C37D651A908B024F974696C65296B57B4C61002C@SHSMSX101.ccr.corp.intel.com>
References: <1450049754-33635-1-git-send-email-huawei.xie@intel.com>
 <1453827815-56384-1-git-send-email-huawei.xie@intel.com>
 <1453827815-56384-2-git-send-email-huawei.xie@intel.com>
 <56A8CCA3.7060302@redhat.com> <56B237AD.1040209@6wind.com>
 <C37D651A908B024F974696C65296B57B4C5EE961@SHSMSX101.ccr.corp.intel.com>
 <C37D651A908B024F974696C65296B57B4C5F0655@SHSMSX101.ccr.corp.intel.com>
 <56D012EF.9090507@6wind.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: "dprovan@bivio.net" <dprovan@bivio.net>
Subject: Re: [dpdk-dev] [PATCH v6 1/2] mbuf: provide rte_pktmbuf_alloc_bulk
 API
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 26 Feb 2016 09:07:29 -0000

On 2/26/2016 4:56 PM, Olivier MATZ wrote:=0A=
>=0A=
> On 02/23/2016 06:35 AM, Xie, Huawei wrote:=0A=
>>>> Also, it would be nice to have a simple test function in=0A=
>>>> app/test/test_mbuf.c. For instance, you could update=0A=
>>>> test_one_pktmbuf() to take a mbuf pointer as a parameter and remove=0A=
>>>> the mbuf allocation from the function. Then it could be called with=0A=
>>>> a mbuf allocated with rte_pktmbuf_alloc() (like before) and with=0A=
>>>> all the mbufs of rte_pktmbuf_alloc_bulk().=0A=
>> Don't quite get you. Is it that we write two cases, one case allocate=0A=
>> mbuf through rte_pktmbuf_alloc_bulk and one use rte_pktmbuf_alloc? It is=
=0A=
>> good to have. =0A=
> Yes, something like:=0A=
>=0A=
> test_one_pktmbuf(struct rte_mbuf *m)=0A=
> {=0A=
> 	/* same as before without the allocation/free */=0A=
> }=0A=
>=0A=
> test_pkt_mbuf(void)=0A=
> {=0A=
> 	m =3D rte_pktmbuf_alloc(pool);=0A=
> 	test_one_pktmbuf(m);=0A=
> 	rte_pktmbuf_free(m);=0A=
>=0A=
> 	ret =3D rte_pktmbuf_alloc_bulk(pool, mtab, BULK_CNT)=0A=
> 	for (i =3D 0; i < BULK_CNT; i++) {=0A=
> 		m =3D mtab[i];=0A=
> 		test_one_pktmbuf(m);=0A=
> 		rte_pktmbuf_free(m);=0A=
> 	}=0A=
> }=0A=
=0A=
This is to test the functionality.=0A=
Let us also have the case like the following?=0A=
        cycles_start =3D rte_get_timer_cycles();=0A=
        while(rounds--) {=0A=
=0A=
		ret =3D rte_pktmbuf_alloc_bulk(pool, mtab, BULK_CNT)=0A=
		for (i =3D 0; i < BULK_CNT; i++) {=0A=
			m =3D mtab[i];=0A=
			/* some work if needed */=0A=
			rte_pktmbuf_free(m);=0A=
		}=0A=
        }=0A=
	cycles_end =3D rte_get_timer_cycles();=0A=
=0A=
to compare with=0A=
       cycles_start =3D rte_get_timer_cycles();=0A=
       while(rounds--) {=0A=
                for (i =3D 0; i < BULK_CNT; i++)=0A=
                    mtab[i] =3D rte_pktmbuf_alloc(...);=0A=
=0A=
		ret =3D rte_pktmbuf_alloc_bulk(pool, mtab, BULK_CNT)=0A=
		for (i =3D 0; i < BULK_CNT; i++) {=0A=
			m =3D mtab[i];=0A=
			/* some work if needed */=0A=
			rte_pktmbuf_free(m);=0A=
		}=0A=
        }=0A=
	cycles_end =3D rte_get_timer_cycles();=0A=
=0A=
=0A=
>> I could do this after this patch.=0A=
> Yes, please.=0A=
>=0A=
>=0A=
> Thanks,=0A=
> Olivier=0A=
>=0A=
=0A=