From nobody Fri Sep 25 23:12:15 2026 Received: from OS0P286CU010.outbound.protection.outlook.com (mail-japanwestazon11011058.outbound.protection.outlook.com [40.107.74.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2EFF250BF2; Sun, 20 Sep 2026 15:36:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.74.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789918569; cv=fail; b=HkD3wZP7qYSJSXkvGIXjYc7TVddxfx6z1qopwgrYHKahvAaKtFtSa71SHMDQ1MymkpSRPuw31XCt8mxOrTA6mEDm67Avl7EGpTeYlKWJ0iVQGXHr7QozEO+YceO5Ya1wpINuZaKcwU84gKBYgeOCo0yxKMKUHDHzmBG7UXVhk8k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789918569; c=relaxed/simple; bh=YW36rY8hjJG9/mPilof0JlxUScefoMrpl8wnHEBN9yE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=It/IlMMmS5wYjVUI7fuupJqL/49g005KQTSmi/UXoVS5SMLvNIFSDfGu67Gtb8KbT0UJ7axJIIiZWR0T4b4sShE262J9vZU+7pIYaPV4ctiHc431YzDa+btfTCRb8r1ki8ewm9kX459+apXwBEX8Drj2rENPVDtuA4IFlvJ79bk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=IFnukrm+; arc=fail smtp.client-ip=40.107.74.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="IFnukrm+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MIuU3KXIPyCG09X8+SdBKIvttR/WgT6j3s9kfK9CtTn7wefs+0KWQEcvfGKaz3XXSrpwE7dNhjy1es7cQs4MjsRNdRm2CiF1FcinXbC2EPvRYMBq4bvGdziJlegngCNENXzfdXwWkI+Dfv2K34HAir8k9KE3OeSEj1jmdvgJax5N1mrdVJv8TAhcEOpsk7g2uvchFdB2zhnXqxHtWQmWh6Q+QBIMniTT+IMZcxy9lkpX2/jDDFRqaacTqIGWj1hjwbWbysyo0ty+TCUA3swvY9hCsi7k4XpjFVRv+snygk7aKouYyHFVXz1YP6yBJyQsHu6JrIjyRWZ2jLoJfX3mgQ== 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=RjSBc61ls892xjlJAmJCeJivDhKrntumx+3Kzfv534o=; b=Vf0ZqpqfOy1w3kZg9nSiqw9mC1Hz8p6bL14sHF+HlIzeI6J0SSKYfXVp5/XLZvcUNcdnMIIcMio4UGwqMyQvxTvK+B0Q+6wloHnIUrvOdGsRu3apw16cEAM6rr0psNoN3geffiB5VILvzeTjBzXY6+zFHZN6R9+MCrZTq99vaUtbj1hdenO0j0J1rtQc709TIXZTVqh+13DUpQDC2Xk3lfsyeHdGeo0xM8mm7tgZLMP0ySLj6/Zt2wJ1hFWtKJMooRmuRqmOC8SbSSxmYxhtP5wu0Jzh6JIu+nZr0HEV3TLD6tnfG/Sds1RMhayVhvRGa6wrEhMTQvtzw9DKrJbPwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=bootlin.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RjSBc61ls892xjlJAmJCeJivDhKrntumx+3Kzfv534o=; b=IFnukrm+a2ONn5USpTJRs8AEEUMonzzjv6sRs0xOnJz4yIgZDAcLmhlzbmmx5sBFV0pDZvr/u7VD6DTV912PqSjQeNvdH4s8uJf3abYRTQXZVgazfFaBqYxmEPIdWvVPcjcLSL+qCwVQKMxd3ATVarKbkynUf4rbVhp1eNYMXk8= Received: from TYCP301CA0030.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:381::20) by OS7PR01MB14446.jpnprd01.prod.outlook.com (2603:1096:604:38a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.428.16; Sun, 20 Sep 2026 15:36:00 +0000 Received: from TY1PEPF0000BAD8.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:381:cafe::1b) by TYCP301CA0030.outlook.office365.com (2603:1096:400:381::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.16 via Frontend Transport; Sun, 20 Sep 2026 15:36:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by TY1PEPF0000BAD8.mail.protection.outlook.com (10.167.240.37) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.451.8 via Frontend Transport; Sun, 20 Sep 2026 15:35:59 +0000 Received: from vm01.adwin.renesas.com (DEU-5CG20946WF.adwin.renesas.com [10.226.92.22]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id 41B9C30000BC; Mon, 21 Sep 2026 00:35:53 +0900 (JST) From: Ovidiu Panait To: maxime.chevallier@bootlin.com, recv.jo@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, jun.ann.lai@intel.com, yi.fang.gan@intel.com Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ovidiu Panait Subject: [PATCH net v5 1/5] net: stmmac: Remove VLAN perfect matching dead code Date: Sun, 20 Sep 2026 15:35:12 +0000 Message-ID: <20260920153516.103461-2-ovidiu.panait.rb@renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260920153516.103461-1-ovidiu.panait.rb@renesas.com> References: <20260920153516.103461-1-ovidiu.panait.rb@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY1PEPF0000BAD8:EE_|OS7PR01MB14446:EE_ X-MS-Office365-Filtering-Correlation-Id: bdf12c6a-6db9-4d9f-fa22-08df172cdef0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700016|1800799024|23010399003|7416014|376014|10067099003|11063799006|22082099003|18002099003|56012099006|921020; X-Microsoft-Antispam-Message-Info: 2vqGUfL3qr7wW7NhEarWsuwMQbeyJVNdglnDLo4PIijNxfVJlksjsvajVkcRAAyEqoOSq72uvNEIXR3Povq0pq9/yTR8kQP9O+9732vHrb/CWRoNGgGavFg2QgBNxRHH2IXjgH4NEOyWYslECC+nPccfiQZFnwjaiAmP/pYlrNdniePbUehftVJFG5FVutXl6WTHfcbBtYpmrX2aF4Fs2mysPekhGSMMEjgGCGC3m2LovZ5yrcZ5mAvynDRdP2mbV2cuye2EABLQ1yqx0qRy3GjTOqo6uBw3QADv9vMKHZjdPzUNBg3YgShJZbeEzauk/6tue3Km/RL6eTqor4RSuXp9FfbaLf2B1YBymIX+GNnhVIiZ+b8tNOjl6KkPW01q5I1nRznxzqzNPhRI5eybfry6sk4c6GIP8R9d3Zfu/vgbAWIlGkEN1JXiWfN8HLaDWYosIppFMHEUcvNGUDybXC3rrnaR1bnF8lA/RUwzSu/PnAoDt+Rbc+kwzABXbxK19aGlYoBrjC1n/mLqw+1GJ8g5/CQWl/D0LOSxkPWy0xFVVxmGeDvVnE7RMr6BgIy8Nm2tzomdCdVSIhb1YSsJI3QOjWbQ6UlTVOdou105lEjUKFcSTtbfLtvCqsdleEKUTGUPNEsJtWZMAYhdk2iABJ/ZWV/ivNFm3/LxJH3CMmqqcd3FgKaCngX29XhJWx/PYARc4u7PUw5CK72IAen4vFrzNA9r1HDhaSWCoDhrit20nJ0x+w80xRmWgxHSiIOk X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(1800799024)(23010399003)(7416014)(376014)(10067099003)(11063799006)(22082099003)(18002099003)(56012099006)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gRQpP7cBi2NVOIHsSiAdblQxIZRCMHGBkERFjB+S8cKQyIL5zkyUXl0DXEzhjNAJ+dDPvZEVt3oHby3IFT2nOqtGlYjCub1zO2Gf83CiNjqwHr3hFLJZzXs9HOk2n0QvE36UBJyRYS+5B5fpykYmIaQcS8HfMZJYWhRzSv3u8E0mu6WMlIKL0++H2EQFF+kxu4EaQytzhnloZ5vK9RxkYHLGtr+DQ3lI4Ur10l7kGNlMCclVEqx1XCRYpMk5znu3hzdw0GQJopGGOJJKPezAZMyWPvc/7nMw8e2y8rxUvgK79QU++N9veZnpmFbDHzfxf9BJm5Avm1C8ybB0ORcALvUKRoJ5HipzBc5UFBwncoBwjVvhPMwdVguDEHswX7ZtlJSffi3wphk8R1UyfiDzufP8juKJi89NJRq4fRnnbDTnMEJ37qaPUDRPiZUXQ7JZ X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2026 15:35:59.5745 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bdf12c6a-6db9-4d9f-fa22-08df172cdef0 X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: TY1PEPF0000BAD8.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7PR01MB14446 Content-Type: text/plain; charset="utf-8" stmmac_vlan_update() falls back to "perfect matching" when the VLAN hash filter is unavailable (!priv->dma_cap.vlhash). This fallback has been unreachable in normal operation since its introduction in commit c7ab0b8088d7 ("net: stmmac: Fallback to VLAN Perfect filtering if HASH is not available") because the NETIF_F_HW_VLAN_{CTAG,STAG}_FILTER features are advertised only when priv->dma_cap.vlhash is true. The fallback is also duplicating the code in vlan_add_hw_rx_fltr(), which is always available since stmmac_get_num_vlan() returns at least 1. Therefore, remove it. Fixes: c7ab0b8088d7 ("net: stmmac: Fallback to VLAN Perfect filtering if HA= SH is not available") Signed-off-by: Ovidiu Panait Reviewed-by: Maxime Chevallier --- v5 changes: None v4 changes: None. drivers/net/ethernet/stmicro/stmmac/hwif.h | 2 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 13 +----- .../net/ethernet/stmicro/stmmac/stmmac_vlan.c | 41 +------------------ 3 files changed, 4 insertions(+), 52 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ether= net/stmicro/stmmac/hwif.h index 9314bcb85c22..734e30caea81 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h @@ -633,7 +633,7 @@ struct stmmac_est_ops { struct stmmac_vlan_ops { /* VLAN */ void (*update_vlan_hash)(struct mac_device_info *hw, u32 hash, - u16 perfect_match, bool is_double); + bool is_double); void (*enable_vlan)(struct mac_device_info *hw, u32 type); void (*rx_hw_vlan)(struct mac_device_info *hw, struct dma_desc *rx_desc, struct sk_buff *skb); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 1fb5f804ea23..d0643a30db1c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6835,29 +6835,18 @@ static u32 stmmac_vid_crc32_le(__le16 vid_le) static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double) { u32 crc, hash =3D 0; - u16 pmatch =3D 0; - int count =3D 0; u16 vid =3D 0; =20 for_each_set_bit(vid, priv->active_vlans, VLAN_N_VID) { __le16 vid_le =3D cpu_to_le16(vid); crc =3D bitrev32(~stmmac_vid_crc32_le(vid_le)) >> 28; hash |=3D (1 << crc); - count++; - } - - if (!priv->dma_cap.vlhash) { - if (count > 2) /* VID =3D 0 always passes filter */ - return -EOPNOTSUPP; - - pmatch =3D vid; - hash =3D 0; } =20 if (!netif_running(priv->dev)) return 0; =20 - return stmmac_update_vlan_hash(priv, priv->hw, hash, pmatch, is_double); + return stmmac_update_vlan_hash(priv, priv->hw, hash, is_double); } =20 /* FIXME: This may need RXC to be running, but it may be called with BH diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_vlan.c index e24efe3bfedb..983a90cb9767 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c @@ -162,7 +162,7 @@ static void vlan_restore_hw_rx_fltr(struct net_device *= dev, } =20 static void vlan_update_hash(struct mac_device_info *hw, u32 hash, - u16 perfect_match, bool is_double) + bool is_double) { void __iomem *ioaddr =3D hw->pcsr; u32 value; @@ -184,20 +184,6 @@ static void vlan_update_hash(struct mac_device_info *h= w, u32 hash, } =20 writel(value, ioaddr + VLAN_TAG); - } else if (perfect_match) { - u32 value =3D VLAN_ETV; - - if (is_double) { - value |=3D VLAN_EDVLP; - value |=3D VLAN_ESVL; - value |=3D VLAN_DOVLTC; - } else { - value &=3D ~VLAN_EDVLP; - value &=3D ~VLAN_ESVL; - value &=3D ~VLAN_DOVLTC; - } - - writel(value | perfect_match, ioaddr + VLAN_TAG); } else { value &=3D ~(VLAN_VTHM | VLAN_ETV); value &=3D ~(VLAN_EDVLP | VLAN_ESVL); @@ -251,7 +237,7 @@ static void vlan_set_hw_mode(struct mac_device_info *hw) } =20 static void dwxgmac2_update_vlan_hash(struct mac_device_info *hw, u32 hash, - u16 perfect_match, bool is_double) + bool is_double) { void __iomem *ioaddr =3D hw->pcsr; =20 @@ -279,29 +265,6 @@ static void dwxgmac2_update_vlan_hash(struct mac_devic= e_info *hw, u32 hash, =20 value &=3D ~VLAN_VID; writel(value, ioaddr + VLAN_TAG); - } else if (perfect_match) { - u32 value =3D readl(ioaddr + XGMAC_PACKET_FILTER); - - value |=3D XGMAC_FILTER_VTFE; - - writel(value, ioaddr + XGMAC_PACKET_FILTER); - - value =3D readl(ioaddr + VLAN_TAG); - - value &=3D ~VLAN_VTHM; - value |=3D VLAN_ETV; - if (is_double) { - value |=3D VLAN_EDVLP; - value |=3D VLAN_ESVL; - value |=3D VLAN_DOVLTC; - } else { - value &=3D ~VLAN_EDVLP; - value &=3D ~VLAN_ESVL; - value &=3D ~VLAN_DOVLTC; - } - - value &=3D ~VLAN_VID; - writel(value | perfect_match, ioaddr + VLAN_TAG); } else { u32 value =3D readl(ioaddr + XGMAC_PACKET_FILTER); =20 --=20 2.34.1 From nobody Fri Sep 25 23:12:15 2026 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010066.outbound.protection.outlook.com [52.101.229.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3EAB3C4167; Sun, 20 Sep 2026 15:36:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789918575; cv=fail; b=Q2D1rYFYu6Gy7PCj1RHOmk05v6IwKc5kUJAcrnUTLOCvzlrnddjCFbhULZI54c4R2y383xYMeCM52NyyKAGTuAu+Lc2lEJXHRHS1xfRDc1qq2pqU359hosftLk7vUheRUluzke6RRS8rOFpiEFkiK4t6v90l1dhgDv0fFFSdOQo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789918575; c=relaxed/simple; bh=lqTmmSzFpITRXgGBUHGy7u4nza0AsCgSvPhX9aOGylQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LHs7AOjyvxFaASb3AFbFOhL437dCuHU2pnkINmgh4sKT+Ssu+8rwNLXerx2gey64neENsDgtz0pbDdmDu+Bm0yvqZ3dDBnrmQk/Xg52pNLt0EzfMzBbK9Y8HRfqMKKpgfh/I77vwH8FweCWA/XALVh9cwvF9h7uwMAwHDNA8aHw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=Caxalaz8; arc=fail smtp.client-ip=52.101.229.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="Caxalaz8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l3gRqvLNXYIBMer6kJxvOZUezyKFqViHf+WElIVhamKBjTcSVLYf0st+N+r8SZYuRjyRBxQekE6izQ5Wq2lqqsySAKf1F3gZAXsU9WTH6vQhletSLgig4eZz7NNjUuyZDS/4tS7ZlJuSb/W3Q9dwgcz+TFdliuob1bYi5axdi3AL/FqJe9kI8Ocj2EwlOrzyjywZlnxyiIRyj1R1GTdWYpX/9D335Hg4SRbFYL8LrDxnQcFxKtziLJ9V0t0X44AVfgN3V0PCZGy+gxBr2Ag+1H+wvyvkNnSJV7P+YFajLbQdNbG2e7VN94gnsbTkKt8wDY++IJTQ2PXxOHkds1R87w== 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=R1QMBs42lbf5W8fEMFnZutVKbcHq6PN61OYQJMcui38=; b=ZeHps0IWAXZAMnorXxUfZKUilM0RlIKdiz8WG5c9m1Jp2LXJHfpRYXK5+lAmlz6K20GU/zwm0fotEb3TgIS/HNB6SCDyoiAic8hxBfDApF73vKaKcw2R74lxuyDPeepF63iIy78CZeilGk+Nx+Z15NysvQu2/myq1j916x3CC1M629Uv4GbKDLrOOn+9PzPH8TL8Yksg29QpXQY2sgcKstlQygZzP+BCpsyaMIW5Nf/GjuDdrNHkQv/y3pgKlbq9CC9VpbwieuelVjPzzVKoMcUZXu973Allof2co+HSGnnQa1/pfzimOJ7Dyfe7B4DNRBeOmEA4wv0k3r+eW1YPow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=bootlin.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R1QMBs42lbf5W8fEMFnZutVKbcHq6PN61OYQJMcui38=; b=Caxalaz87whSaGAnwpwVEbmoYvnT/280X3rUn/m0Ip4ufLUW7ytzrgb65B3alE2qxcSFl12JzEvUMBKPmw2otdj7k2neVhmOa+wWs91qYeSAUSDJjid/NrhFwhgamjywwqxW55wPrVCO28s3/FT/n1PtzTaQC6AGeKaN7Na8XO4= Received: from TY4P286CA0069.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:371::11) by OS3PR01MB8793.jpnprd01.prod.outlook.com (2603:1096:604:153::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.428.14; Sun, 20 Sep 2026 15:36:06 +0000 Received: from TYO1EPF0000501F.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:371:cafe::c) by TY4P286CA0069.outlook.office365.com (2603:1096:405:371::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.16 via Frontend Transport; Sun, 20 Sep 2026 15:36:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by TYO1EPF0000501F.mail.protection.outlook.com (10.167.240.4) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.451.8 via Frontend Transport; Sun, 20 Sep 2026 15:36:05 +0000 Received: from vm01.adwin.renesas.com (DEU-5CG20946WF.adwin.renesas.com [10.226.92.22]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id 09DDC30000BB; Mon, 21 Sep 2026 00:35:59 +0900 (JST) From: Ovidiu Panait To: maxime.chevallier@bootlin.com, recv.jo@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, jun.ann.lai@intel.com, yi.fang.gan@intel.com Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ovidiu Panait Subject: [PATCH net v5 2/5] net: stmmac: Stop toggling the EDVLP bit Date: Sun, 20 Sep 2026 15:35:13 +0000 Message-ID: <20260920153516.103461-3-ovidiu.panait.rb@renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260920153516.103461-1-ovidiu.panait.rb@renesas.com> References: <20260920153516.103461-1-ovidiu.panait.rb@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYO1EPF0000501F:EE_|OS3PR01MB8793:EE_ X-MS-Office365-Filtering-Correlation-Id: 075475c0-8a89-453c-c132-08df172ce25c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|23010399003|7416014|376014|82310400026|36860700016|921020|22082099003|18002099003|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: NCETQQiG/LDWAN0isCi1frBHCu9jr0UzkizyR0yFF3GMFQW31A1OO8CGUO7XWOnIv4fkVp+y34ZeV9jqSMAvHSiclH2i1p6N7kAMLE46ephiuImQIPp545opWcAk+0AcZob/AfzK8YII54fV92ejVZAJ2A3bEF2E3K7E4quDZPumvmr4SPOx25+OxnHkJYv7uteIkme3oy+qe0hPKYtuDB8x9AFcRICe6N57UmrmiVLoKox84aivwTKqXsajeD6iBuYlxlSlW09KRmHQybPKSa40Y+l3ohKCViJJIRrshbTjoY8eYIp+gfHBsaIjyAksGz3/ic5Rg5RzkgCpCPmbhzOsVR3SstYa/4MfAKU9FhmvelRKosK3pMS/heJRb+vKNs9h8Ujhuh13gwoBby5lpPzXICjmrUAbfHvsa+PvJI+JQeMGRob2ZVDzK0dTu4EdmPsEEAYubxYkk5jdF0RpbYSrwQZQEfuvCnp6eksXfYvfLdv+6Eye7j1HNm+vr4pyuZ9ly9GXUHR8b44QMtM0zAyfbjAShmTKTbxMulgikzThI+xx6P6Chv2s5LdMv/GAr1G+CqPqIZ1BZkBpqRD8Mnx3HJHg9LPMA4Y/+qCT2Z1fSKMNENMADvboyFRbz5GU8GkYynig/5QVnHdxv3KH1XSSLyjnDoJSu5F4sQMS+ewo28qqBUxkUTaNZFQT41J+mxemfCBnh+YEn14xWPV+AWMUAJ6+KrPFYn9TdwAr1UZiMAjBaqqejvw6gZGmE/1W X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(7416014)(376014)(82310400026)(36860700016)(921020)(22082099003)(18002099003)(56012099006)(11063799006)(10067099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: C7RPhhAhjMW4i3cMwY3mCd+JFAO48CxReLAF3mk5xQM/P+QkVaFk296wn6Rmiv5TgH1Y6PqU8LszZ7dpCX0Gm5ghoKUyoa7MevaxsA7r4yA+K2G9ySniGsxycPsZWUOXcU6lSlVgaCkSXHsJZHOp4m+YMWOpdLURaHXU5/4IOTf46bzYiUUCSbgFQW1CSVZMHSocONt+/BTq7OlRteXiYfywOCWS77UOQIp6HAzC1l2Zw1vq77r9TMZBIEjJA/s9xc8fk1uAyS5zv2WPDp6iJUOMy3hHTqNkbgPwxf77nVHtMOG1f1QSWFMRbd5gjD19gRnWnHD1t+JwpKcb2ljc8vO5N1TnH3DTMRDGpnVE7nd5SSjToyuB7p3cGlCgjRFBcIXpweZCZTG14RSo4lWFdGbTwFSGcS3Ux5YZAX4q4MMkdXsxdUO3SU0TzooOvBlv X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2026 15:36:05.3135 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 075475c0-8a89-453c-c132-08df172ce25c X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: TYO1EPF0000501F.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB8793 Content-Type: text/plain; charset="utf-8" Currently, the double VLAN EDVLP bit is toggled whenever an 802.1ad VLAN is registered. This bit enables processing of the inner VLAN tag, which is completely unrelated to S-Tag VLAN handling. Move EDVLP handling into vlan_set_hw_mode() instead, and keep it always enabled, so that COE can work for packets with an inner VLAN header. Add a dedicated callback for dwxlgmac2, as it doesn't implement the set_hw_vlan_mode callback, like the other cores. Suggested-by: Joseph Steel Signed-off-by: Ovidiu Panait --- v5 changes: None. v4 changes: - New patch. .../net/ethernet/stmicro/stmmac/stmmac_vlan.c | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_vlan.c index 983a90cb9767..200b34588c7f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c @@ -174,19 +174,16 @@ static void vlan_update_hash(struct mac_device_info *= hw, u32 hash, if (hash) { value |=3D VLAN_VTHM | VLAN_ETV; if (is_double) { - value |=3D VLAN_EDVLP; value |=3D VLAN_ESVL; value |=3D VLAN_DOVLTC; } else { - value &=3D ~VLAN_EDVLP; value &=3D ~VLAN_ESVL; value &=3D ~VLAN_DOVLTC; } =20 writel(value, ioaddr + VLAN_TAG); } else { - value &=3D ~(VLAN_VTHM | VLAN_ETV); - value &=3D ~(VLAN_EDVLP | VLAN_ESVL); + value &=3D ~(VLAN_VTHM | VLAN_ETV | VLAN_ESVL); value &=3D ~VLAN_DOVLTC; value &=3D ~VLAN_VID; =20 @@ -222,6 +219,7 @@ static void vlan_set_hw_mode(struct mac_device_info *hw) void __iomem *ioaddr =3D hw->pcsr; u32 value =3D readl(ioaddr + VLAN_TAG); =20 + value |=3D VLAN_EDVLP; value &=3D ~VLAN_TAG_CTRL_EVLS_MASK; =20 if (hw->hw_vlan_en) @@ -254,11 +252,9 @@ static void dwxgmac2_update_vlan_hash(struct mac_devic= e_info *hw, u32 hash, =20 value |=3D VLAN_VTHM | VLAN_ETV; if (is_double) { - value |=3D VLAN_EDVLP; value |=3D VLAN_ESVL; value |=3D VLAN_DOVLTC; } else { - value &=3D ~VLAN_EDVLP; value &=3D ~VLAN_ESVL; value &=3D ~VLAN_DOVLTC; } @@ -274,8 +270,7 @@ static void dwxgmac2_update_vlan_hash(struct mac_device= _info *hw, u32 hash, =20 value =3D readl(ioaddr + VLAN_TAG); =20 - value &=3D ~(VLAN_VTHM | VLAN_ETV); - value &=3D ~(VLAN_EDVLP | VLAN_ESVL); + value &=3D ~(VLAN_VTHM | VLAN_ETV | VLAN_ESVL); value &=3D ~VLAN_DOVLTC; value &=3D ~VLAN_VID; =20 @@ -283,6 +278,14 @@ static void dwxgmac2_update_vlan_hash(struct mac_devic= e_info *hw, u32 hash, } } =20 +static void dwxlgmac2_set_hw_vlan_mode(struct mac_device_info *hw) +{ + void __iomem *ioaddr =3D hw->pcsr; + u32 value =3D readl(ioaddr + VLAN_TAG); + + writel(value | VLAN_EDVLP, ioaddr + VLAN_TAG); +} + const struct stmmac_vlan_ops dwmac_vlan_ops =3D { .update_vlan_hash =3D vlan_update_hash, .enable_vlan =3D vlan_enable, @@ -296,6 +299,7 @@ const struct stmmac_vlan_ops dwmac_vlan_ops =3D { const struct stmmac_vlan_ops dwxlgmac2_vlan_ops =3D { .update_vlan_hash =3D dwxgmac2_update_vlan_hash, .enable_vlan =3D vlan_enable, + .set_hw_vlan_mode =3D dwxlgmac2_set_hw_vlan_mode, }; =20 const struct stmmac_vlan_ops dwxgmac210_vlan_ops =3D { --=20 2.34.1 From nobody Fri Sep 25 23:12:15 2026 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011058.outbound.protection.outlook.com [52.101.125.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6873F424D5A; Sun, 20 Sep 2026 15:36:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789918580; cv=fail; b=UwLomXlXHiFwjMZlatE74qq49le1/Y+95PKVwFA9fRApVpI43EXljeLc0pNKJ/m6KGcQDworbg+0x2ETdSwbB/lvBd/2+CZ+b5KmXzQXmldJhs85P/sGIiNQHENIq1d3wFlj0sIvBL2JKU4MjLTMJOEUHuKvXQKcbm8HNx1y8jw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789918580; c=relaxed/simple; bh=JkCaPXjNyiU/vBWY6yYEi1fiFA1F6uUgX+GvnZDvVZI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PbfpoIOZNkCRohM1h3xy+PXofRBzwcOG6ugVw0EoBJ9gam8rMcU6uJ30k17TjWnKyvxXRZTDys4K7KzaLKkO/O7Zn3XRNCTy8aZJd/AR/xykJalES70Hlsm4NkJW3nArNPm9mFwA8QjzFcVoKjiHA+M0jHfP4EIB1EHzWoHeqE8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=o0QNLRNu; arc=fail smtp.client-ip=52.101.125.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="o0QNLRNu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EnJbH3kvR5foPqnOvhqEBXd78QBUvGtHNrMCXFNvzHFkDKDJMEwHmTr0uWTcqUguGJilHDzy6hj/ojZAmPWGqqjlbhC8dBNQ8prFI7u6Ci09FoN6ftPManzp6NBdnx2YyjD33EPt7ncLvUe9pLuiDxzhFtyZbujXA0TzwOcCI6UX/VgPyXAWg7zEHcNEjvTsoqY07TQifGictURn0SY4bAn5BTbP203RlQR+tvtqqythnymE9xkp+HIgyaSulINpm0eTTRp46i9rfoLbRK8P4SNMCGvxvDFEWmBd7SwLubXn6fMNCDocganW00qGCmZu4345JpURIS8gA99IixxF2A== 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=b70k04A9dwNfyhrzLu7MGL7XNkk9LD4ScoyZx01gnbo=; b=MpLQk60k9DNmrhf8FT8dT5eAeOD284BHrO3gM7VHnZXPzKY+AfSg6w8GHzKKgE4A1NJPqtzoPVSNJBXSAhn/DAXH62IKuyf45BSYXEzFiCFE4mQVPjmE3Hg7Itg0mb6oDdMubVAIV4AAmR4fbc0pAuUO6W/XiosDkwp3eyqXqjQgdLlqZzAOdTnDWN+CGXvCairreeqUbmdO31kVQsAQ7eQngM4P5+b/Y1JpQkVwXL/iSuv3jazQ0lBo1BdNM0LTmIG18q0HucyuXcJxcSTL5p6tR3U1BzXkS669EFfWkUdBh0aehnZJuPGhL1tYvA+9BWMDShF7SRIIhqCBg6o/Iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=bootlin.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b70k04A9dwNfyhrzLu7MGL7XNkk9LD4ScoyZx01gnbo=; b=o0QNLRNuXNZawsSUPQWFSu1+UZXHDjKd2GNy5rB93RLWrUaSmQ4uVDWjpmHCLLiUFIuJgxuIsVrHisao+APrWKkZG7RSag8fHxR4luY10LbKO7g5n903j2y4LM29Vb/0/vXpFCpaQC4l8FnAkkcMkrygJf2T1gNkoSjKFqJguNo= Received: from TY4P286CA0111.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:380::6) by TY4PR01MB13839.jpnprd01.prod.outlook.com (2603:1096:405:1fc::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.428.16; Sun, 20 Sep 2026 15:36:12 +0000 Received: from TY1PEPF0000BAD7.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:380:cafe::2c) by TY4P286CA0111.outlook.office365.com (2603:1096:405:380::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.16 via Frontend Transport; Sun, 20 Sep 2026 15:36:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by TY1PEPF0000BAD7.mail.protection.outlook.com (10.167.240.36) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.451.8 via Frontend Transport; Sun, 20 Sep 2026 15:36:11 +0000 Received: from vm01.adwin.renesas.com (DEU-5CG20946WF.adwin.renesas.com [10.226.92.22]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id C9D8730000BA; Mon, 21 Sep 2026 00:36:05 +0900 (JST) From: Ovidiu Panait To: maxime.chevallier@bootlin.com, recv.jo@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, jun.ann.lai@intel.com, yi.fang.gan@intel.com Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ovidiu Panait Subject: [PATCH net v5 3/5] net: stmmac: Rename double VLAN references to svlan Date: Sun, 20 Sep 2026 15:35:14 +0000 Message-ID: <20260920153516.103461-4-ovidiu.panait.rb@renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260920153516.103461-1-ovidiu.panait.rb@renesas.com> References: <20260920153516.103461-1-ovidiu.panait.rb@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY1PEPF0000BAD7:EE_|TY4PR01MB13839:EE_ X-MS-Office365-Filtering-Correlation-Id: 2890d21a-99d1-480d-8a2e-08df172ce5cb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|82310400026|7416014|376014|1800799024|23010399003|10067099003|56012099006|3023799007|18002099003|22082099003|5023799004|11063799006|921020; X-Microsoft-Antispam-Message-Info: S+L3ZHRK4dToiXXvXZHDGc9bhbPDWxzMNyJOEy5Vf1Nbhk1agNBWuJ9MYhDHZ850MZSFXe7BQNvekSK2S+VYYHyklGuoBLK7dzhqa5/2HGxERj9xQbt+2N4X7rIZvuD/NF347pV3HVmU1USp/7ZJ6vyDJTWfD+JDYTFQ6sfgcYbvTUqOTnKAX3nzFIOhHtg3xbNsIsj4IvQdyZPrdyQL+PJDhpe1X9u2kdfmMP0OA06e4Cq4+0M49AkBnEVSva6PYEaI3kOLlJWhN18w9cmXU3GwQCwg6dcN9owHV2bNIbScXT++8vaICC5zHooesPqN+AkIvcRab0dqol4PoM1MJ81B7GwQ5euBC2Ilqy8niCaTwceHrCW/mU/vULvUSuG2V8gayBIsPWQuBdQ4ICs6gyDu9nZH41helYehGy5DWAo5vQQ2WYaJA6LW/lMl+x7IhoUN78wlfdfbjXMOCs8FtMfd5Cn7edCMqGLMy5onu9BW2SMn7bXf/uPp9cDo5OWXj/91D1ozf1OAblizKs6WF4TYm/qaNGl8IIKdF4JK2w8MIsfgzqYoEJwN1v+a5B2HoeIPExMinr62T58LnWJppsZBJ8uAZ/1tPgPTrwAhMHSq4KPyLuqh6Snj7OPMpY8H00lkyvG684Jx5UgCYWF89DjKh4Zap4OI6XZGFHTrSwC8Vcy5ChGWlvcMByazIVfgGx2des0FQWWDADsbsu1urz7qIWUgwF0GYAoWqYrJOZvd3r8zKdHv0LYHRLp2VNZV X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(82310400026)(7416014)(376014)(1800799024)(23010399003)(10067099003)(56012099006)(3023799007)(18002099003)(22082099003)(5023799004)(11063799006)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A7M4ZTr+DmvywDVEfo/1RZJUth0apUrWo0BurVfyMJr8cYDZa1QTVkBfEYwMgwctgVEy5+yTh/URywravLJfoRVNG+MQmVBDZAu3/EyUcNAXv0naXUrBZYKJFUxicH5cTYPiFrfmPDE2pHNRpg9IxOBRk6ne2zIbDPlwwBu/YouY8gSbz45WpmM94RlFKJ8xLxHphsnzUN+zvI6m9/Ri7ip5999SPvTkAnwyUrsgQQ6mzr8CKWKtXoAy/zGFgwXmhn0VN4oQUKvyNLIG46mkRlZa+a5FZA0EOKokWpGp2h8Q0AQuEd8qpKrAlURn/aYqZRkHpyqRiLcTOLgEdmNRlLaZtc2Sgf82mv6jlC2mgkt7BL/Ep4RZu9kbSWmwR7qXGZDDchTlb4wXmlNvmU8/ACXNY5B+FzthHwe6O+ZjEX7W9EKTZNIA4Wjd1AA9lfhP X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2026 15:36:11.0726 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2890d21a-99d1-480d-8a2e-08df172ce5cb X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: TY1PEPF0000BAD7.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY4PR01MB13839 Content-Type: text/plain; charset="utf-8" The ESVL and DOVLTC bits control S-VLAN tag processing and have nothing to do with the double VLAN feature, which only provides a way to process an additional inner VLAN tag. However, the driver code that handles them always refers to "double VLAN", which is unrelated and makes the implementation confusing. The driver does not use any of the inner VLAN tag features, and the networking core does not support offloads for the inner tag anyway. To reduce the confusion regarding S-Tag vs double VLAN handling, rename double -> svlan. No functional change intended. Suggested-by: Joseph Steel Signed-off-by: Ovidiu Panait --- v5 changes: New patch. drivers/net/ethernet/stmicro/stmmac/hwif.h | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 34 +++++++++---------- .../stmicro/stmmac/stmmac_selftests.c | 30 ++++++++-------- .../net/ethernet/stmicro/stmmac/stmmac_vlan.c | 8 ++--- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ether= net/stmicro/stmmac/hwif.h index 734e30caea81..a8ddbedec9ca 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h @@ -633,7 +633,7 @@ struct stmmac_est_ops { struct stmmac_vlan_ops { /* VLAN */ void (*update_vlan_hash)(struct mac_device_info *hw, u32 hash, - bool is_double); + bool is_svlan); void (*enable_vlan)(struct mac_device_info *hw, u32 type); void (*rx_hw_vlan)(struct mac_device_info *hw, struct dma_desc *rx_desc, struct sk_buff *skb); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/eth= ernet/stmicro/stmmac/stmmac.h index 7582fca63741..d2d387f45c10 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h @@ -344,7 +344,7 @@ struct stmmac_priv { void __iomem *ptpaddr; void __iomem *estaddr; unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; - unsigned int num_double_vlans; + unsigned int num_svlans; int sfty_irq; struct stmmac_msi *msi; =20 diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index d0643a30db1c..77a8bcf5bf14 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6832,7 +6832,7 @@ static u32 stmmac_vid_crc32_le(__le16 vid_le) return crc; } =20 -static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double) +static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_svlan) { u32 crc, hash =3D 0; u16 vid =3D 0; @@ -6846,7 +6846,7 @@ static int stmmac_vlan_update(struct stmmac_priv *pri= v, bool is_double) if (!netif_running(priv->dev)) return 0; =20 - return stmmac_update_vlan_hash(priv, priv->hw, hash, is_double); + return stmmac_update_vlan_hash(priv, priv->hw, hash, is_svlan); } =20 /* FIXME: This may need RXC to be running, but it may be called with BH @@ -6855,8 +6855,8 @@ static int stmmac_vlan_update(struct stmmac_priv *pri= v, bool is_double) static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u= 16 vid) { struct stmmac_priv *priv =3D netdev_priv(ndev); - unsigned int num_double_vlans; - bool is_double =3D false; + unsigned int num_svlans; + bool is_svlan =3D false; int ret; =20 ret =3D pm_runtime_resume_and_get(priv->device); @@ -6864,11 +6864,11 @@ static int stmmac_vlan_rx_add_vid(struct net_device= *ndev, __be16 proto, u16 vid return ret; =20 if (be16_to_cpu(proto) =3D=3D ETH_P_8021AD) - is_double =3D true; + is_svlan =3D true; =20 set_bit(vid, priv->active_vlans); - num_double_vlans =3D priv->num_double_vlans + is_double; - ret =3D stmmac_vlan_update(priv, num_double_vlans); + num_svlans =3D priv->num_svlans + is_svlan; + ret =3D stmmac_vlan_update(priv, num_svlans); if (ret) { clear_bit(vid, priv->active_vlans); goto err_pm_put; @@ -6878,12 +6878,12 @@ static int stmmac_vlan_rx_add_vid(struct net_device= *ndev, __be16 proto, u16 vid ret =3D stmmac_add_hw_vlan_rx_fltr(priv, ndev, priv->hw, proto, vid); if (ret) { clear_bit(vid, priv->active_vlans); - stmmac_vlan_update(priv, priv->num_double_vlans); + stmmac_vlan_update(priv, priv->num_svlans); goto err_pm_put; } } =20 - priv->num_double_vlans =3D num_double_vlans; + priv->num_svlans =3D num_svlans; =20 err_pm_put: pm_runtime_put(priv->device); @@ -6897,8 +6897,8 @@ static int stmmac_vlan_rx_add_vid(struct net_device *= ndev, __be16 proto, u16 vid static int stmmac_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, = u16 vid) { struct stmmac_priv *priv =3D netdev_priv(ndev); - unsigned int num_double_vlans; - bool is_double =3D false; + unsigned int num_svlans; + bool is_svlan =3D false; int ret; =20 ret =3D pm_runtime_resume_and_get(priv->device); @@ -6906,11 +6906,11 @@ static int stmmac_vlan_rx_kill_vid(struct net_devic= e *ndev, __be16 proto, u16 vi return ret; =20 if (be16_to_cpu(proto) =3D=3D ETH_P_8021AD) - is_double =3D true; + is_svlan =3D true; =20 clear_bit(vid, priv->active_vlans); - num_double_vlans =3D priv->num_double_vlans - is_double; - ret =3D stmmac_vlan_update(priv, num_double_vlans); + num_svlans =3D priv->num_svlans - is_svlan; + ret =3D stmmac_vlan_update(priv, num_svlans); if (ret) { set_bit(vid, priv->active_vlans); goto del_vlan_error; @@ -6920,12 +6920,12 @@ static int stmmac_vlan_rx_kill_vid(struct net_devic= e *ndev, __be16 proto, u16 vi ret =3D stmmac_del_hw_vlan_rx_fltr(priv, ndev, priv->hw, proto, vid); if (ret) { set_bit(vid, priv->active_vlans); - stmmac_vlan_update(priv, priv->num_double_vlans); + stmmac_vlan_update(priv, priv->num_svlans); goto del_vlan_error; } } =20 - priv->num_double_vlans =3D num_double_vlans; + priv->num_svlans =3D num_svlans; =20 del_vlan_error: pm_runtime_put(priv->device); @@ -6941,7 +6941,7 @@ static void stmmac_vlan_restore(struct stmmac_priv *p= riv) if (priv->hw->num_vlan) stmmac_restore_hw_vlan_rx_fltr(priv, priv->dev, priv->hw); =20 - stmmac_vlan_update(priv, priv->num_double_vlans); + stmmac_vlan_update(priv, priv->num_svlans); } =20 static int stmmac_bpf(struct net_device *dev, struct netdev_bpf *bpf) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drive= rs/net/ethernet/stmicro/stmmac/stmmac_selftests.c index 6372ec7c3f31..b710eb99b1e7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c @@ -237,7 +237,7 @@ struct stmmac_test_priv { struct stmmac_packet_attrs *packet; struct packet_type pt; struct completion comp; - int double_vlan; + int svlan; int vlan_id; int ok; }; @@ -279,7 +279,7 @@ static int stmmac_test_loopback_validate(struct sk_buff= *skb, } =20 ihdr =3D ip_hdr(skb); - if (tpriv->double_vlan) + if (tpriv->svlan) ihdr =3D (struct iphdr *)(skb_network_header(skb) + 4); =20 if (tpriv->packet->tcp) { @@ -855,7 +855,7 @@ static int stmmac_test_vlan_validate(struct sk_buff *sk= b, struct iphdr *ihdr; u16 proto; =20 - proto =3D tpriv->double_vlan ? ETH_P_8021AD : ETH_P_8021Q; + proto =3D tpriv->svlan ? ETH_P_8021AD : ETH_P_8021Q; =20 skb =3D skb_unshare(skb, GFP_ATOMIC); if (!skb) @@ -881,7 +881,7 @@ static int stmmac_test_vlan_validate(struct sk_buff *sk= b, goto out; =20 ihdr =3D ip_hdr(skb); - if (tpriv->double_vlan) + if (tpriv->svlan) ihdr =3D (struct iphdr *)(skb_network_header(skb) + 4); if (ihdr->protocol !=3D IPPROTO_UDP) goto out; @@ -995,7 +995,7 @@ static int stmmac_test_vlanfilt_perfect(struct stmmac_p= riv *priv) return ret; } =20 -static int __stmmac_test_dvlanfilt(struct stmmac_priv *priv) +static int __stmmac_test_svlanfilt(struct stmmac_priv *priv) { struct stmmac_packet_attrs attr =3D { }; struct stmmac_test_priv *tpriv; @@ -1007,7 +1007,7 @@ static int __stmmac_test_dvlanfilt(struct stmmac_priv= *priv) return -ENOMEM; =20 tpriv->ok =3D false; - tpriv->double_vlan =3D true; + tpriv->svlan =3D true; init_completion(&tpriv->comp); =20 tpriv->pt.type =3D htons(ETH_P_8021Q); @@ -1067,15 +1067,15 @@ static int __stmmac_test_dvlanfilt(struct stmmac_pr= iv *priv) return ret; } =20 -static int stmmac_test_dvlanfilt(struct stmmac_priv *priv) +static int stmmac_test_svlanfilt(struct stmmac_priv *priv) { if (!priv->dma_cap.vlhash) return -EOPNOTSUPP; =20 - return __stmmac_test_dvlanfilt(priv); + return __stmmac_test_svlanfilt(priv); } =20 -static int stmmac_test_dvlanfilt_perfect(struct stmmac_priv *priv) +static int stmmac_test_svlanfilt_perfect(struct stmmac_priv *priv) { int ret, prev_cap =3D priv->dma_cap.vlhash; =20 @@ -1083,7 +1083,7 @@ static int stmmac_test_dvlanfilt_perfect(struct stmma= c_priv *priv) return -EOPNOTSUPP; =20 priv->dma_cap.vlhash =3D 0; - ret =3D __stmmac_test_dvlanfilt(priv); + ret =3D __stmmac_test_svlanfilt(priv); priv->dma_cap.vlhash =3D prev_cap; =20 return ret; @@ -1284,7 +1284,7 @@ static int stmmac_test_vlanoff_common(struct stmmac_p= riv *priv, bool svlan) proto =3D svlan ? ETH_P_8021AD : ETH_P_8021Q; =20 tpriv->ok =3D false; - tpriv->double_vlan =3D svlan; + tpriv->svlan =3D svlan; init_completion(&tpriv->comp); =20 tpriv->pt.type =3D svlan ? htons(ETH_P_8021Q) : htons(ETH_P_IP); @@ -1867,11 +1867,11 @@ static const struct stmmac_test { .name =3D "VLAN Filtering (perf) ", .fn =3D stmmac_test_vlanfilt_perfect, }, { - .name =3D "Double VLAN Filter ", - .fn =3D stmmac_test_dvlanfilt, + .name =3D "SVLAN Filtering ", + .fn =3D stmmac_test_svlanfilt, }, { - .name =3D "Double VLAN Filter (perf) ", - .fn =3D stmmac_test_dvlanfilt_perfect, + .name =3D "SVLAN Filtering (perf) ", + .fn =3D stmmac_test_svlanfilt_perfect, }, { .name =3D "Flexible RX Parser ", .fn =3D stmmac_test_rxp, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_vlan.c index 200b34588c7f..fb9aad748cb3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c @@ -162,7 +162,7 @@ static void vlan_restore_hw_rx_fltr(struct net_device *= dev, } =20 static void vlan_update_hash(struct mac_device_info *hw, u32 hash, - bool is_double) + bool is_svlan) { void __iomem *ioaddr =3D hw->pcsr; u32 value; @@ -173,7 +173,7 @@ static void vlan_update_hash(struct mac_device_info *hw= , u32 hash, =20 if (hash) { value |=3D VLAN_VTHM | VLAN_ETV; - if (is_double) { + if (is_svlan) { value |=3D VLAN_ESVL; value |=3D VLAN_DOVLTC; } else { @@ -235,7 +235,7 @@ static void vlan_set_hw_mode(struct mac_device_info *hw) } =20 static void dwxgmac2_update_vlan_hash(struct mac_device_info *hw, u32 hash, - bool is_double) + bool is_svlan) { void __iomem *ioaddr =3D hw->pcsr; =20 @@ -251,7 +251,7 @@ static void dwxgmac2_update_vlan_hash(struct mac_device= _info *hw, u32 hash, value =3D readl(ioaddr + VLAN_TAG); =20 value |=3D VLAN_VTHM | VLAN_ETV; - if (is_double) { + if (is_svlan) { value |=3D VLAN_ESVL; value |=3D VLAN_DOVLTC; } else { --=20 2.34.1 From nobody Fri Sep 25 23:12:15 2026 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010064.outbound.protection.outlook.com [52.101.229.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71E2942A164; Sun, 20 Sep 2026 15:36:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789918585; cv=fail; b=MLC9p/KBbb6uofCh2TckK8LJ0Wl7ea4zMTaAzi0IW/pgmAW+/G5bsF+vahWxzU3R4a7DG+/EIKTia2tneyaykfJFHgIZ51olutI7Y9POlFnDk5nDK8wJ9D8ThHXM8FeH5S8SNpBcxj/+E4MQFFH/n4WxbAlUXcAJO5t7GhZGTxM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789918585; c=relaxed/simple; bh=guNK/lwrpKZMF5TVq3nEYsLv1XPGOCd17tIrlMJ0JWA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qnmM4VCHUhtyppWZuJU4X+aidCujc+1NTUlQX5L8v9ptwvVnZgEsGmtpohkM/rF8s7I4q0Yg3CmD+SnP5FEl/Z1kANvv9ygPRxbaXXCR1LWEFFuboNHtqTmOprBmSnnxxoN2wpZqkeSTfAGVaUW6m24XFgpfQs6YAOF7I+1NuiM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=KMG/7eOP; arc=fail smtp.client-ip=52.101.229.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="KMG/7eOP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=u6HDf6pj87s+ThyFStsLnb5yRQPPGl1agGcMVcmeDBDEFWVISwxI5xXFtybLI3bkbjoETUtPf1ca+nIntEiCUGxviPRfGeddPQZ8tnbGCVitNh9GgWAuaqPiOjy+I8e9MZGS51uDz0Ah+XVBwXHcrMDbgCUcuX2OwbpESw6lrTrNg2+gI+KZbpgL7zwnEmK0dL5wAdSMvkPqnOwhlLHnpsk3Gt9BNCZJaGNrJEPwRR5EHChwtOj/Mb4b81talWqH28Fp+vNtMpGCISUoO2WrjmlinksQ0L06ZGGjOmQGfxhkpWuZLJtDczIZuPSfX0YALnOFqxB+YFHiSmLsVTLVPw== 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=y7MtmT+Gezjz1wxCtW6De99Byqza5f1VY1qmH2ZVItQ=; b=xq7G7fWfPBDqfte4ZkaWiLtV0ti+2vIdzbO1RfURsm/HVN0QfYkIaqRxbWnJUfdI/+ycYClZ2YGv9lkveiwaEjpqSmhsXIsuIOShPMSmSOJe7DIU+dGn8j88zwhPTkFH8UozWVeYOtXudeGkdjR5hkI06rLSjwUug3b/58VJKm/0ELeecZibE+BHFHRvJo2rXsEbVseiHVoAIfh0xL+8nZgwWEpDgBQIl9tcZtZvs6FinzVBwTa4Jny19QAf79FIDRGAJIdUObIZwPn5Gf/YDlloXplruY2RUtaCxUvmEKfVVDMcDCcWOW//rVHrNDLb8LcuLgq+kX/OOO8/s3/Q/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=bootlin.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y7MtmT+Gezjz1wxCtW6De99Byqza5f1VY1qmH2ZVItQ=; b=KMG/7eOPLnlJuY1xRizWheuI5z0XZTG7aPzCoX2g7jxM+tP4cDl1Zq1abc4KTmrw4D5fgpILKzZbi72xoyCdWWUMQp91hx/pjgYYzwLew7lbIKomNjiwi7Wu7LtlJvrvCz4URWe+WiE/UUU6LF45Gz0gBHbmqogAZqJBkjO8Pao= Received: from OS7PR01CA0226.jpnprd01.prod.outlook.com (2603:1096:604:25d::12) by TY3PR01MB12054.jpnprd01.prod.outlook.com (2603:1096:400:3da::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.428.15; Sun, 20 Sep 2026 15:36:19 +0000 Received: from OS1PEPF0000D210.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:25d:cafe::e) by OS7PR01CA0226.outlook.office365.com (2603:1096:604:25d::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.12 via Frontend Transport; Sun, 20 Sep 2026 15:36:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by OS1PEPF0000D210.mail.protection.outlook.com (10.167.240.39) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.451.8 via Frontend Transport; Sun, 20 Sep 2026 15:36:17 +0000 Received: from vm01.adwin.renesas.com (DEU-5CG20946WF.adwin.renesas.com [10.226.92.22]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id 913A030000BB; Mon, 21 Sep 2026 00:36:11 +0900 (JST) From: Ovidiu Panait To: maxime.chevallier@bootlin.com, recv.jo@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, jun.ann.lai@intel.com, yi.fang.gan@intel.com Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ovidiu Panait Subject: [PATCH net v5 4/5] net: stmmac: Do not advertise S-VLAN stripping when it is disabled Date: Sun, 20 Sep 2026 15:35:15 +0000 Message-ID: <20260920153516.103461-5-ovidiu.panait.rb@renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260920153516.103461-1-ovidiu.panait.rb@renesas.com> References: <20260920153516.103461-1-ovidiu.panait.rb@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS1PEPF0000D210:EE_|TY3PR01MB12054:EE_ X-MS-Office365-Filtering-Correlation-Id: 88119cb5-ad4f-46c6-fac2-08df172ce967 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700016|23010399003|1800799024|7416014|376014|10067099003|11063799006|22082099003|18002099003|56012099006|921020; X-Microsoft-Antispam-Message-Info: 4tOcVXT5GNfIoicoRWMknya1yeknQL8ZxwiN79dYfoW8pbwky7qhFvrZ/okes8ti+PsvAjHa75S2/dKbiXiFSCyAbjA9r9jz2ArCHqsEbg0buUDYRo/r9jlX7p86a1i2kDr79OnezorqzOxynKQTAw84GaX64jOkFJWQwwWs9txCVrMBCW5gSojUFGZrrMDiGe0skwUR58Nsj8vx7lI51wtUgPfCkqGVV5cqFBTj1qkaeDw3nfVE5HZ96WZ8rgiL6PuH0GtbChVfQljIhrU/s0AryIzTlYjvUE7GL/DeEl+O39/AMH+8tTmoVINB6Yhr0nG5tVtMfzyaq7k6Gyfe5DpY1EkRAhifruH+5rEFdbOzYNr0fgAUDBKbuL63ctNygoJ6yJEszBrfLlTwn2iJNlS4A59mubuIu6WMcaHq8VT3nnLgQJwGqFrMXPy02/vfvhsrNQhHEfwT0Giu752KJ53fQEqGbrFx+9mGy1ZSawFkicDuSxI/KDacKUSwMaUe+vSwGj+OHdEimWMER6TZKE38TfSc++pMoFcp8uB5sY+tfhP7+H0/ZMwzo8sGpu/Ksw0elEziPxfPId+A6deQkBAH9bT25n1AY3YnHRz+r/0Vokm28XZzjegpECjFDY6/LSeMcW3kNgvj7ByPDV6b72hEGx8D5t8oyYsbgqx9rxxz5WoVOi162QgaN0EdrRXXPYjDU6Cp4UP/RXw7L3dJp4eqcYAImS2zcTUFelaFST3x4aXuBfQtqgVGNYEgU0Ob X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(23010399003)(1800799024)(7416014)(376014)(10067099003)(11063799006)(22082099003)(18002099003)(56012099006)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7MHGb3i2KSQBG8R4H/EmK1+opZ9n4jhhahQViHDIhtn+AmuUyiz0F38H8eD/xNtqA9NZ2RyKV2McKheX9Qi6d1znSoZ5Nx1Mh5lwhHc0FGYbY48wcGQrwUHee2S/lOjVgFTyr/d42rwe/eV8a4ye+KfoKQNe8DZ9K8OPcqUfHjVRDraVuVCxKGNMRdONrkPxivdXhh1mkxtRhMMs447j5XRGaydpa8VRml43HFjlW8Y/JJTIQU9UV18m9MuX+AlZXqfaTiif0vljc2N5iTC8h3JZSi6+3Jfncc/tm0yKzUBrWGidRaayAvvv6HKfjB4Y6JaALh/DhPiWyUr0xWd7zyWzBi+IGLwA16sNHs0sdvtTzRVjKGBz2T4+t7M4cowaPUJrIoMLAPCip4K0aXev6OYxGSka1UDRVb80ywSoLgvLTQix7Ly25fJNXvZKGTD8 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2026 15:36:17.1169 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88119cb5-ad4f-46c6-fac2-08df172ce967 X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: OS1PEPF0000D210.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB12054 Content-Type: text/plain; charset="utf-8" C-VLAN and S-VLAN tag stripping are both controlled by the EVLS bit, so disabling rx-vlan-offload also disables S-VLAN tag stripping. However, rx-vlan-stag-hw-parse keeps being advertised as enabled: root@rzv2h-evk:~# ethtool -K end1 rx-vlan-offload off root@rzv2h-evk:~# ethtool -k end1 | grep -i vlan rx-vlan-offload: off tx-vlan-offload: off [fixed] rx-vlan-filter: on [fixed] vlan-challenged: off [fixed] tx-vlan-stag-hw-insert: off [fixed] rx-vlan-stag-hw-parse: on [fixed] rx-vlan-stag-filter: on [fixed] Fix this inconsistency by making NETIF_F_HW_VLAN_STAG_RX follow NETIF_F_HW_VLAN_CTAG_RX. Fixes: 750011e239a5 ("net: stmmac: Add support for HW-accelerated VLAN stri= pping") Signed-off-by: Ovidiu Panait --- v5 changes: - Rebased on top of the rename patch: used dwmac_is_xmac() instead of the dropped hw_svlan_en flag. v4 changes: - New patch. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 77a8bcf5bf14..c06eed76e3d9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6208,6 +6208,13 @@ static netdev_features_t stmmac_fix_features(struct = net_device *dev, if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN)) features &=3D ~NETIF_F_CSUM_MASK; =20 + if (dwmac_is_xmac(priv->plat->core_type)) { + if (features & NETIF_F_HW_VLAN_CTAG_RX) + features |=3D NETIF_F_HW_VLAN_STAG_RX; + else + features &=3D ~NETIF_F_HW_VLAN_STAG_RX; + } + return features; } =20 --=20 2.34.1 From nobody Fri Sep 25 23:12:15 2026 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011025.outbound.protection.outlook.com [52.101.125.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F6CA42848B; Sun, 20 Sep 2026 15:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789918589; cv=fail; b=QH6B1mjveogFwuzfmZerI7sjfkujYH7x8uXIIlxkBVgV/PkxXRVi1MEu8ynWbFVDCX22UmoZtEDYXYCJzDarDXHAmvVzFIm0k3OUSk+i/TgIWchVw4n9rYOfIpdsLGksgwr6jk00UzqZs3jQs2r3Ph2YFfigfaY2ba3dGlOvEUM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789918589; c=relaxed/simple; bh=0xguq2Bn5GdmV/Uc3sQcw1tljcUsh2gjUbt+7EpBDEI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bSjoHbszFCehGsrZ1zUI/+vGWUw/rjNEY5fAG/djEeLypnoQLYb0hCmYcZoqa5zRYXVbeKuUZ4I6cVaquhCTGNjTdak93XOc6jppRPETEw+cJ9PQniOB64lY7H7xkPVGnLIaZQIt9Jj9nmVO88JCXzYXVUfafU1+wsQZVrSUSDE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=A7X6hoEv; arc=fail smtp.client-ip=52.101.125.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="A7X6hoEv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ucQuJslh2+5DjPJu7Br0e9YU8jXkKF/xMIzWAoRE5gDsgNEkWFgyBY8ulyFmK4aefU8RntRfsCnFv+rzGPwnlCZ3Wh1MoanNcqRdLCg29mYgsXFgTwF4ogMuSicbJgWc1XlmHs026mjg32cEuoaB4f5gwjRNUWGJDAO0ukNCcoPAhrEhHmZt5N2/OAZqe1a/528HUxEDbxd4PK28lmTGtws4f2U3UCKnJII0tPzrYZ2orQF3NjlkvI8otT2fFHtWOAI9NscJy4OANtOthfx58QdTa+VRdVqK1rjhbdEJajnC5TBYOIfo8wNpJ7Gck24IRG4lKuk2DPHHpCmXAi8l4A== 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=DJ8jzAfJImIZ1eFRsY+R34UkOdbIYdfUDMJDfWp7fvc=; b=G/tC6jyCYFjSzR+qMkE8JuTmaMsMFCA5Hrw9ZeqIgwzEtDTsVgIR7JYKWWvyYC6ITZTqY+V61sTL7IOpW9hcjNIlcaSNae4AdNhQr1l8abHdJuuDO5RnB3deZiJCS56VnXlzuIk7efd/K7icuFFFg5EXWrZxeKtT/G1p1Oz4QzvKtZ8dfN9O3JnqJhgkFqzajV2Zat1lZzcsTOPBJpTzmP1bmTyz/XKWAZWxYpyHnaVPxkwXnzSgtvBoGSBwhIMk/anC7S6cg+1MRCWRU8ONdusA1ELO3SEWnEhc63dUC5KiI5hr9BaTrErMIlewrniEesEu0SRfRSSQPTKfeHKE3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 8.62.32.50) smtp.rcpttodomain=bootlin.com smtp.mailfrom=renesas.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=renesas.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DJ8jzAfJImIZ1eFRsY+R34UkOdbIYdfUDMJDfWp7fvc=; b=A7X6hoEvjqv5tjqofSzLCnCydF39grf08ch9qgxvoQljyWRZ+rajY6PhtiTLmYCxABpzHPTMnBk5XsB2DjsYw1CG+PvlFsJN9dv1usWZ18eBglG4eTEqwdmzYvr4ZSkJ3lqkIelHXQA0gpGchO9Yvlu/b7vpnFpaW8Mgms+GxMU= Received: from OS3P286CA0058.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:200::16) by TYCPR01MB8756.jpnprd01.prod.outlook.com (2603:1096:400:10f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.428.16; Sun, 20 Sep 2026 15:36:24 +0000 Received: from OS1PEPF0000D20E.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:200:cafe::9b) by OS3P286CA0058.outlook.office365.com (2603:1096:604:200::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.428.16 via Frontend Transport; Sun, 20 Sep 2026 15:36:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 8.62.32.50) smtp.mailfrom=renesas.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=renesas.com; Received-SPF: Pass (protection.outlook.com: domain of renesas.com designates 8.62.32.50 as permitted sender) receiver=protection.outlook.com; client-ip=8.62.32.50; helo=ejcrelay004p.adwin.renesas.com; pr=E Received: from ejcrelay004p.adwin.renesas.com (8.62.32.50) by OS1PEPF0000D20E.mail.protection.outlook.com (10.167.240.37) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.451.8 via Frontend Transport; Sun, 20 Sep 2026 15:36:22 +0000 Received: from vm01.adwin.renesas.com (DEU-5CG20946WF.adwin.renesas.com [10.226.92.22]) by ejcrelay004p.adwin.renesas.com (Postfix) with ESMTP id 54EF430000BA; Mon, 21 Sep 2026 00:36:17 +0900 (JST) From: Ovidiu Panait To: maxime.chevallier@bootlin.com, recv.jo@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, jun.ann.lai@intel.com, yi.fang.gan@intel.com Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ovidiu Panait Subject: [PATCH net v5 5/5] net: stmmac: Disable S-Tag processing on dwmac4 Date: Sun, 20 Sep 2026 15:35:16 +0000 Message-ID: <20260920153516.103461-6-ovidiu.panait.rb@renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260920153516.103461-1-ovidiu.panait.rb@renesas.com> References: <20260920153516.103461-1-ovidiu.panait.rb@renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS1PEPF0000D20E:EE_|TYCPR01MB8756:EE_ X-MS-Office365-Filtering-Correlation-Id: e3f9e7ff-7e7b-4f04-6394-08df172cecbb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|82310400026|7416014|376014|1800799024|23010399003|10067099003|56012099006|3023799007|18002099003|22082099003|11063799006|921020; X-Microsoft-Antispam-Message-Info: Cxj0rPYCiRH0OMY7CVepQy4VLMmMMotJp6rGL46oj7GtqdVyJVXFmUk/an3BEGYnfLNMBezq3Tku6tHkJEUQN+JvF3gEWaWDv/xmaXkzkM6tKwNVnI7Klnt4dabjFzQjz1hG4v28LBodH7gk6rBGSkcO8htdiOIpDaYJunH2eEJdR5ZW/gUIMPcnko4HI0A4wivnWPb5LsAlysaZNBW+15c95WH2rVXIXWD12p6kXC//XOL+dmTbWWlQz4nni/U/nY1aLPWVu+BjKIE24M6Jah2Yw84k9H55+Y0HxN+EXFeCvMFigsyCUCe5umGRJDAMoQx0EA3GqAllYrUSscisznz93Ji4xTNCstu/Wpro1dX36egPYnOUaAXi7hyb1X+zTvw2HBGm7+I7ryc60CRSafolUBB4D8l8MfCRy8CHwGDcEpXwlqUKaI+9s3XST/OgMRfXd02NWHTTsCXaBJAvzmSrClVPEZDgX2bqYY2yHqi4WgjDXUX5PzGHD2xIdWJ7DkbDeHBTagvFnnXpxPjeNU/QLv44KAlPoNkp6og/Xv0byE3OWZzgOE9cAR+9f9HbnanNu49KHVGv67O/3t6gI2SMAOBYzHE7t1q4T+P99dF0UZ8lu0xQ5WTRjKcRzXLw4AA9i7VVJt009QlKOX0RvDCzlQ1Qyf2YkisJhIucjgCaKl3o8/ukWoYfo9ovp/aA1chTgiIrOzUCmxqQlHpviFtrKo1L663uf6pIZLdQXs7gi93QhMeOo9+tZuGl2t8b X-Forefront-Antispam-Report: CIP:8.62.32.50;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ejcrelay004p.adwin.renesas.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(82310400026)(7416014)(376014)(1800799024)(23010399003)(10067099003)(56012099006)(3023799007)(18002099003)(22082099003)(11063799006)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FJGrnQtSYFClD3JXOMvhzq9B4mKmd5VokP3sgkslCSCXaR7+HFJTr3gWjLW2ffq8sstCa0u5aqcD7qO/o1p63dek6KegS91eL0jNT/P6mNvo9nWy0V+xU/SWyZG0FS4ijEyn21YP9PhpX7io4j9aYYdkqhvIkDYiqi4RN5YJHcKoR7HjJZp36XjdSnNUy2DzdIipkLMBv295hdIS4jtmGmZ3ZV9duj3Gz5Glwhce/qd3q8pDUC8G2rPBcox/+ZrSMfabEVgf3ScrYXJICWjIUh05tZT0RrCuQrdCa89D77rKP1bQ+fB8ME7JWbzrbVING5r1eR7UWUBMWgGj7tv0TmtJwYca8DYwlNmjIut05PsfaQSn4/kD4gFElqAQgtBRarcTYHACyzQT7A3+vyCvoCQN8cESswDmQhj/hSyT8bmdVoTEnCT3SYVqw6R5ChFD X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2026 15:36:22.6962 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3f9e7ff-7e7b-4f04-6394-08df172cecbb X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=53d82571-da19-47e4-9cb4-625a166a4a2a;Ip=[8.62.32.50];Helo=[ejcrelay004p.adwin.renesas.com] X-MS-Exchange-CrossTenant-AuthSource: OS1PEPF0000D20E.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8756 Content-Type: text/plain; charset="utf-8" Currently, hardware VLAN stripping is broken for 802.1ad tags. vlan_rx_hw() hardcodes ETH_P_8021Q when putting the hardware tag into the skb, rather than using the actual protocol from the packet. Because of this, packets that contain a 802.1ad outer tag are incorrectly passed up the stack as having an 802.1Q tag. This causes QinQ ping between two hosts to fail. vlan_rx_hw() is shared by dwxgmac2 and dwmac4: on dwxgmac2 the tag type is available in the RDES3 write-back descriptor (the ET_LT field), so the outer tag type can be determined based on that info. However, dwmac4 doesn't seem to provide the tag type. The Length/Type field in RDES3 only indicates whether the packet is single or double-tagged, not which tag type was stripped. Since dwmac4 cannot report the stripped tag type, it cannot support hardware S-Tag stripping correctly. Therefore, restrict the NETIF_F_HW_VLAN_STAG_RX and NETIF_F_HW_VLAN_STAG_FILTER advertisement to dwxgmac2 only. With this, 802.1ad tags are left in place and handled by the software VLAN path. Fixes: 750011e239a5 ("net: stmmac: Add support for HW-accelerated VLAN stri= pping") Signed-off-by: Ovidiu Panait Reviewed-by: Maxime Chevallier --- v5 changes: - Rebased on top of latest changes. - Added Reviewed-by tag from Maxime. v4 changes: - Dropped all "double VLAN" references from the commit title/message. - Rebased on top of the S-VLAN rework. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index c06eed76e3d9..e812a9c206ea 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6208,7 +6208,7 @@ static netdev_features_t stmmac_fix_features(struct n= et_device *dev, if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN)) features &=3D ~NETIF_F_CSUM_MASK; =20 - if (dwmac_is_xmac(priv->plat->core_type)) { + if (priv->plat->core_type =3D=3D DWMAC_CORE_XGMAC) { if (features & NETIF_F_HW_VLAN_CTAG_RX) features |=3D NETIF_F_HW_VLAN_STAG_RX; else @@ -7987,14 +7987,18 @@ static int __stmmac_dvr_probe(struct device *device, ndev->watchdog_timeo =3D msecs_to_jiffies(watchdog); #ifdef STMMAC_VLAN_TAG_USED /* Both mac100 and gmac support receive VLAN tag detection */ - ndev->features |=3D NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX; + ndev->features |=3D NETIF_F_HW_VLAN_CTAG_RX; + if (priv->plat->core_type =3D=3D DWMAC_CORE_XGMAC) + ndev->features |=3D NETIF_F_HW_VLAN_STAG_RX; + if (dwmac_is_xmac(priv->plat->core_type)) { ndev->hw_features |=3D NETIF_F_HW_VLAN_CTAG_RX; priv->hw->hw_vlan_en =3D true; } if (priv->dma_cap.vlhash) { ndev->features |=3D NETIF_F_HW_VLAN_CTAG_FILTER; - ndev->features |=3D NETIF_F_HW_VLAN_STAG_FILTER; + if (priv->plat->core_type =3D=3D DWMAC_CORE_XGMAC) + ndev->features |=3D NETIF_F_HW_VLAN_STAG_FILTER; } if (priv->dma_cap.vlins) ndev->features |=3D NETIF_F_HW_VLAN_CTAG_TX; --=20 2.34.1