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

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

From: Yuanhan Liu <hidden>
Date: 2017-02-23 06:18:35

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.
quoted hunk ↗ jump to hunk
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;
Why not use "rxm->pkt_len" directly?

	--yliu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help