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 E64A345E41 for ; Sat, 7 Dec 2024 09:04:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD99840EAB; Sat, 7 Dec 2024 09:04:50 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2073.outbound.protection.outlook.com [40.107.95.73]) by mails.dpdk.org (Postfix) with ESMTP id CED7340281 for ; Sat, 7 Dec 2024 09:04:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N6Kb+pVPuKs6Xb4TqALV+Ib+pQUzwFDCyX88Fwh2WnW/AOf45Fpu+7sR7RUeHHbBUr7pIOIwdQ2/uYKxbTWFl1kl5tq110hZPXQwFs5VzLTYMNUQFH3f2DfFwc2vPBeLBM8L4r5H9bfAGwUDMQjhWoxbtsnTqrMeWqOx7V+oICFsOnwXb0ysyCY0B9hT+yOdszPC1B1ywWCDhFPlK2FQNQW/C4fShl/ORjPSESRKodGnjDbZmXQMZF7nR6wcvgyZ6E8gwDLeNhcb/Y8PuO12GIpuTt0hv4h64OsCVIAulgY9FaLKnIbf7P8Qw2jdqMrOQUL9FcnuvK8HVHzxz8ULhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=too4TvmKYmsAYU4+bHy9cb7Dj6OGaHiNLVJWyfzMUtE=; b=i0X4n7CtpOlNh33zNbxYqEHBGPPOmp+hAYrg+8CH5/37IzOe3lHdq0i11RNINmJihcNb/iD+OwCf3l/qcDtWubBNiAmETV3Y9ReRM+MQgdTHcykXHE+++wGprmE4uLBJYBzimk8QVm0zhZUSCTEPc0sJGdtgeUJELe898mMfgY5++GnkDhvfVAhTaJksXasmmoeEfNvj+zRr/L+MOeOt+smV/gOjRq9jzYatVWkUfrMZTMNQxTOVcgFApZ4iBMvJ0wyIgcJTIPqK0NqAEtobJUZaLfU0TFMChP8tiXk04kCICTk1F1QmnzS1ig8cWL4T+1r/Cdy4GFluzdh5GBU3zA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=trustnetic.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=too4TvmKYmsAYU4+bHy9cb7Dj6OGaHiNLVJWyfzMUtE=; b=b1Z4HBhFnKjObyQGhpd6yv8rYdgCO4VYXEEXPpwwqICTi1gzcc5Z4BiI3ZgqucvjBIhFRB6yoUnk4349t2RaEQuYRGfNwXMHJZOe/Wx5NJDuiqjqHaWmJycHmjYkaymEUyR2UkFWNEONJgGXQ8zNBX715aaMzmhOgm2P+IUZYT+adYxZZaYc6fUUpNhKLZKiuTMeuETq0n69mx8UyhE7JcCi7kvrGj2cN9aHmXcZn9eybLWtK50YL1Fe9CMToHncYJyfD7n276iaKxDGVLr9PN+/aFRBVieMMEwnz1L6fEICAEEgnSLr9qKzQiZTKvuBTShPhA47iPaIITZvnHXfyg== Received: from PH1PEPF000132E8.NAMP220.PROD.OUTLOOK.COM (2603:10b6:518:1::28) by MW4PR12MB7120.namprd12.prod.outlook.com (2603:10b6:303:222::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.20; Sat, 7 Dec 2024 08:04:45 +0000 Received: from CY4PEPF0000E9D7.namprd05.prod.outlook.com (2a01:111:f403:f912::5) by PH1PEPF000132E8.outlook.office365.com (2603:1036:903:47::3) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.12 via Frontend Transport; Sat, 7 Dec 2024 08:04:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000E9D7.mail.protection.outlook.com (10.167.241.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Sat, 7 Dec 2024 08:04:44 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:04:33 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:04:31 -0800 From: Xueming Li To: Jiawen Wu CC: Xueming Li , dpdk stable Subject: patch 'net/ngbe: restrict configuration of VLAN strip offload' has been queued to stable release 23.11.3 Date: Sat, 7 Dec 2024 15:59:56 +0800 Message-ID: <20241207080055.488538-39-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207080055.488538-1-xuemingl@nvidia.com> References: <20241111062847.216344-122-xuemingl@nvidia.com> <20241207080055.488538-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D7:EE_|MW4PR12MB7120:EE_ X-MS-Office365-Filtering-Correlation-Id: fc8ff552-1b67-497e-8243-08dd1695cf82 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700013|376014|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?6kvN6yPenMjEkCAY4Z8Bbm+9WfVXSawHN8we8kmL1Lj+cd+OTHXYwS8bGEBH?= =?us-ascii?Q?rqBgqlC691+o0yO18FQM7q1j6psA5Jg43h8zgU62Ri3X8cmG5FkpP3xy1CJW?= =?us-ascii?Q?iZN8Wccbck5CMp4DNS0OigwApGswTYum6NXlEZnKXqhm4uA7K73/bi/95WGY?= =?us-ascii?Q?IoKTz9pWhrjSYq9ziCDFmpGjcYI4zyY5iV6QFu9BcSbzPbcqFiJ5kVAX0zch?= =?us-ascii?Q?emdIL3cFduc16BNSYP7n9fM+IWOmQ5k1mW+6ETtdfYBrbnUB1AFgrQ0hebBq?= =?us-ascii?Q?nDMiovyNaVokOY6izlPIWJaeEwqbvZrvopQj8Qt4HPiZTmyAH+lqxdhFr6qZ?= =?us-ascii?Q?SY+rP8XNZz5lxIE8SrBCpTTr25TBymHi0MaW1tc3YYLtaw1P9QUhkJryYOft?= =?us-ascii?Q?NfvobkInYVHurnbLlw78PTKFl+0ZeCjr/NDa82BmxTNfSujQbUdnX7sWIb02?= =?us-ascii?Q?rL4Szsh/2qyCbNmlHNrVsGMxu5Hzm6l8IBRydsTm+VF5y1YI/FmNBAu/fYhL?= =?us-ascii?Q?gNgXpodH600oVbv/1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?us-ascii?Q?9u4YBoD4A73kMqnSGrdQ/duV8lr9v98U?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2024 08:04:44.3072 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc8ff552-1b67-497e-8243-08dd1695cf82 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D7.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7120 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 23.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 12/10/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=6002cd28d361d0905b7b255c0ba8a62c5a3ca137 Thanks. Xueming Li --- >From 6002cd28d361d0905b7b255c0ba8a62c5a3ca137 Mon Sep 17 00:00:00 2001 From: Jiawen Wu Date: Mon, 4 Nov 2024 10:30:07 +0800 Subject: [PATCH] net/ngbe: restrict configuration of VLAN strip offload Cc: Xueming Li [ upstream commit baca8ec066dc6fdc42374e8eafd67eecfd6c9267 ] There is a hardware limitation that Rx ring config register is not writable when Rx ring is enabled, i.e. the NGBE_RXCFG_ENA bit is set. But disabling the ring when there is traffic will cause ring get stuck. So restrict the configuration of VLAN strip offload only if device is started. Fixes: 59b46438fdaa ("net/ngbe: support VLAN offload and VLAN filter") Signed-off-by: Jiawen Wu --- drivers/net/ngbe/ngbe_ethdev.c | 49 ++++++++++++++-------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c index f48894bdb4..aca6c2aaa1 100644 --- a/drivers/net/ngbe/ngbe_ethdev.c +++ b/drivers/net/ngbe/ngbe_ethdev.c @@ -584,41 +584,25 @@ ngbe_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) } static void -ngbe_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on) +ngbe_vlan_strip_q_set(struct rte_eth_dev *dev, uint16_t queue, int on) { - struct ngbe_hw *hw = ngbe_dev_hw(dev); - struct ngbe_rx_queue *rxq; - bool restart; - uint32_t rxcfg, rxbal, rxbah; - if (on) ngbe_vlan_hw_strip_enable(dev, queue); else ngbe_vlan_hw_strip_disable(dev, queue); +} - rxq = dev->data->rx_queues[queue]; - rxbal = rd32(hw, NGBE_RXBAL(rxq->reg_idx)); - rxbah = rd32(hw, NGBE_RXBAH(rxq->reg_idx)); - rxcfg = rd32(hw, NGBE_RXCFG(rxq->reg_idx)); - if (rxq->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) { - restart = (rxcfg & NGBE_RXCFG_ENA) && - !(rxcfg & NGBE_RXCFG_VLAN); - rxcfg |= NGBE_RXCFG_VLAN; - } else { - restart = (rxcfg & NGBE_RXCFG_ENA) && - (rxcfg & NGBE_RXCFG_VLAN); - rxcfg &= ~NGBE_RXCFG_VLAN; - } - rxcfg &= ~NGBE_RXCFG_ENA; +static void +ngbe_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on) +{ + struct ngbe_hw *hw = ngbe_dev_hw(dev); - if (restart) { - /* set vlan strip for ring */ - ngbe_dev_rx_queue_stop(dev, queue); - wr32(hw, NGBE_RXBAL(rxq->reg_idx), rxbal); - wr32(hw, NGBE_RXBAH(rxq->reg_idx), rxbah); - wr32(hw, NGBE_RXCFG(rxq->reg_idx), rxcfg); - ngbe_dev_rx_queue_start(dev, queue); + if (!hw->adapter_stopped) { + PMD_DRV_LOG(ERR, "Please stop port first"); + return; } + + ngbe_vlan_strip_q_set(dev, queue, on); } static int @@ -844,9 +828,9 @@ ngbe_vlan_hw_strip_config(struct rte_eth_dev *dev) rxq = dev->data->rx_queues[i]; if (rxq->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) - ngbe_vlan_hw_strip_enable(dev, i); + ngbe_vlan_strip_q_set(dev, i, 1); else - ngbe_vlan_hw_strip_disable(dev, i); + ngbe_vlan_strip_q_set(dev, i, 0); } } @@ -908,6 +892,13 @@ ngbe_vlan_offload_config(struct rte_eth_dev *dev, int mask) static int ngbe_vlan_offload_set(struct rte_eth_dev *dev, int mask) { + struct ngbe_hw *hw = ngbe_dev_hw(dev); + + if (!hw->adapter_stopped && (mask & RTE_ETH_VLAN_STRIP_MASK)) { + PMD_DRV_LOG(ERR, "Please stop port first"); + return -EPERM; + } + ngbe_config_vlan_strip_on_all_queues(dev, mask); ngbe_vlan_offload_config(dev, mask); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-12-06 23:26:45.374681312 +0800 +++ 0038-net-ngbe-restrict-configuration-of-VLAN-strip-offloa.patch 2024-12-06 23:26:43.933044828 +0800 @@ -1 +1 @@ -From baca8ec066dc6fdc42374e8eafd67eecfd6c9267 Mon Sep 17 00:00:00 2001 +From 6002cd28d361d0905b7b255c0ba8a62c5a3ca137 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit baca8ec066dc6fdc42374e8eafd67eecfd6c9267 ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ -index 325a9d1eaf..08e87471f6 100644 +index f48894bdb4..aca6c2aaa1 100644 @@ -24 +26 @@ -@@ -586,41 +586,25 @@ ngbe_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) +@@ -584,41 +584,25 @@ ngbe_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) @@ -77 +79 @@ -@@ -846,9 +830,9 @@ ngbe_vlan_hw_strip_config(struct rte_eth_dev *dev) +@@ -844,9 +828,9 @@ ngbe_vlan_hw_strip_config(struct rte_eth_dev *dev) @@ -89 +91 @@ -@@ -910,6 +894,13 @@ ngbe_vlan_offload_config(struct rte_eth_dev *dev, int mask) +@@ -908,6 +892,13 @@ ngbe_vlan_offload_config(struct rte_eth_dev *dev, int mask)