* [PATCH net v2] net: renesas: rswitch: fix forwarding offload statemachine
@ 2026-02-05 13:35 Michael Dege
2026-02-05 16:07 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Michael Dege @ 2026-02-05 13:35 UTC (permalink / raw)
To: Yoshihiro Shimoda, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Nikita Yushchenko
Cc: netdev, linux-renesas-soc, linux-kernel, Michael Dege
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 <michael.dege@renesas.com>
---
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: add 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-statemachine-v1-1-640224a531d0@renesas.com
---
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>
To: David S. Miller <davem@davemloft.net>
To: Eric Dumazet <edumazet@google.com>
To: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
To: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
To: Michael Dege <michael.dege@renesas.com>
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/ethernet/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
*/
#include <linux/err.h>
@@ -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;
/* calculate fwd_mask with zeroes in bits corresponding to ports that
@@ -73,8 +74,9 @@ static void rswitch_update_l2_hw_forwarding(struct rswitch_private *priv)
}
rswitch_for_all_ports(priv, rdev) {
- if ((rdev_for_l2_offload(rdev) && rdev->forwarding_requested) ||
- rdev->forwarding_offloaded) {
+ new_forwarding_offload = (rdev_for_l2_offload(rdev) && rdev->forwarding_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 rswitch_private *priv)
priv->addr + FWPC2(rdev->port));
}
- 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);
- }
}
}
---
base-commit: f14faaf3a1fb3b9e4cf2e56269711fb85fba9458
change-id: 20260205-fix-offloading-statemachine-1d301630a08d
Best regards,
--
Michael Dege <michael.dege@renesas.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net v2] net: renesas: rswitch: fix forwarding offload statemachine
2026-02-05 13:35 [PATCH net v2] net: renesas: rswitch: fix forwarding offload statemachine Michael Dege
@ 2026-02-05 16:07 ` Jakub Kicinski
2026-02-06 5:56 ` Michael Dege
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2026-02-05 16:07 UTC (permalink / raw)
To: Michael Dege
Cc: Yoshihiro Shimoda, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Nikita Yushchenko, netdev, linux-renesas-soc,
linux-kernel
On Thu, 05 Feb 2026 14:35:21 +0100 Michael Dege wrote:
> 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 <michael.dege@renesas.com>
> ---
> 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: add offloading for L2 switching")
Please wait 24h before posting a next version of a patch per:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#tl-dr
The Fixes tag is not in the right place here, it should be above your
SoB and the hash is too long (consult the Documentation/ for exact
format)
--
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: [PATCH net v2] net: renesas: rswitch: fix forwarding offload statemachine
2026-02-05 16:07 ` Jakub Kicinski
@ 2026-02-06 5:56 ` Michael Dege
0 siblings, 0 replies; 3+ messages in thread
From: Michael Dege @ 2026-02-06 5:56 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Yoshihiro Shimoda, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Nikita Yushchenko, netdev@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Hello Jakub,
Thank you for your comment.
> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Thursday, February 5, 2026 5:07 PM
> To: Michael Dege <michael.dege@renesas.com>
> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>; Andrew Lunn <andrew+netdev@lunn.ch>; David
> S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Paolo Abeni <pabeni@redhat.com>;
> Nikita Yushchenko <nikita.yoush@cogentembedded.com>; netdev@vger.kernel.org; linux-renesas-
> soc@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH net v2] net: renesas: rswitch: fix forwarding offload statemachine
>
> On Thu, 05 Feb 2026 14:35:21 +0100 Michael Dege wrote:
> > 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 <michael.dege@renesas.com>
> > ---
> > 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: add offloading for L2 switching")
>
> Please wait 24h before posting a next version of a patch per:
>
> https://www.kernel.org/doc/html/next%252
> Fprocess%2Fmaintainer-netdev.html%23tl-
> dr&data=05%7C02%7Cmichael.dege%40renesas.com%7C22dc6b8fb523473170cc08de64d0a6b3%7C53d82571da1947e49cb4
> 625a166a4a2a%7C0%7C0%7C639059044486368599%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAu
> MDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=WN7Lp3B4q2jOl9REKdbaoVtL1o
> Nr7%2FVME%2BPCJQxoPg4%3D&reserved=0
>
> The Fixes tag is not in the right place here, it should be above your SoB and the hash is too long
> (consult the Documentation/ for exact
> format)
> --
> pw-bot: cr
I will fix the issues.
Best regards,
Michael
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-06 5:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-05 13:35 [PATCH net v2] net: renesas: rswitch: fix forwarding offload statemachine Michael Dege
2026-02-05 16:07 ` Jakub Kicinski
2026-02-06 5:56 ` Michael Dege
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox