From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D574E8D3D for ; Mon, 19 Oct 2015 07:15:33 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 18 Oct 2015 22:15:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,700,1437462000"; d="scan'208";a="814092346" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 18 Oct 2015 22:15:32 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 18 Oct 2015 22:15:32 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 18 Oct 2015 22:15:32 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.204]) with mapi id 14.03.0248.002; Mon, 19 Oct 2015 13:15:30 +0800 From: "Xie, Huawei" To: Stephen Hemminger Thread-Topic: [dpdk-dev] [PATCH v2 6/7] virtio: simple tx routine Thread-Index: AdEKLSv2LM8Lwo+zRPm3Fwi44dKytA== Date: Mon, 19 Oct 2015 05:15:30 +0000 Message-ID: References: <1443537953-23917-1-git-send-email-huawei.xie@intel.com> <1445149744-3217-1-git-send-email-huawei.xie@intel.com> <1445149744-3217-7-git-send-email-huawei.xie@intel.com> <20151018211800.30f4900c@xeon-e3> 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: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 6/7] virtio: simple tx routine X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2015 05:15:34 -0000 On 10/19/2015 12:17 PM, Stephen Hemminger wrote:=0A= > On Sun, 18 Oct 2015 14:29:03 +0800=0A= > Huawei Xie wrote:=0A= >=0A= >> +=0A= >> + for (i =3D 1; i < VIRTIO_TX_FREE_NR; i++) {=0A= >> + m =3D (struct rte_mbuf *)vq->vq_descx[desc_idx++].cookie;=0A= >> + if (likely(m->pool =3D=3D free[0]->pool))=0A= >> + free[nb_free++] =3D m;=0A= >> + else {=0A= >> + rte_mempool_put_bulk(free[0]->pool, (void **)free,=0A= >> + nb_free);=0A= >> + free[0] =3D m;=0A= >> + nb_free =3D 1;=0A= >> + }=0A= >> + }=0A= > This assumes all transmits are from the same pool, which is not necessari= ly true.=0A= =0A= Don't get you. It accumulates all the mbufs from the same pool, free all=0A= of them until it meets one from a different pool.=0A= =0A= if (likely(m->pool =3D=3D free[0]->pool))=0A= =0A= =0A= >=0A= =0A=