From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id AA4F4A046B for ; Mon, 24 Jun 2019 17:28:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A10BB1BEF9; Mon, 24 Jun 2019 17:28:17 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 31F7D1BEF9 for ; Mon, 24 Jun 2019 17:28:16 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9EEB63092652; Mon, 24 Jun 2019 15:28:10 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-250.ams2.redhat.com [10.36.116.250]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97C2219C69; Mon, 24 Jun 2019 15:28:06 +0000 (UTC) From: Kevin Traynor To: Dilshod Urazov Cc: Andrew Rybchenko , Tiwei Bie , Maxime Coquelin , dpdk stable Date: Mon, 24 Jun 2019 16:25:20 +0100 Message-Id: <20190624152525.19349-56-ktraynor@redhat.com> In-Reply-To: <20190624152525.19349-1-ktraynor@redhat.com> References: <20190624152525.19349-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 24 Jun 2019 15:28:15 +0000 (UTC) Subject: [dpdk-stable] patch 'net/virtio: move VLAN tag insertion to Tx prepare' has been queued to LTS release 18.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 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 Signed-off-by: Andrew Rybchenko Reviewed-by: Tiwei Bie --- 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@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,