[dpdk-stable] patch 'net/virtio: add Tx preparation' has been queued to LTS release 18.11.3

Kevin Traynor ktraynor at redhat.com
Mon Jun 24 17:25:19 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/3a47da2edff7cf3234454e45d2876354035e7d7b

Thanks.

Kevin Traynor

---
>From 3a47da2edff7cf3234454e45d2876354035e7d7b Mon Sep 17 00:00:00 2001
From: Dilshod Urazov <dilshod.urazov at oktetlabs.ru>
Date: Mon, 17 Jun 2019 12:31:37 +0100
Subject: [PATCH] net/virtio: add Tx preparation

[ upstream commit 00a5ea02e12fc1409901c0149ce87c28a286ea60 ]

Virtio requires pseudo-header checksum in TCP/UDP checksum to do
offload, but it was lost when Tx prepare is introduced. Also
rte_validate_tx_offload() should be used to validate Tx offloads.

Also it is incorrect to do virtio_tso_fix_cksum() after prepend
to mbuf without taking prepended size into account, since layer 2/3/4
lengths provide incorrect offsets after prepend.

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_ethdev.c |  1 +
 drivers/net/virtio/virtio_ethdev.h |  3 +++
 drivers/net/virtio/virtio_rxtx.c   | 32 +++++++++++++++++++++++++++++-
 3 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 74076b9a9..9098cb6f4 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1342,4 +1342,5 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev)
 	struct virtio_hw *hw = eth_dev->data->dev_private;
 
+	eth_dev->tx_pkt_prepare = virtio_xmit_pkts_prepare;
 	if (hw->use_simple_rx) {
 		PMD_INIT_LOG(INFO, "virtio: using simple Rx path on port %u",
diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
index 39a9f7b7d..8eb866073 100644
--- a/drivers/net/virtio/virtio_ethdev.h
+++ b/drivers/net/virtio/virtio_ethdev.h
@@ -83,4 +83,7 @@ uint16_t virtio_recv_mergeable_pkts_inorder(void *rx_queue,
 		struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
 
+uint16_t virtio_xmit_pkts_prepare(void *tx_queue, struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts);
+
 uint16_t virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts);
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index f8311b6e2..4d4487012 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -376,5 +376,4 @@ virtqueue_xmit_offload(struct virtio_net_hdr *hdr,
 		/* TCP Segmentation Offload */
 		if (cookie->ol_flags & PKT_TX_TCP_SEG) {
-			virtio_tso_fix_cksum(cookie);
 			hdr->gso_type = (cookie->ol_flags & PKT_TX_IPV6) ?
 				VIRTIO_NET_HDR_GSO_TCPV6 :
@@ -1333,4 +1332,35 @@ virtio_recv_mergeable_pkts(void *rx_queue,
 }
 
+uint16_t
+virtio_xmit_pkts_prepare(void *tx_queue __rte_unused, struct rte_mbuf **tx_pkts,
+			uint16_t nb_pkts)
+{
+	uint16_t nb_tx;
+	int error;
+
+	for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
+		struct rte_mbuf *m = tx_pkts[nb_tx];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+		error = rte_validate_tx_offload(m);
+		if (unlikely(error)) {
+			rte_errno = -error;
+			break;
+		}
+#endif
+
+		error = rte_net_intel_cksum_prepare(m);
+		if (unlikely(error)) {
+			rte_errno = -error;
+			break;
+		}
+
+		if (m->ol_flags & PKT_TX_TCP_SEG)
+			virtio_tso_fix_cksum(m);
+	}
+
+	return nb_tx;
+}
+
 uint16_t
 virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-06-24 16:18:57.906331697 +0100
+++ 0055-net-virtio-add-Tx-preparation.patch	2019-06-24 16:18:55.129428910 +0100
@@ -1 +1 @@
-From 00a5ea02e12fc1409901c0149ce87c28a286ea60 Mon Sep 17 00:00:00 2001
+From 3a47da2edff7cf3234454e45d2876354035e7d7b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 00a5ea02e12fc1409901c0149ce87c28a286ea60 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -27 +28 @@
-index afb2ca209..04aecb759 100644
+index 74076b9a9..9098cb6f4 100644
@@ -30 +31 @@
-@@ -1486,4 +1486,5 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev)
+@@ -1342,4 +1342,5 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev)
@@ -34,2 +35,2 @@
- 	if (vtpci_packed_queue(hw)) {
- 		PMD_INIT_LOG(INFO,
+ 	if (hw->use_simple_rx) {
+ 		PMD_INIT_LOG(INFO, "virtio: using simple Rx path on port %u",
@@ -37 +38 @@
-index 45e96f32b..20d331795 100644
+index 39a9f7b7d..8eb866073 100644
@@ -40 +41 @@
-@@ -90,4 +90,7 @@ uint16_t virtio_recv_pkts_inorder(void *rx_queue,
+@@ -83,4 +83,7 @@ uint16_t virtio_recv_mergeable_pkts_inorder(void *rx_queue,
@@ -49 +50 @@
-index 1f1178467..07f8f47de 100644
+index f8311b6e2..4d4487012 100644
@@ -52 +53 @@
-@@ -560,5 +560,4 @@ virtqueue_xmit_offload(struct virtio_net_hdr *hdr,
+@@ -376,5 +376,4 @@ virtqueue_xmit_offload(struct virtio_net_hdr *hdr,
@@ -58 +59 @@
-@@ -1950,4 +1949,35 @@ virtio_recv_mergeable_pkts_packed(void *rx_queue,
+@@ -1333,4 +1332,35 @@ virtio_recv_mergeable_pkts(void *rx_queue,
@@ -93 +94 @@
- virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,
+ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)


More information about the stable mailing list