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 BBA8F2BAA for ; Thu, 23 Feb 2017 08:14:21 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Feb 2017 23:14:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,197,1484035200"; d="scan'208";a="69163877" Received: from unknown (HELO dpdk5.bj.intel.com) ([172.16.182.188]) by fmsmga006.fm.intel.com with ESMTP; 22 Feb 2017 23:14:19 -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 15:11:42 +0800 Message-Id: <1487833902-20048-1-git-send-email-zhiyong.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487824113-41570-1-git-send-email-zhiyong.yang@intel.com> References: <1487824113-41570-1-git-send-email-zhiyong.yang@intel.com> Subject: [dpdk-dev] [PATCH v2] net/virtio: 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 07:14:22 -0000 The minor change aims to remove the redundant computing and make it easier to understand the code. Cc: yuanhan.liu@linux.intel.com Cc: maxime.coquelin@redhat.com Signed-off-by: Zhiyong Yang --- v2 changes: remove the prefix "fix" and fixline according to yuanhan's advice. drivers/net/virtio/virtio_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index cab6e8f..fcd9e93 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -793,7 +793,7 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rx_pkts[nb_rx++] = rxm; - rxvq->stats.bytes += rx_pkts[nb_rx - 1]->pkt_len; + rxvq->stats.bytes += rxm->pkt_len; virtio_update_packet_stats(&rxvq->stats, rxm); } -- 2.7.4