From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH] net/virtio: fix remove the redundant computing Date: Thu, 23 Feb 2017 14:20:48 +0800 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 Cc: dev@dpdk.org, maxime.coquelin@redhat.com To: Zhiyong Yang 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) Content-Disposition: inline In-Reply-To: <1487824113-41570-1-git-send-email-zhiyong.yang@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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