🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #2655

Re: [PATCH net] net: airoha: Keep UPDMEM egress MAC in sync for offloaded IPv6 flows

#2655
From: Lorenzo Bianconi
Date: Tue, 13 Oct 2026 07:36
90 lines
8417 bytes
--TsY4h+RbU0p15xnQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

> Ooo,  the new patch should be a dedicated leaf lock inside
> airoha_ppe_init_upd_mem().
> --- a/drivers/net/ethernet/airoha/airoha_ppe.c
> +++ b/drivers/net/ethernet/airoha/airoha_ppe.c
> @@ -416,6 +416,19 @@
>    dsa_port);
>=20
>   smac_id =3D port->id;
> + /*
> + * Routed IPv6 entries resolve the egress source MAC
> + * through the UPDMEM table indexed by smac_id. The
> + * egress netdev can legally carry a different address
> + * than the GDM port itself: on PON setups the
> + * authentication MAC lives on the pon device while
> + * each service VLAN routes with its own address. Keep
> + * the table entry in sync with the source address this
> + * flow is actually going to use.

Is the issue occurring just with PON or are you able to trigger the issue e=
ven
in the upstream codebase? I guess you should not post a fix for some code t=
hat
is not upstream yet. Moreover, in the PON setup, I guess the approach is st=
ill
broken if the user change the device mac address.

> + */
> + if (type >=3D PPE_PKT_TYPE_IPV6_ROUTE_3T)
> + airoha_ppe_init_upd_mem(dev,
> + data->eth.h_source);
>   }
>   }
>=20
> @@ -1529,10 +1542,21 @@
>=20
>  void airoha_ppe_init_upd_mem(struct airoha_gdm_dev *dev, const u8 *addr)
>  {
> + static DEFINE_MUTEX(updmem_lock);
> +
>   struct airoha_gdm_port *port =3D dev->port;
>   struct airoha_eth *eth =3D dev->eth;
>   u32 val;
>=20
> + /*
> + * Routed IPv6 entries resolve the egress source MAC through the
> + * UPDMEM table indexed by smac_id; the ndo_open/ndo_set_mac_address
> + * writers hold flow_offload_mutex (QoS paths re-lock via
> + * airoha_set_macaddr()), so this lock also serializes the leaf
> + * against them.
> + */
> + mutex_lock(&updmem_lock);

This is only required adding the above configuration since in the current
codebase airoha_ppe_init_upd_mem() is always running holding RTNL.

Regards,
Lorenzo

> +
>   val =3D (addr[2] << 24) | (addr[3] << 16) | (addr[4] << 8) | addr[5];
>   airoha_fe_wr(eth, REG_UPDMEM_DATA(0), val);
>   airoha_fe_wr(eth, REG_UPDMEM_CTRL(0),
> @@ -1545,6 +1569,8 @@
>       FIELD_PREP(PPE_UPDMEM_ADDR_MASK, port->id) |
>       FIELD_PREP(PPE_UPDMEM_OFFSET_MASK, 1) |
>       PPE_UPDMEM_WR_MASK | PPE_UPDMEM_REQ_MASK);
> +
> + mutex_unlock(&updmem_lock);
>  }
>=20
>  struct airoha_ppe_dev *airoha_ppe_get_dev(struct device *dev)

--TsY4h+RbU0p15xnQ
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCas3faAAKCRA6cBh0uS2t
rBzUAQCL/fb8smdTz5MWaZqzvmSS5tTGd94zzSEJp/E/0DMNXQD/ecISkztvJeO7
lNdqhT63wJKz2zXCWEru2qKfnsV6EQA=
=YGK5
-----END PGP SIGNATURE-----

--TsY4h+RbU0p15xnQ--
Technical Details
Message-ID: <as3faB96PFSnC-qP@lore-desk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345421-linux-kernel-netdev=dewy.ru
References: <CAPZ+gd9d1P+xDSrxxZkGJr32zjubP=KfQegeGkWykKGvEH0=oA@mail.gmail.com> <CAPZ+gd8TPNnvEDOv_H=fdvy2ysG63uBD0MvmEMjhkMa8i-y1NA@mail.gmail.com> <as0DO7n5SCr2j3Z2@lore-desk> <CAPZ+gd_1JsNyhQbEAWiE1stom+T_jgvt4F2=tb68YoSvPCnFag@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345421-linux-kernel-netdev=dewy.ru
From: lorenzo@kernel.org (Lorenzo Bianconi)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net: airoha: Keep UPDMEM egress MAC in sync for
 offloaded IPv6 flows
