From nobody Sat Feb 7 06:21:07 2026 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DAB833B2BA; Thu, 5 Feb 2026 13:35:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770298548; cv=none; b=H5SEpDVXpVsAzWKGKrnVN4pZ3j8HaNHx+Rm2LRyT/cF7ZMy1wolDkZ6hRn8cJWqtAmk2JJdXtU7dRmNbQEHet8aoPtzVONP3wZ2W0FiZ278hC6fRkyzv//qncFrPgA3FZIxbGOnhiU32kXetPfkAyAgLh+ka0KhWpRI54y3fang= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770298548; c=relaxed/simple; bh=dD/HTcR9V7UPhs+GBDDGvQ7kDxPOqqSZVrvRKS7V1Ko=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=oBAJ/OfAoQC4Zp468JZqEOJh4xI1c4yawJEpmouSeCwEQGg2BsqjEVnlCj30ioBBcfCqRyaDBELkJbkz0s4hZRA1VcMsMDPe5qDN7C03IU/2QTfWP/ZlU4WdW5Mv/icNaX3ljg6ytCHWrsGOXn5wB8zt2ZFsKOJI/K7VMq39rhI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 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 X-CSE-ConnectionGUID: tgbu/h+NQUGxTpd4o1IU7w== X-CSE-MsgGUID: boqrwSudRNuHRjL0DRTFRw== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 05 Feb 2026 22:35:45 +0900 Received: from [127.0.1.1] (unknown [10.226.78.135]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 81B25425CDD0; Thu, 5 Feb 2026 22:35:42 +0900 (JST) From: Michael Dege Date: Thu, 05 Feb 2026 14:35:21 +0100 Subject: [PATCH net v2] net: renesas: rswitch: fix forwarding offload statemachine Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260205-fix-offloading-statemachine-v2-1-fafcf0c6eb1d@renesas.com> X-B4-Tracking: v=1; b=H4sIAJichGkC/42NTQrCQAxGryJZG8lMfxBX3kO6CJ20DdgZmZSil N7dsSdw+R4f79vAJKsY3E4bZFnVNMUC/nyCfuI4CmooDJ58S54aHPSNaRieiYPGEW3hRWbuJ42 CLlTk2oqYrgFK4ZWlzI/6oys8qS0pf46z1f3sf93VocO2Ju9rbioX6J4lirFd+jRDt+/7FxKWE IPIAAAA X-Change-ID: 20260205-fix-offloading-statemachine-1d301630a08d To: Yoshihiro Shimoda , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nikita Yushchenko Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Dege X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1770298541; l=3394; i=michael.dege@renesas.com; s=20251023; h=from:subject:message-id; bh=dD/HTcR9V7UPhs+GBDDGvQ7kDxPOqqSZVrvRKS7V1Ko=; b=HZovnlAcJL5HpmhL2DNGIgLLC4Droel1AEuSaO/D55pklPt3uBq2IsRdLxQ2fsA6VAJ57FK9f 5eQVoGLQWeiCt7zH8Z2lU1XZVeweV+qhbGioAc2nhCpIPIw25i73E92 X-Developer-Key: i=michael.dege@renesas.com; a=ed25519; pk=gu1rwIcCrAxNMv2I8fIfiQvt51xzZwnQy4Ua/DscQt8= A change of the port state of one port, caused the state of another port to change. This behvior was unintended. Signed-off-by: Michael Dege --- A change of the port state of one port, caused the state of another port to change. This behvior was unintended. Fixes: b7502b1043de86967ff341819d05e09a8dbe8b2b ("net: renesas: rswitch: ad= d offloading for L2 switching") Changes in v2: - Implemented suggested improvements to the function. - Addded missing condition to an if statement. - introduced bool variable, to reduce the the logic in the if statements. - Link to v1: https://lore.kernel.org/r/20260205-fix-offloading-statemachin= e-v1-1-640224a531d0@renesas.com --- To: Yoshihiro Shimoda To: Andrew Lunn To: David S. Miller To: Eric Dumazet To: Jakub Kicinski To: Paolo Abeni To: Nikita Yushchenko To: Michael Dege Cc: netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/renesas/rswitch_l2.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/renesas/rswitch_l2.c b/drivers/net/ethern= et/renesas/rswitch_l2.c index 4a69ec77d69c..9433cd8adced 100644 --- a/drivers/net/ethernet/renesas/rswitch_l2.c +++ b/drivers/net/ethernet/renesas/rswitch_l2.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Renesas Ethernet Switch device driver * - * Copyright (C) 2025 Renesas Electronics Corporation + * Copyright (C) 2025 - 2026 Renesas Electronics Corporation */ =20 #include @@ -60,6 +60,7 @@ static void rswitch_update_l2_hw_learning(struct rswitch_= private *priv) static void rswitch_update_l2_hw_forwarding(struct rswitch_private *priv) { struct rswitch_device *rdev; + bool new_forwarding_offload; unsigned int fwd_mask; =20 /* calculate fwd_mask with zeroes in bits corresponding to ports that @@ -73,8 +74,9 @@ static void rswitch_update_l2_hw_forwarding(struct rswitc= h_private *priv) } =20 rswitch_for_all_ports(priv, rdev) { - if ((rdev_for_l2_offload(rdev) && rdev->forwarding_requested) || - rdev->forwarding_offloaded) { + new_forwarding_offload =3D (rdev_for_l2_offload(rdev) && rdev->forwardin= g_requested); + + if (new_forwarding_offload || rdev->forwarding_offloaded) { /* Update allowed offload destinations even for ports * with L2 offload enabled earlier. * @@ -84,13 +86,10 @@ static void rswitch_update_l2_hw_forwarding(struct rswi= tch_private *priv) priv->addr + FWPC2(rdev->port)); } =20 - if (rdev_for_l2_offload(rdev) && - rdev->forwarding_requested && - !rdev->forwarding_offloaded) { + if (new_forwarding_offload && !rdev->forwarding_offloaded) rswitch_change_l2_hw_offloading(rdev, true, false); - } else if (rdev->forwarding_offloaded) { + else if (!new_forwarding_offload && rdev->forwarding_offloaded) rswitch_change_l2_hw_offloading(rdev, false, false); - } } } =20 --- base-commit: f14faaf3a1fb3b9e4cf2e56269711fb85fba9458 change-id: 20260205-fix-offloading-statemachine-1d301630a08d Best regards, --=20 Michael Dege