[dpdk-stable] patch 'net/virtio: move VLAN tag insertion to Tx prepare' has been queued to LTS release 18.11.3

Kevin Traynor ktraynor at redhat.com
Mon Jun 24 17:25:20 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.3

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

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/f57d9e8c085253c77eab3dafe6ca015c09301b17

Thanks.

Kevin Traynor

---
>From f57d9e8c085253c77eab3dafe6ca015c09301b17 Mon Sep 17 00:00:00 2001
From: Dilshod Urazov <dilshod.urazov at oktetlabs.ru>
Date: Mon, 17 Jun 2019 12:31:38 +0100
Subject: [PATCH] net/virtio: move VLAN tag insertion to Tx prepare

[ upstream commit 3f8fb604748bbf7d52122e6478b94311eb75b803 ]

VLAN tag insertion should be in Tx prepare, not in Tx burst functions.
One of Tx prepare goals is to be able to do preparations in advance
(possibly on different CPU core) and then transmit it fast.
Also Tx prepare can report that a packet does not pass Tx offloads
check. E.g. has no enough headroom to insert VLAN header.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")

Signed-off-by: Dilshod Urazov <dilshod.urazov at oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
Reviewed-by: Tiwei Bie <tiwei.bie at intel.com>
---
 drivers/net/virtio/virtio_rxtx.c | 38 ++++++++++++--------------------
 1 file changed, 14 insertions(+), 24 deletions(-)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 4d4487012..4a56fb161 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -1350,4 +1350,18 @@ virtio_xmit_pkts_prepare(void *tx_queue __rte_unused, struct rte_mbuf **tx_pkts,
 #endif
 
+		/* Do VLAN tag insertion */
+		if (unlikely(m->ol_flags & PKT_TX_VLAN_PKT)) {
+			error = rte_vlan_insert(&m);
+			/* rte_vlan_insert() may change pointer
+			 * even in the case of failure
+			 */
+			tx_pkts[nb_tx] = m;
+
+			if (unlikely(error)) {
+				rte_errno = -error;
+				break;
+			}
+		}
+
 		error = rte_net_intel_cksum_prepare(m);
 		if (unlikely(error)) {
@@ -1371,5 +1385,4 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	uint16_t hdr_size = hw->vtnet_hdr_size;
 	uint16_t nb_used, nb_tx = 0;
-	int error;
 
 	if (unlikely(hw->started == 0 && tx_pkts != hw->inject_pkts))
@@ -1390,15 +1403,4 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		int can_push = 0, use_indirect = 0, slots, need;
 
-		/* Do VLAN tag insertion */
-		if (unlikely(txm->ol_flags & PKT_TX_VLAN_PKT)) {
-			error = rte_vlan_insert(&txm);
-			if (unlikely(error)) {
-				rte_pktmbuf_free(txm);
-				continue;
-			}
-			/* vlan_insert may add a header mbuf */
-			tx_pkts[nb_tx] = txm;
-		}
-
 		/* optimize ring usage */
 		if ((vtpci_with_feature(hw, VIRTIO_F_ANY_LAYOUT) ||
@@ -1471,5 +1473,4 @@ virtio_xmit_pkts_inorder(void *tx_queue,
 	uint16_t nb_used, nb_avail, nb_tx = 0, nb_inorder_pkts = 0;
 	struct rte_mbuf *inorder_pkts[nb_pkts];
-	int error;
 
 	if (unlikely(hw->started == 0 && tx_pkts != hw->inject_pkts))
@@ -1496,15 +1497,4 @@ virtio_xmit_pkts_inorder(void *tx_queue,
 		int slots, need;
 
-		/* Do VLAN tag insertion */
-		if (unlikely(txm->ol_flags & PKT_TX_VLAN_PKT)) {
-			error = rte_vlan_insert(&txm);
-			if (unlikely(error)) {
-				rte_pktmbuf_free(txm);
-				continue;
-			}
-			/* vlan_insert may add a header mbuf */
-			tx_pkts[nb_tx] = txm;
-		}
-
 		/* optimize ring usage */
 		if ((vtpci_with_feature(hw, VIRTIO_F_ANY_LAYOUT) ||
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-06-24 16:18:57.956013196 +0100
+++ 0056-net-virtio-move-VLAN-tag-insertion-to-Tx-prepare.patch	2019-06-24 16:18:55.130428887 +0100
@@ -1 +1 @@
-From 3f8fb604748bbf7d52122e6478b94311eb75b803 Mon Sep 17 00:00:00 2001
+From f57d9e8c085253c77eab3dafe6ca015c09301b17 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3f8fb604748bbf7d52122e6478b94311eb75b803 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -19,2 +20,2 @@
- drivers/net/virtio/virtio_rxtx.c | 50 +++++++++-----------------------
- 1 file changed, 14 insertions(+), 36 deletions(-)
+ drivers/net/virtio/virtio_rxtx.c | 38 ++++++++++++--------------------
+ 1 file changed, 14 insertions(+), 24 deletions(-)
@@ -23 +24 @@
-index 07f8f47de..dcce39e8c 100644
+index 4d4487012..4a56fb161 100644
@@ -26 +27 @@
-@@ -1967,4 +1967,18 @@ virtio_xmit_pkts_prepare(void *tx_queue __rte_unused, struct rte_mbuf **tx_pkts,
+@@ -1350,4 +1350,18 @@ virtio_xmit_pkts_prepare(void *tx_queue __rte_unused, struct rte_mbuf **tx_pkts,
@@ -45,23 +46 @@
-@@ -1990,5 +2004,4 @@ virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,
- 	uint16_t nb_tx = 0;
- 	bool in_order = hw->use_inorder_tx;
--	int error;
- 
- 	if (unlikely(hw->started == 0 && tx_pkts != hw->inject_pkts))
-@@ -2008,15 +2021,4 @@ virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,
- 		int can_push = 0, slots, need;
- 
--		/* Do VLAN tag insertion */
--		if (unlikely(txm->ol_flags & PKT_TX_VLAN_PKT)) {
--			error = rte_vlan_insert(&txm);
--			if (unlikely(error)) {
--				rte_pktmbuf_free(txm);
--				continue;
--			}
--			/* vlan_insert may add a header mbuf */
--			tx_pkts[nb_tx] = txm;
--		}
--
- 		/* optimize ring usage */
- 		if ((vtpci_with_feature(hw, VIRTIO_F_ANY_LAYOUT) ||
-@@ -2078,5 +2080,4 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -1371,5 +1385,4 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
@@ -73 +52 @@
-@@ -2097,15 +2098,4 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+@@ -1390,15 +1403,4 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
@@ -89 +68 @@
-@@ -2177,5 +2167,4 @@ virtio_xmit_pkts_inorder(void *tx_queue,
+@@ -1471,5 +1473,4 @@ virtio_xmit_pkts_inorder(void *tx_queue,
@@ -95 +74 @@
-@@ -2202,15 +2191,4 @@ virtio_xmit_pkts_inorder(void *tx_queue,
+@@ -1496,15 +1497,4 @@ virtio_xmit_pkts_inorder(void *tx_queue,


More information about the stable mailing list