DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: fix remove the redundant computing
@ 2017-02-23  4:28 Zhiyong Yang
  2017-02-23  6:20 ` Yuanhan Liu
  2017-02-23  7:11 ` [dpdk-dev] [PATCH v2] net/virtio: " Zhiyong Yang
  0 siblings, 2 replies; 5+ messages in thread
From: Zhiyong Yang @ 2017-02-23  4:28 UTC (permalink / raw)
  To: dev; +Cc: yuanhan.liu, maxime.coquelin, Zhiyong Yang

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 <zhiyong.yang@intel.com>
---
 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-23  7:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-23  4:28 [dpdk-dev] [PATCH] net/virtio: fix remove the redundant computing Zhiyong Yang
2017-02-23  6:20 ` Yuanhan Liu
2017-02-23  6:31   ` Yang, Zhiyong
2017-02-23  7:11 ` [dpdk-dev] [PATCH v2] net/virtio: " Zhiyong Yang
2017-02-23  7:34   ` Yuanhan Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).