Date: Tue, 13 Oct 2026 09:36:08 +0200
Organization: Usenet Network
Message-ID: <as3faB96PFSnC-qP@lore-desk>
References: <CAPZ+gd9d1P+xDSrxxZkGJr32zjubP=KfQegeGkWykKGvEH0=oA@mail.gmail.com>
 <CAPZ+gd8TPNnvEDOv_H=fdvy2ysG63uBD0MvmEMjhkMa8i-y1NA@mail.gmail.com>
 <as0DO7n5SCr2j3Z2@lore-desk>
 <CAPZ+gd_1JsNyhQbEAWiE1stom+T_jgvt4F2=tb68YoSvPCnFag@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="TsY4h+RbU0p15xnQ"
Injection-Info: usenet.network;
	logging-data="1988187"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:rMepfjGlvfFPvokGd4wVKKFQOyc= sha256:VTEGPpmfT7i7jT17UF6nZlh0BU6RD+WAUH8TmgNVLZ8=
	sha1:f2Y9cbN+Oa+7y15MFKx+Itv6SPQ= sha256:/ALFYdzxePhck7VoyJo6yHMqCPFXyvjdwk2aiLEQPS4=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id CB3E210FD9C; Tue, 13 Oct 2026 10:36:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.341
X-Spam-Status: No, score=-1.341 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id M48_uenjjPiV;
	Tue, 13 Oct 2026 10:36:22 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-345421-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 48F9610FD87; Tue, 13 Oct 2026 10:36:13 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 6C58531220; Tue, 13 Oct 2026 07:36:12 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 70B3D38886B;
	Tue, 13 Oct 2026 07:36:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b0Zdq6gF"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(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 5714D349CF0
	for <netdev@vger.kernel.org>; Tue, 13 Oct 2026 07:36:10 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791876971; cv=none; b=hMsUm0SY75bFA5gch4mJ2jU5YJXzTmYmaVjNy5K2pmdJgCM4fFYOS8oGhjbh8EJNkWyiRIUu/I+T8wMPepmpoXaOeEkLCLynDR4naZ4KKcwcT59gmLqOJaEUghcvaI5uxJ1jhKYu9ljcUlsM/oAGgEhl7BuIVO66ksSEVw7pPo4=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791876971; c=relaxed/simple;
	bh=uJNr8MuDmtKlslzBqHB35803Z4VAdOFssu8DXaY7GkQ=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=C9obyW40Xo+vQq5MWorZuHgxLCYyNmztlMqHNDR8tKIDtmM/l8oPjVVToc0YafFAelyg1ZXm0g4WLlPgaJvow6itNZnRf44PAiFouKjWfIr6z0NXJ9EM7naDqKS730IVZ/NKWfK/f6fPZXA5q8brKemxn1UMh7X9znhcAXl+LMU=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b0Zdq6gF; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B37671F000FF;
	Tue, 13 Oct 2026 07:36:09 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1791876970;
	bh=UKe/K2SFz3cYwqVg3k3/7PTTaraKAqNtSe8pGFak5HM=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=b0Zdq6gFncODMxuvCb00Ksvk98CswTE8ORGdJbNA+AsqstxOu8Gsb7TWeN/0mq42Z
	 uztm3Muh1JZoTZqqO6Vt2TV8E3r1hwjd4tQ4ERxruUdXJfsTqM1KVYElQwI2Uu6z1D
	 eVqJUbot57OLAlaJlQSBscBMLb6f+kirrkRKvgdJclHpxqy3pJqX+odHouKsKjvV3W
	 RTp8ygnLKhxbJxogmAacEp1biB6Gcp1cnIoDMKEnqnkYt4b4dfpGOgyclCSFboxoep
	 IFY4oXBKNYsnAofOZlI6/RtkZqQXTFjAwysrPeb2VOo8k5MyMpwQDWYPtSc8YZITL2
	 EtEWvSuUbjqCQ==
X-Cc: netdev@vger.kernel.org, horms@kernel.org,
	linux-arm-kernel@lists.infradead.org
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <CAPZ+gd_1JsNyhQbEAWiE1stom+T_jgvt4F2=tb68YoSvPCnFag@mail.gmail.com>