[dpdk-stable] patch 'net/virtio: set offload flag for jumbo frames' has been queued to LTS release 18.11.2

Kevin Traynor ktraynor at redhat.com
Wed Apr 10 18:43:14 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/16/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.

Thanks.

Kevin Traynor

---
>From 0d2dc78c734173e9f98f08edf1cf1b3771e210dd Mon Sep 17 00:00:00 2001
From: Jens Freimann <jfreimann at redhat.com>
Date: Tue, 5 Feb 2019 12:17:02 +0100
Subject: [PATCH] net/virtio: set offload flag for jumbo frames

[ upstream commit 8b90e4358112b9e41f8eaa1ba14c783570307fea ]

Port configuration fails because offload flags don't match the expected
value when max-pkt-len is set to a value that should enable receive port
offloading but doesn't.

The .dev_infos_get callback can be called before the configure callback.
At that time we don't know the maximum packet size yet because it is
only set up when ports are started. So in virtio_dev_info_get() just
always set the jumbo packet offload flag.

Check the maximum packet length at device configure time, because then we
have access to the max-pkt-len value provided by the user. If the
max-pkt-len exceeds the maximum MTU supported by the device we remove
the VIRTIO_NET_F_MTU flag from requested features.

Fixes: a4996bd89c42 ("ethdev: new Rx/Tx offloads API")

Signed-off-by: Jens Freimann <jfreimann at redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 2ba66d291..5f662aabe 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1821,4 +1821,6 @@ virtio_dev_configure(struct rte_eth_dev *dev)
 	const struct rte_eth_txmode *txmode = &dev->data->dev_conf.txmode;
 	struct virtio_hw *hw = dev->data->dev_private;
+	uint32_t ether_hdr_len = ETHER_HDR_LEN + VLAN_TAG_LEN +
+		hw->vtnet_hdr_size;
 	uint64_t rx_offloads = rxmode->offloads;
 	uint64_t tx_offloads = txmode->offloads;
@@ -1835,4 +1837,7 @@ virtio_dev_configure(struct rte_eth_dev *dev)
 	}
 
+	if (rxmode->max_rx_pkt_len > hw->max_mtu + ether_hdr_len)
+		req_features &= ~(1ULL << VIRTIO_NET_F_MTU);
+
 	if (rx_offloads & (DEV_RX_OFFLOAD_UDP_CKSUM |
 			   DEV_RX_OFFLOAD_TCP_CKSUM))
@@ -2186,4 +2191,5 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	host_features = VTPCI_OPS(hw)->get_features(hw);
 	dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
+	dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME;
 	if (host_features & (1ULL << VIRTIO_NET_F_GUEST_CSUM)) {
 		dev_info->rx_offload_capa |=
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-04-10 14:06:08.475025512 +0100
+++ 0006-net-virtio-set-offload-flag-for-jumbo-frames.patch	2019-04-10 14:06:07.766296487 +0100
@@ -1,8 +1,10 @@
-From 8b90e4358112b9e41f8eaa1ba14c783570307fea Mon Sep 17 00:00:00 2001
+From 0d2dc78c734173e9f98f08edf1cf1b3771e210dd Mon Sep 17 00:00:00 2001
 From: Jens Freimann <jfreimann at redhat.com>
 Date: Tue, 5 Feb 2019 12:17:02 +0100
 Subject: [PATCH] net/virtio: set offload flag for jumbo frames
 
+[ upstream commit 8b90e4358112b9e41f8eaa1ba14c783570307fea ]
+
 Port configuration fails because offload flags don't match the expected
 value when max-pkt-len is set to a value that should enable receive port
 offloading but doesn't.
@@ -18,7 +20,6 @@
 the VIRTIO_NET_F_MTU flag from requested features.
 
 Fixes: a4996bd89c42 ("ethdev: new Rx/Tx offloads API")
-Cc: stable at dpdk.org
 
 Signed-off-by: Jens Freimann <jfreimann at redhat.com>
 Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
@@ -27,17 +28,17 @@
  1 file changed, 6 insertions(+)
 
 diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
-index 7c4c1df00..7c2fe76f3 100644
+index 2ba66d291..5f662aabe 100644
 --- a/drivers/net/virtio/virtio_ethdev.c
 +++ b/drivers/net/virtio/virtio_ethdev.c
-@@ -1973,4 +1973,6 @@ virtio_dev_configure(struct rte_eth_dev *dev)
+@@ -1821,4 +1821,6 @@ virtio_dev_configure(struct rte_eth_dev *dev)
  	const struct rte_eth_txmode *txmode = &dev->data->dev_conf.txmode;
  	struct virtio_hw *hw = dev->data->dev_private;
 +	uint32_t ether_hdr_len = ETHER_HDR_LEN + VLAN_TAG_LEN +
 +		hw->vtnet_hdr_size;
  	uint64_t rx_offloads = rxmode->offloads;
  	uint64_t tx_offloads = txmode->offloads;
-@@ -1987,4 +1989,7 @@ virtio_dev_configure(struct rte_eth_dev *dev)
+@@ -1835,4 +1837,7 @@ virtio_dev_configure(struct rte_eth_dev *dev)
  	}
  
 +	if (rxmode->max_rx_pkt_len > hw->max_mtu + ether_hdr_len)
@@ -45,7 +46,7 @@
 +
  	if (rx_offloads & (DEV_RX_OFFLOAD_UDP_CKSUM |
  			   DEV_RX_OFFLOAD_TCP_CKSUM))
-@@ -2340,4 +2345,5 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+@@ -2186,4 +2191,5 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
  	host_features = VTPCI_OPS(hw)->get_features(hw);
  	dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
 +	dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME;


More information about the stable mailing list