From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 5B1FC2BAA for ; Thu, 23 Feb 2017 07:31:29 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP; 22 Feb 2017 22:31:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,197,1484035200"; d="scan'208";a="68587825" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 22 Feb 2017 22:31:26 -0800 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 22 Feb 2017 22:31:26 -0800 Received: from bgsmsx103.gar.corp.intel.com (10.223.4.130) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 22 Feb 2017 22:31:26 -0800 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.43]) by BGSMSX103.gar.corp.intel.com ([169.254.4.197]) with mapi id 14.03.0248.002; Thu, 23 Feb 2017 12:01:23 +0530 From: "Yang, Zhiyong" To: Yuanhan Liu CC: "dev@dpdk.org" , "maxime.coquelin@redhat.com" Thread-Topic: [PATCH] net/virtio: fix remove the redundant computing Thread-Index: AQHSjY2zFhq05kC8yUmme6/dLV4HB6F1wqMAgABdOkA= Date: Thu, 23 Feb 2017 06:31:23 +0000 Message-ID: References: <1487824113-41570-1-git-send-email-zhiyong.yang@intel.com> <20170223062048.GW18844@yliu-dev.sh.intel.com> In-Reply-To: <20170223062048.GW18844@yliu-dev.sh.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTBkMjE3ZjAtZGYxZS00MzgxLTk4ZDUtY2NmOWRiMmIzZjcwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IittY2MzOFhWanNTTjlSSFcrXC9TR2s5aUpyZUJ5eXpPK2dGdTd2emJ6UVA0PSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/virtio: fix remove the redundant computing 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, 23 Feb 2017 06:31:29 -0000 Hi, yuanhan: > -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Thursday, February 23, 2017 2:21 PM > To: Yang, Zhiyong > Cc: dev@dpdk.org; maxime.coquelin@redhat.com > Subject: Re: [PATCH] net/virtio: fix remove the redundant computing >=20 > On Thu, Feb 23, 2017 at 12:28:33PM +0800, Zhiyong Yang wrote: > > This is not a bug. >=20 > Then adding "fix" prefix and fixline here doesn't seem proper to me. Ok. I will remove them.=20 >=20 > > The minor change aims to remove the redundant computing and make it > > easier to understand the code. > > Fixes:01ad44fd374f("net/virtio: split Rx/Tx queue") > > Cc: yuanhan.liu@linux.intel.com > > Cc: maxime.coquelin@redhat.com > > > > Signed-off-by: Zhiyong Yang > > --- > > drivers/net/virtio/virtio_rxtx.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/virtio/virtio_rxtx.c > > b/drivers/net/virtio/virtio_rxtx.c > > index cab6e8f..14c88c0 100644 > > --- a/drivers/net/virtio/virtio_rxtx.c > > +++ b/drivers/net/virtio/virtio_rxtx.c > > @@ -791,9 +791,9 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf > > **rx_pkts, uint16_t nb_pkts) > > > > VIRTIO_DUMP_PACKET(rxm, rxm->data_len); > > > > - rx_pkts[nb_rx++] =3D rxm; > > + rx_pkts[nb_rx] =3D rxm; > > > > - rxvq->stats.bytes +=3D rx_pkts[nb_rx - 1]->pkt_len; > > + rxvq->stats.bytes +=3D rx_pkts[nb_rx++]->pkt_len; >=20 > Why not use "rxm->pkt_len" directly? Good advice and it's better. >=20 > --yliu