Re: [PATCH] net/virtio: fix remove the redundant computing
From: Yang, Zhiyong <hidden>
Date: 2017-02-23 06:31:29
Hi, yuanhan:
-----Original Message----- From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] Sent: Thursday, February 23, 2017 2:21 PM To: Yang, Zhiyong <redacted> Cc: dev@dpdk.org; maxime.coquelin@redhat.com Subject: Re: [PATCH] net/virtio: fix remove the redundant computing On Thu, Feb 23, 2017 at 12:28:33PM +0800, Zhiyong Yang wrote:quoted
This is not a bug.Then adding "fix" prefix and fixline here doesn't seem proper to me.
Ok. I will remove them.
quoted
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.cb/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?
Good advice and it's better.
--yliu