From: Zhiyong Yang <zhiyong.yang@intel.com>
To: dev@dpdk.org
Cc: yuanhan.liu@linux.intel.com, maxime.coquelin@redhat.com,
Zhiyong Yang <zhiyong.yang@intel.com>
Subject: [dpdk-dev] [PATCH] net/virtio: fix remove the redundant computing
Date: Thu, 23 Feb 2017 12:28:33 +0800 [thread overview]
Message-ID: <1487824113-41570-1-git-send-email-zhiyong.yang@intel.com> (raw)
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
next reply other threads:[~2017-02-23 4:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-23 4:28 Zhiyong Yang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1487824113-41570-1-git-send-email-zhiyong.yang@intel.com \
--to=zhiyong.yang@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=yuanhan.liu@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).