From patchwork Fri Nov 20 14:29:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baptiste Jonglez X-Patchwork-Id: 1403742 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bitsofnetworks.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=TBwPKTWg; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CczWn1Fddz9sSs for ; Sat, 21 Nov 2020 01:31:48 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rCR2VzFgShr+N931+i+UItpbdYII+EO+bwWUHypriV0=; b=TBwPKTWgZwHnPd25T8urUMHSs QbEKS3jdZgSfmZMaqyT01B7xqTnJIxCPwkGHgLYTiplc3EbPWkCb/nfFfuR6VjRGwahs/Jt3AWWO/ IStIuZfuEfXAK77KXSYYQg/pesvDqOSHOMEQceFoC3w9Oo3XzLVHmqj4WK/TeMWEJzNG+S79ppRLF 7p9KbVmI6urlFnV7+zaazicgzcFOXrlXGAfyawhT9uxcSdn++VCd/KxyqoKADwcdM2mYn+vZSxkaC kF+187nJu0hLyz+Cp6iOQwrkOLMxT5qJThrY2Y7NyOUaZL3qjTCy0TOs7DxmPocyo873JgiqxqPSO L81oOMuZA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg7Py-0001H0-7v; Fri, 20 Nov 2020 14:29:42 +0000 Received: from mails.bitsofnetworks.org ([2001:912:1800:ff::131]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg7Pv-0001Ga-6J for openwrt-devel@lists.openwrt.org; Fri, 20 Nov 2020 14:29:40 +0000 Received: from [2001:912:1800::ac1] (helo=fedic.lan) by mails.bitsofnetworks.org with esmtp (Exim 4.89) (envelope-from ) id 1kg7Pr-0001KU-G5; Fri, 20 Nov 2020 15:29:35 +0100 From: Baptiste Jonglez To: openwrt-devel@lists.openwrt.org, John Crispin Subject: [PATCH 19.07 v2] ipq40xx: Revert "ipq40xx: fix ethernet vlan double tagging" Date: Fri, 20 Nov 2020 15:29:18 +0100 Message-Id: <20201120142918.900120-1-baptiste@bitsofnetworks.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201120102114.894966-1-baptiste@bitsofnetworks.org> References: <20201120102114.894966-1-baptiste@bitsofnetworks.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201120_092939_450158_91BBA204 X-CRM114-Status: GOOD ( 21.13 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Baptiste Jonglez Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Baptiste Jonglez This change has been causing several issues on ipq40xx devices, including: - VLAN tagging no longer works correctly: https://bugs.openwrt.org/index.php?do=details&task_id=3239 - poor performance with tagged VLANs: https://bugs.openwrt.org/index.php?do=details&task_id=3457 See also https://forum.openwrt.org/t/vlan-tagging-on-ipq40xx-gl-b1300-no-longer-works/69569 There are have been discussions on ways to fix the issue in the links above (including switching to DSA), but nothing that can realistically be introduced in the 19.07 branch. This reverts commit 8c191712558c ("ipq40xx: fix ethernet vlan double tagging") Note that it's not a clean revert because this patch was touched in 148d59c67edd ("kernel: update kernel 4.14 to version 4.14.193") even though the semantic of the patch was left unchanged. Fixes: FS#3239 Fixes: FS#3457 Fixes: 8c191712558c ("ipq40xx: fix ethernet vlan double tagging") Signed-off-by: Baptiste Jonglez --- .../716-essedma-vlan-double-tag.patch | 128 ------------------ 1 file changed, 128 deletions(-) delete mode 100644 target/linux/ipq40xx/patches-4.14/716-essedma-vlan-double-tag.patch diff --git a/target/linux/ipq40xx/patches-4.14/716-essedma-vlan-double-tag.patch b/target/linux/ipq40xx/patches-4.14/716-essedma-vlan-double-tag.patch deleted file mode 100644 index e268351273..0000000000 --- a/target/linux/ipq40xx/patches-4.14/716-essedma-vlan-double-tag.patch +++ /dev/null @@ -1,128 +0,0 @@ -From: Sven Eckelmann -Date: Wed, 8 Feb 2017 16:26:00 +0100 -Subject: [PATCH] ipq40xx: Fix ar40xx port separation - -It is currently not possible to submit (or receive) VLAN tagged frames over -the ar40xx PHY switch and the edma ethernet device. - -This can be worked around by disabling enable_vlan. The separation of the -eth0 and eth1 ports is then done by the vlan_tag information from the -device tree. But the ar40xx PHY switch then also has to parse the word3 -port bitmap (word3) from the TDP when data was received from the CPU port -(0). - -IssueID: #2857 - -Forwarded: no - The ar40xx.c change was forwarded to Xiaofei Shen - (QCA). But John Crispin will rewrite the driver anyway and we have to check - later if this change is required in his driver too. ---- - drivers/net/phy/ar40xx.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - ---- a/drivers/net/phy/ar40xx.c -+++ b/drivers/net/phy/ar40xx.c -@@ -1200,7 +1200,11 @@ ar40xx_init_port(struct ar40xx_priv *pri - ar40xx_rmw(priv, AR40XX_REG_PORT_STATUS(port), - AR40XX_PORT_AUTO_LINK_EN, 0); - -- ar40xx_write(priv, AR40XX_REG_PORT_HEADER(port), 0); -+ /* CPU port is setting headers to limit output ports */ -+ if (port == 0) -+ ar40xx_write(priv, AR40XX_REG_PORT_HEADER(port), 0x8); -+ else -+ ar40xx_write(priv, AR40XX_REG_PORT_HEADER(port), 0); - - ar40xx_write(priv, AR40XX_REG_PORT_VLAN0(port), 0); - -@@ -1243,6 +1247,10 @@ ar40xx_init_globals(struct ar40xx_priv * - t = (AR40XX_PORT0_FC_THRESH_ON_DFLT << 16) | - AR40XX_PORT0_FC_THRESH_OFF_DFLT; - ar40xx_write(priv, AR40XX_REG_PORT_FLOWCTRL_THRESH(0), t); -+ -+ /* set service tag to 802.1q */ -+ t = ETH_P_8021Q | AR40XX_ESS_SERVICE_TAG_STAG; -+ ar40xx_write(priv, AR40XX_ESS_SERVICE_TAG, t); - } - - static void -@@ -1568,7 +1576,11 @@ ar40xx_setup_port(struct ar40xx_priv *pr - u32 pvid = priv->vlan_id[priv->pvid[port]]; - - if (priv->vlan) { -- egress = AR40XX_PORT_VLAN1_OUT_MODE_UNMOD; -+ if (priv->vlan_tagged & BIT(port)) -+ egress = AR40XX_PORT_VLAN1_OUT_MODE_TAG; -+ else -+ egress = AR40XX_PORT_VLAN1_OUT_MODE_UNMOD; -+ - ingress = AR40XX_IN_SECURE; - } else { - egress = AR40XX_PORT_VLAN1_OUT_MODE_UNTOUCH; -@@ -1579,8 +1591,17 @@ ar40xx_setup_port(struct ar40xx_priv *pr - t |= pvid << AR40XX_PORT_VLAN0_DEF_CVID_S; - ar40xx_write(priv, AR40XX_REG_PORT_VLAN0(port), t); - -- t = AR40XX_PORT_VLAN1_PORT_VLAN_PROP; -- t |= egress << AR40XX_PORT_VLAN1_OUT_MODE_S; -+ t = egress << AR40XX_PORT_VLAN1_OUT_MODE_S; -+ -+ /* set CPU port to core port */ -+ if (port == 0) -+ t |= AR40XX_PORT_VLAN1_CORE_PORT; -+ -+ if (priv->vlan_tagged & BIT(port)) -+ t |= AR40XX_PORT_VLAN1_PORT_VLAN_PROP; -+ else -+ t |= AR40XX_PORT_VLAN1_PORT_TLS_MODE; -+ - ar40xx_write(priv, AR40XX_REG_PORT_VLAN1(port), t); - - t = members; ---- a/drivers/net/ethernet/qualcomm/essedma/edma_axi.c -+++ b/drivers/net/ethernet/qualcomm/essedma/edma_axi.c -@@ -970,7 +970,6 @@ static int edma_axi_probe(struct platfor - edma_netdev[i]->netdev_ops = &edma_axi_netdev_ops; - edma_netdev[i]->max_mtu = 9000; - edma_netdev[i]->features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM -- | NETIF_F_HW_VLAN_CTAG_TX - | NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_SG | - NETIF_F_TSO | NETIF_F_GRO; - edma_netdev[i]->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM | -@@ -982,10 +981,10 @@ static int edma_axi_probe(struct platfor - NETIF_F_TSO | NETIF_F_GRO; - - #ifdef CONFIG_RFS_ACCEL -- edma_netdev[i]->features |= NETIF_F_RXHASH | NETIF_F_NTUPLE; -- edma_netdev[i]->hw_features |= NETIF_F_RXHASH | NETIF_F_NTUPLE; -- edma_netdev[i]->vlan_features |= NETIF_F_RXHASH | NETIF_F_NTUPLE; -- edma_netdev[i]->wanted_features |= NETIF_F_RXHASH | NETIF_F_NTUPLE; -+ edma_netdev[i]->features |= NETIF_F_NTUPLE; -+ edma_netdev[i]->hw_features |= NETIF_F_NTUPLE; -+ edma_netdev[i]->vlan_features |= NETIF_F_NTUPLE; -+ edma_netdev[i]->wanted_features |= NETIF_F_NTUPLE; - #endif - edma_set_ethtool_ops(edma_netdev[i]); - ---- a/drivers/net/phy/ar40xx.h -+++ b/drivers/net/phy/ar40xx.h -@@ -151,6 +151,9 @@ struct ar40xx_mib_desc { - #define AR40XX_MIB_FUNC_NO_OP 0x0 - #define AR40XX_MIB_FUNC_FLUSH 0x1 - -+#define AR40XX_ESS_SERVICE_TAG 0x48 -+#define AR40XX_ESS_SERVICE_TAG_STAG BIT(17) -+ - #define AR40XX_REG_PORT_STATUS(_i) (0x07c + (_i) * 4) - #define AR40XX_PORT_SPEED BITS(0, 2) - #define AR40XX_PORT_STATUS_SPEED_S 0 -@@ -179,6 +182,8 @@ struct ar40xx_mib_desc { - #define AR40XX_PORT_VLAN0_DEF_CVID_S 16 - - #define AR40XX_REG_PORT_VLAN1(_i) (0x424 + (_i) * 0x8) -+#define AR40XX_PORT_VLAN1_CORE_PORT BIT(9) -+#define AR40XX_PORT_VLAN1_PORT_TLS_MODE BIT(7) - #define AR40XX_PORT_VLAN1_PORT_VLAN_PROP BIT(6) - #define AR40XX_PORT_VLAN1_OUT_MODE BITS(12, 2) - #define AR40XX_PORT_VLAN1_OUT_MODE_S 12