From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id B05D38D3D for ; Mon, 19 Oct 2015 07:12:41 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 18 Oct 2015 22:12:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,700,1437462000"; d="scan'208";a="583519391" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 18 Oct 2015 22:12:21 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 18 Oct 2015 22:12:21 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by shsmsx102.ccr.corp.intel.com ([169.254.2.253]) with mapi id 14.03.0248.002; Mon, 19 Oct 2015 13:12:19 +0800 From: "Xie, Huawei" To: Stephen Hemminger Thread-Topic: [dpdk-dev] [PATCH v2 6/7] virtio: simple tx routine Thread-Index: AdEKLLoLLM8Lwo+zRPm3Fwi44dKytA== Date: Mon, 19 Oct 2015 05:12:19 +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> <20151018211925.7c1b9fb2@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:12:42 -0000 On 10/19/2015 12:19 PM, Stephen Hemminger wrote:=0A= > +static inline void __attribute__((always_inline))=0A= > +virtio_xmit_cleanup(struct virtqueue *vq)=0A= > +{=0A= >=0A= > Please don't use always inline, frustrating the compiler isn't going=0A= > to help.=0A= always inline is scattered elsewhere in the dpdk code.=0A= What is the negative effect? Should we remove all of them?=0A= > + uint16_t i, desc_idx;=0A= > + int nb_free =3D 0;=0A= > + struct rte_mbuf *m, *free[VIRTIO_TX_MAX_FREE_BUF_SZ];=0A= > +=0A= > + desc_idx =3D (uint16_t)(vq->vq_used_cons_idx &=0A= > + ((vq->vq_nentries >> 1) - 1));=0A= > + free[0] =3D (struct rte_mbuf *)vq->vq_descx[desc_idx++].cookie;=0A= > + nb_free =3D 1;=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= > +=0A= > + rte_mempool_put_bulk(free[0]->pool, (void **)free, nb_free);=0A= > + vq->vq_used_cons_idx +=3D VIRTIO_TX_FREE_NR;=0A= > + vq->vq_free_cnt +=3D (VIRTIO_TX_FREE_NR << 1);=0A= > +=0A= > + return;=0A= > +}=0A= >=0A= > Don't add return; at end of void functions. It only clutters=0A= > things for no reason.=0A= Agree.=0A= >=0A= =0A=