From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 035962BA1 for ; Thu, 23 Feb 2017 05:31:11 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Feb 2017 20:31:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,197,1484035200"; d="scan'208";a="51609972" Received: from unknown (HELO dpdk5.bj.intel.com) ([172.16.182.188]) by orsmga002.jf.intel.com with ESMTP; 22 Feb 2017 20:31:08 -0800 From: Zhiyong Yang To: dev@dpdk.org Cc: yuanhan.liu@linux.intel.com, maxime.coquelin@redhat.com, Zhiyong Yang Date: Thu, 23 Feb 2017 12:28:33 +0800 Message-Id: <1487824113-41570-1-git-send-email-zhiyong.yang@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [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 04:31:12 -0000 This is not a bug. 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; virtio_update_packet_stats(&rxvq->stats, rxm); } -- 2.7.4