Thread (5 messages) 5 messages, 2 authors, 2017-02-23
STALE3439d

[PATCH] net/virtio: fix remove the redundant computing

From: Zhiyong Yang <hidden>
Date: 2017-02-23 04:31:11
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help