From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 82F1BA0A02 for ; Mon, 17 May 2021 18:11:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D5AE410F7; Mon, 17 May 2021 18:11:23 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 5B42C40041 for ; Mon, 17 May 2021 18:11:22 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lifpy-0007ak-6I; Mon, 17 May 2021 16:11:22 +0000 From: Christian Ehrhardt To: Dapeng Yu Cc: Jeff Guo , dpdk stable Date: Mon, 17 May 2021 18:07:28 +0200 Message-Id: <20210517161039.3132619-19-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> References: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/e1000: remove MTU setting limitation' has been queued to stable release 19.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 stable release 19.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/19/21. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/8e81ce2881056665cb87b778971c35649acaae23 Thanks. Christian Ehrhardt --- >From 8e81ce2881056665cb87b778971c35649acaae23 Mon Sep 17 00:00:00 2001 From: Dapeng Yu Date: Fri, 19 Feb 2021 18:03:23 +0800 Subject: [PATCH] net/e1000: remove MTU setting limitation [ upstream commit 0984d196be2a92eb6e2e0b926fdb4a06a1d7d823 ] Currently, if requested MTU is bigger than mbuf size and scattered receive is not enabled, setting MTU to that value fails. This patch allows setting this special MTU when device is stopped, because scattered_rx will be re-configured during next port start and driver may enable scattered receive according new MTU value. After this patch, driver may select different receive function automatically after MTU set, according MTU values selected. Fixes: 59d0ecdbf0e1 ("ethdev: MTU accessors") Signed-off-by: Dapeng Yu Acked-by: Jeff Guo --- drivers/net/e1000/em_ethdev.c | 12 ++++++++---- drivers/net/e1000/igb_ethdev.c | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 4a6e6b8d73..5f9e64d3ef 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -1801,11 +1801,15 @@ eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) if (mtu < RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) return -EINVAL; - /* refuse mtu that requires the support of scattered packets when this - * feature has not been enabled before. */ - if (!dev->data->scattered_rx && - frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) + /* + * If device is started, refuse mtu that requires the support of + * scattered packets when this feature has not been enabled before. + */ + if (dev->data->dev_started && !dev->data->scattered_rx && + frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) { + PMD_INIT_LOG(ERR, "Stop port first."); return -EINVAL; + } hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); rctl = E1000_READ_REG(hw, E1000_RCTL); diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index a7886041f6..5edb8e7c68 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -4568,11 +4568,15 @@ eth_igb_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) frame_size > dev_info.max_rx_pktlen) return -EINVAL; - /* refuse mtu that requires the support of scattered packets when this - * feature has not been enabled before. */ - if (!dev->data->scattered_rx && - frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) + /* + * If device is started, refuse mtu that requires the support of + * scattered packets when this feature has not been enabled before. + */ + if (dev->data->dev_started && !dev->data->scattered_rx && + frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) { + PMD_INIT_LOG(ERR, "Stop port first."); return -EINVAL; + } rctl = E1000_READ_REG(hw, E1000_RCTL); -- 2.31.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-17 17:40:30.285337941 +0200 +++ 0019-net-e1000-remove-MTU-setting-limitation.patch 2021-05-17 17:40:29.131809161 +0200 @@ -1 +1 @@ -From 0984d196be2a92eb6e2e0b926fdb4a06a1d7d823 Mon Sep 17 00:00:00 2001 +From 8e81ce2881056665cb87b778971c35649acaae23 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0984d196be2a92eb6e2e0b926fdb4a06a1d7d823 ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ -index 9b8c4a7de5..3c6f643c19 100644 +index 4a6e6b8d73..5f9e64d3ef 100644 @@ -30 +31 @@ -@@ -1805,11 +1805,15 @@ eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +@@ -1801,11 +1801,15 @@ eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) @@ -51 +52 @@ -index 5323504e98..1716d6b904 100644 +index a7886041f6..5edb8e7c68 100644 @@ -54 +55 @@ -@@ -4394,11 +4394,15 @@ eth_igb_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +@@ -4568,11 +4568,15 @@ eth_igb_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)