patches for DPDK stable branches
 help / color / Atom feed
From: David Christensen <drc@linux.vnet.ibm.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, thibaut.collet@6wind.com,
	maxime.coquelin@redhat.com, tiwei.bie@intel.com,
	zhihong.wang@intel.com,
	David Christensen <drc@linux.vnet.ibm.com>
Subject: [dpdk-stable] [PATCH] net/virtio: fix Rx stats with altivec vectorized functions
Date: Mon, 30 Sep 2019 11:04:01 -0700
Message-ID: <20190930180401.119847-1-drc@linux.vnet.ibm.com> (raw)
In-Reply-To: <cf2cbf6ab9f0f8d1a49960d78b246c01ec8b1375.1568216827.git.thierry.herbelot@6wind.com>

With vectorized functions, only the rx stats for number of packets is
incremented.
Update also the other statistics.
Performance impact is about 2%

Fixes: fc3d66212fed ("virtio: add vector Rx")
Cc: stable@dpdk.org
Cc: thibaut.collet@6wind.com
Cc: maxime.coquelin@redhat.com
Cc: tiwei.bie@intel.com
Cc: zhihong.wang@intel.com

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---
 drivers/net/virtio/virtio_rxtx_simple_altivec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/virtio/virtio_rxtx_simple_altivec.c b/drivers/net/virtio/virtio_rxtx_simple_altivec.c
index 1cd732dec..f856396ab 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_altivec.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_altivec.c
@@ -49,6 +49,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 	struct vring_used_elem *rused;
 	struct rte_mbuf **sw_ring;
 	struct rte_mbuf **sw_ring_end;
+	struct rte_mbuf **ref_rx_pkts;
 	uint16_t nb_pkts_received = 0;
 	const vector unsigned char zero = {0};
 
@@ -108,6 +109,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 			virtqueue_notify(vq);
 	}
 
+	ref_rx_pkts = rx_pkts;
 	for (nb_pkts_received = 0;
 		nb_pkts_received < nb_used;) {
 		vector unsigned char desc[RTE_VIRTIO_DESC_PER_LOOP / 2];
@@ -199,5 +201,8 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 	vq->vq_used_cons_idx += nb_pkts_received;
 	vq->vq_free_cnt += nb_pkts_received;
 	rxvq->stats.packets += nb_pkts_received;
+	for (nb_used = 0; nb_used < nb_pkts_received; nb_used++)
+		virtio_update_packet_stats(&rxvq->stats, ref_rx_pkts[nb_used]);
+
 	return nb_pkts_received;
 }
-- 
2.18.1


  parent reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1568216827.git.thierry.herbelot@6wind.com>
2019-09-11 16:04 ` [dpdk-stable] [PATCH 1/2] virtio: fix rx stats with " Thierry Herbelot
2019-09-27  9:08   ` Maxime Coquelin
2019-09-30 18:04   ` David Christensen [this message]
2019-09-11 16:04 ` [dpdk-stable] [PATCH 2/2] virtio: get all pending rx packets " Thierry Herbelot
2019-09-27  9:09   ` Maxime Coquelin
2019-09-30 18:27   ` [dpdk-stable] [PATCH] net/virtio: fix Rx stats with altivec " David Christensen
2019-10-01 10:00     ` Maxime Coquelin
2019-10-16 11:11     ` Maxime Coquelin
2019-09-30 18:42   ` [dpdk-stable] [PATCH] net/virtio: get all pending Rx packets in altivec vectorized paths David Christensen
2019-10-01 10:06     ` Maxime Coquelin
2019-10-16 11:11     ` Maxime Coquelin

Reply instructions:

You may reply publically 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=20190930180401.119847-1-drc@linux.vnet.ibm.com \
    --to=drc@linux.vnet.ibm.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=thibaut.collet@6wind.com \
    --cc=tiwei.bie@intel.com \
    --cc=zhihong.wang@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

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox