From nobody Sun Feb 8 18:47:23 2026 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (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 216CE30CD9F; Wed, 15 Oct 2025 22:33:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760567638; cv=none; b=QhPHC0sKf+wS9ojI7/QRnnMrmq4No4zBnfkf36v0Rh7v02Km2+jjXKhtT0CqGD0nIOR2fun2vqFZT+6ncPudXMgLBdsLYMkhnZCoLrASPdoS5Wj874+RGk3qExYtJR+KIRToE3RMoRpAziNp3TUG6N/Ttctoj4RXKKapYdsJ7SI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760567638; c=relaxed/simple; bh=hI6zhUaPUnSyYaYYUOCoj1r0gchkEgn6E8nlapACsZ4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NpIcI+uIM5DKtgVoaQopikXnY5/ulaYkXfSW++fe/1v9rKxOeP1VdQUKOt+4HzMWIvQFFuz5S4CBtTtk0nM8RnePjn5+35eBZAc6XNC3OfB8PshbxTCqk7SPSiwmnRwh+uQ7iDh9e6+sV+MDXFh1KaujTRBQT30jUdraMg7xSUk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.98.2) (envelope-from ) id 1v9A49-000000006XG-38pp; Wed, 15 Oct 2025 22:33:53 +0000 Date: Wed, 15 Oct 2025 23:33:50 +0100 From: Daniel Golle To: Hauke Mehrtens , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andreas Schirm , Lukas Stockmann , Alexander Sverdlin , Peter Christen , Avinash Jayaraman , Bing tao Xu , Liang Xu , Juraj Povazanec , "Fanni (Fang-Yi) Chan" , "Benny (Ying-Tsan) Weng" , "Livia M. Rosu" , John Crispin Subject: [PATCH net-next 10/11] net: dsa: lantiq_gswip: drop untagged on VLAN-aware bridge ports with no PVID Message-ID: <787aa807d00b726d75db2a40add215c8b8ba7466.1760566491.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Vladimir Oltean Implement the required functionality, as written in Documentation/networking/switchdev.rst section "Bridge VLAN filtering", by using the "VLAN Ingress Tag Rule" feature of the switch. The bit field definitions for this were found while browsing the Intel dual BSD/GPLv2 licensed drivers for this switch IP. Signed-off-by: Vladimir Oltean Signed-off-by: Daniel Golle --- drivers/net/dsa/lantiq/lantiq_gswip.c | 6 ++++++ drivers/net/dsa/lantiq/lantiq_gswip.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq= /lantiq_gswip.c index cfdeb8148500..1ff0932dae31 100644 --- a/drivers/net/dsa/lantiq/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq/lantiq_gswip.c @@ -551,6 +551,7 @@ static void gswip_port_commit_pvid(struct gswip_priv *p= riv, int port) { struct dsa_port *dp =3D dsa_to_port(priv->ds, port); struct net_device *br =3D dsa_port_bridge_dev_get(dp); + u32 vinr; int idx; =20 if (!dsa_port_is_user(dp)) @@ -582,6 +583,11 @@ static void gswip_port_commit_pvid(struct gswip_priv *= priv, int port) idx =3D port + 1; } =20 + vinr =3D idx ? GSWIP_PCE_VCTRL_VINR_ALL : GSWIP_PCE_VCTRL_VINR_TAGGED; + gswip_switch_mask(priv, GSWIP_PCE_VCTRL_VINR, + FIELD_PREP(GSWIP_PCE_VCTRL_VINR, vinr), + GSWIP_PCE_VCTRL(port)); + /* GSWIP 2.2 (GRX300) and later program here the VID directly. */ gswip_switch_w(priv, idx, GSWIP_PCE_DEFPVID(port)); } diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.h b/drivers/net/dsa/lantiq= /lantiq_gswip.h index 4590a1a7dbd9..69c8d2deff2d 100644 --- a/drivers/net/dsa/lantiq/lantiq_gswip.h +++ b/drivers/net/dsa/lantiq/lantiq_gswip.h @@ -159,6 +159,10 @@ #define GSWIP_PCE_PCTRL_0_PSTATE_MASK GENMASK(2, 0) #define GSWIP_PCE_VCTRL(p) (0x485 + ((p) * 0xA)) #define GSWIP_PCE_VCTRL_UVR BIT(0) /* Unknown VLAN Rule */ +#define GSWIP_PCE_VCTRL_VINR GENMASK(2, 1) /* VLAN Ingress Tag Rule */ +#define GSWIP_PCE_VCTRL_VINR_ALL 0 /* Admit tagged and untagged packets */ +#define GSWIP_PCE_VCTRL_VINR_TAGGED 1 /* Admit only tagged packets */ +#define GSWIP_PCE_VCTRL_VINR_UNTAGGED 2 /* Admit only untagged packets */ #define GSWIP_PCE_VCTRL_VIMR BIT(3) /* VLAN Ingress Member violation rul= e */ #define GSWIP_PCE_VCTRL_VEMR BIT(4) /* VLAN Egress Member violation rule= */ #define GSWIP_PCE_VCTRL_VSR BIT(5) /* VLAN Security */ --=20 2.51.0