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 8E288A0096 for ; Wed, 10 Apr 2019 18:44:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 843B91B11F; Wed, 10 Apr 2019 18:44:29 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 221711B105 for ; Wed, 10 Apr 2019 18:44:28 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8FA95308624B for ; Wed, 10 Apr 2019 16:44:27 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-94.ams2.redhat.com [10.36.117.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71C5E5D965; Wed, 10 Apr 2019 16:44:22 +0000 (UTC) From: Kevin Traynor To: Jens Freimann Cc: Maxime Coquelin , dpdk stable Date: Wed, 10 Apr 2019 17:43:14 +0100 Message-Id: <20190410164411.10546-6-ktraynor@redhat.com> In-Reply-To: <20190410164411.10546-1-ktraynor@redhat.com> References: <20190410164411.10546-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 10 Apr 2019 16:44:27 +0000 (UTC) Subject: [dpdk-stable] patch 'net/virtio: set offload flag for jumbo frames' has been queued to LTS release 18.11.2 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.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 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 Reviewed-by: Maxime Coquelin --- 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 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@dpdk.org Signed-off-by: Jens Freimann Reviewed-by: Maxime Coquelin @@ -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;