[dpdk-stable] patch 'net/virtio: fix Tx packet length stats' has been queued to LTS release 16.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 2 13:02:32 CET 2017


Hi,

FYI, your patch has been queued to LTS release 16.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/04/17. So please
shout if anyone has objections.

Thanks.

Kind regards,
Luca Boccassi

---
>From ab7510c1a80d12547abd886610851c71449f1ac9 Mon Sep 17 00:00:00 2001
From: Zhiyong Yang <zhiyong.yang at intel.com>
Date: Tue, 24 Oct 2017 11:06:14 +0800
Subject: [PATCH] net/virtio: fix Tx packet length stats

[ upstream commit f1216c1eca5a54706af9f13133d06b3477099f8b ]

In the function virtqueue_enqueue_xmit(), when can_push is true,
vtnet_hdr_size is added to pkt_len by calling rte_pktmbuf_prepend.
which is wrong for pkt stats, virtio header length should be subtracted
before calling stats function.

Fixes: 58169a9c8153 ("net/virtio: support Tx checksum offload")

Signed-off-by: Zhiyong Yang <zhiyong.yang at intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Acked-by: Yuanhan Liu <yliu at fridaylinux.org>
---
 drivers/net/virtio/virtio_rxtx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index aa985fb6b..43fac63b6 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -291,6 +291,10 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
 		/* prepend cannot fail, checked by caller */
 		hdr = (struct virtio_net_hdr *)
 			rte_pktmbuf_prepend(cookie, head_size);
+		/* rte_pktmbuf_prepend() counts the hdr size to the pkt length,
+		 * which is wrong. Below subtract restores correct pkt size.
+		 */
+		cookie->pkt_len -= head_size;
 		/* if offload disabled, it is not zeroed below, do it now */
 		if (offload == 0) {
 			ASSIGN_UNLESS_EQUAL(hdr->csum_start, 0);
-- 
2.11.0



More information about the stable mailing list