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 DA46C41EA5 for ; Wed, 15 Mar 2023 23:47:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D5D6140EE4; Wed, 15 Mar 2023 23:47:10 +0100 (CET) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mails.dpdk.org (Postfix) with ESMTP id 0833740A7A for ; Wed, 15 Mar 2023 23:47:09 +0100 (CET) Received: by mail-wr1-f50.google.com with SMTP id r18so18703843wrx.1 for ; Wed, 15 Mar 2023 15:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678920428; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cXxeeOyQfFyHCiCGbCiUTWG/aAV+yEzHTyNbWV808Ks=; b=YwFhSaXnAvAxaMy3gBboT7hR6fkfxDU3zS2/159ifE48JRJD2XQtV+FUh1FziBsatb /+t7/OPNkvNDLJo+AmNXnZb9dKc1svqky9BP4Y0WVj3y5rMAm3AHIswxDfg0i+CvpO4j HL/AQBcBUss9+fDJFIpLv/KXoHgDWTFDPoM1vQ1cqMquj8f/m7pGzbu0jbdooMZGKCAe ZZ4PJJQ3fsDnueJi9MkWpzxPnE3XdiGSx3kldrHOk6qU4YTgs61NZFktyZplDQtIKztw uP2xwGkYx0yDuIOz5Ca8jI1OMer6TCOCIMjK8uLEQCnJQcHDMJRUrVL9JGFRC5xMiwsh LORg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678920428; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cXxeeOyQfFyHCiCGbCiUTWG/aAV+yEzHTyNbWV808Ks=; b=oi1mJZGVTb8hw3+YNjemL/+yZeVktDSeAv7Bc7YDllOqMShVmQ49FzNhc/RarQdNE8 SmjC/xvr5fuAnmr0avIENr0uRqem2k0ccacqu5so4ESrIrq7Zz3/9k3H0nJqBqB6apFe eObrH9a9ZSJvJ4Mkmfm4ob+1ttqEr+Rd2OVOg+x6ClOYyqJI133XMRqEzVuMpCaEdUtO xhzK5GbUUJqHdaQY+fAtIyQZvza3hH5FJ5TiPG/cOUy5y5XFItbJ+zYD8hvCHV9cux2y SMp3iBPxu0//jfJ1KOV3jVGg6XeufJnQDNgU9OFI00Z4cIS4bci4j90Ti3Y6qP/APWxY 6q1w== X-Gm-Message-State: AO0yUKUWoVSYxKNv+tgnZgyi6l98R67VD/l5vD75nzn5fFt8F2TgBlad uIaztNjxIUeu76na+0kgBYIf9/0+UfolCg== X-Google-Smtp-Source: AK7set8D8XOAGrq0X14cJ36gKb4gQ21jcbgfQk5nub1Jgy9H0uH74TV+604bp1kfTiGZnxs3Cm6QPQ== X-Received: by 2002:adf:fc87:0:b0:2ce:da65:1e1d with SMTP id g7-20020adffc87000000b002ceda651e1dmr3298051wrr.24.1678920428562; Wed, 15 Mar 2023 15:47:08 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id d22-20020a05600c34d600b003e20970175dsm3119255wmq.32.2023.03.15.15.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 15:47:08 -0700 (PDT) From: luca.boccassi@gmail.com To: Peng Zhang Cc: Chaoyong He , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , dpdk stable Subject: patch 'net/nfp: fix MTU configuration order' has been queued to stable release 20.11.8 Date: Wed, 15 Mar 2023 22:46:06 +0000 Message-Id: <20230315224631.1025649-15-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315224631.1025649-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-71-luca.boccassi@gmail.com> <20230315224631.1025649-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 20.11.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/17/23. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/b7d178fc9ecdba3366318b6da83b5592dc1d3993 Thanks. Luca Boccassi --- >From b7d178fc9ecdba3366318b6da83b5592dc1d3993 Mon Sep 17 00:00:00 2001 From: Peng Zhang Date: Wed, 8 Mar 2023 10:33:18 +0800 Subject: [PATCH] net/nfp: fix MTU configuration order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 ] If rte_eth_dev_set_mtu() is called before rte_eth_rx_queue_setup() the NFP driver setup fails. This is because the default values evaluated when setting the MTU are initialized in the rte_eth_rx_queue_setup() code path. Fix this by instead initializing the MTU default values in the device initialization, in nfp_net_init() and the check also is conducted in nfp_net_start(), so it doesn't influence the result. This was found by using DPDK with OVS. Fixes: dbad6f64f921 ("net/nfp: fix internal buffer size and MTU check") Signed-off-by: Peng Zhang Reviewed-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/nfp_net.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 4957cc7eda..ed1b4ff0bd 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -95,6 +95,8 @@ static int nfp_net_rss_hash_write(struct rte_eth_dev *dev, static int nfp_set_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr); +#define DEFAULT_FLBUF_SIZE 9216 + /* The offset of the queue controller queues in the PCIe Target */ #define NFP_PCIE_QUEUE(_q) (0x80000 + (NFP_QCP_QUEUE_ADDR_SZ * ((_q) & 0xff))) @@ -2942,6 +2944,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP); hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU); hw->mtu = RTE_ETHER_MTU; + hw->flbufsz = DEFAULT_FLBUF_SIZE; /* VLAN insertion is incompatible with LSOv2 */ if (hw->cap & NFP_NET_CFG_CTRL_LSO2) -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-03-15 22:44:50.497285420 +0000 +++ 0015-net-nfp-fix-MTU-configuration-order.patch 2023-03-15 22:44:49.563849842 +0000 @@ -1 +1 @@ -From 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 Mon Sep 17 00:00:00 2001 +From b7d178fc9ecdba3366318b6da83b5592dc1d3993 Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -25,40 +26,10 @@ - drivers/net/nfp/flower/nfp_flower.c | 1 - - drivers/net/nfp/nfp_common.c | 4 ++-- - drivers/net/nfp/nfp_common.h | 1 + - drivers/net/nfp/nfp_ethdev.c | 1 + - drivers/net/nfp/nfp_ethdev_vf.c | 1 + - 5 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c -index 2c797ae751..6f197396a4 100644 ---- a/drivers/net/nfp/flower/nfp_flower.c -+++ b/drivers/net/nfp/flower/nfp_flower.c -@@ -24,7 +24,6 @@ - #include "nfp_flower_cmsg.h" - - #define CTRL_VNIC_NB_DESC 512 --#define DEFAULT_FLBUF_SIZE 9216 - - static void - nfp_pf_repr_enable_queues(struct rte_eth_dev *dev) -diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c -index 5922bfea8e..5d92b476e2 100644 ---- a/drivers/net/nfp/nfp_common.c -+++ b/drivers/net/nfp/nfp_common.c -@@ -1126,9 +1126,9 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) - return -EBUSY; - } - -- /* MTU larger then current mbufsize not supported */ -+ /* MTU larger than current mbufsize not supported */ - if (mtu > hw->flbufsz) { -- PMD_DRV_LOG(ERR, "MTU (%u) larger then current mbufsize (%u) not supported", -+ PMD_DRV_LOG(ERR, "MTU (%u) larger than current mbufsize (%u) not supported", - mtu, hw->flbufsz); - return -ERANGE; - } -diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h -index 49c89ac327..4486ffa72c 100644 ---- a/drivers/net/nfp/nfp_common.h -+++ b/drivers/net/nfp/nfp_common.h -@@ -111,6 +111,7 @@ struct nfp_net_adapter; + drivers/net/nfp/nfp_net.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c +index 4957cc7eda..ed1b4ff0bd 100644 +--- a/drivers/net/nfp/nfp_net.c ++++ b/drivers/net/nfp/nfp_net.c +@@ -95,6 +95,8 @@ static int nfp_net_rss_hash_write(struct rte_eth_dev *dev, + static int nfp_set_mac_addr(struct rte_eth_dev *dev, + struct rte_ether_addr *mac_addr); @@ -66,2 +36,0 @@ - /* Maximum supported NFP frame size (MTU + layer 2 headers) */ - #define NFP_FRAME_SIZE_MAX 10048 @@ -68,0 +38,3 @@ ++ + /* The offset of the queue controller queues in the PCIe Target */ + #define NFP_PCIE_QUEUE(_q) (0x80000 + (NFP_QCP_QUEUE_ADDR_SZ * ((_q) & 0xff))) @@ -70,19 +42 @@ - #include - #include -diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c -index 47d5dff16c..56fb8e8c73 100644 ---- a/drivers/net/nfp/nfp_ethdev.c -+++ b/drivers/net/nfp/nfp_ethdev.c -@@ -603,6 +603,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) - hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP); - hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU); - hw->mtu = RTE_ETHER_MTU; -+ hw->flbufsz = DEFAULT_FLBUF_SIZE; - - /* VLAN insertion is incompatible with LSOv2 */ - if (hw->cap & NFP_NET_CFG_CTRL_LSO2) -diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c -index 7834b2ee0c..d69ac8cd37 100644 ---- a/drivers/net/nfp/nfp_ethdev_vf.c -+++ b/drivers/net/nfp/nfp_ethdev_vf.c -@@ -365,6 +365,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) +@@ -2942,6 +2944,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)