From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id E243436E for ; Thu, 23 Feb 2017 07:18:35 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP; 22 Feb 2017 22:18:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,197,1484035200"; d="scan'208";a="68049746" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga005.jf.intel.com with ESMTP; 22 Feb 2017 22:18:34 -0800 Date: Thu, 23 Feb 2017 14:20:48 +0800 From: Yuanhan Liu To: Zhiyong Yang Cc: dev@dpdk.org, maxime.coquelin@redhat.com Message-ID: <20170223062048.GW18844@yliu-dev.sh.intel.com> References: <1487824113-41570-1-git-send-email-zhiyong.yang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1487824113-41570-1-git-send-email-zhiyong.yang@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) 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:18:36 -0000 On Thu, Feb 23, 2017 at 12:28:33PM +0800, Zhiyong Yang wrote: > This is not a bug. Then adding "fix" prefix and fixline here doesn't seem proper to me. > 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++] = rxm; > + rx_pkts[nb_rx] = rxm; > > - rxvq->stats.bytes += rx_pkts[nb_rx - 1]->pkt_len; > + rxvq->stats.bytes += rx_pkts[nb_rx++]->pkt_len; Why not use "rxm->pkt_len" directly? --yliu