netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH v5 0/4] net: renesas: rswitch: R-Car S4 add HW offloading for layer 2 switching
@ 2025-09-01  4:58 Michael Dege
  2025-09-01  4:58 ` [PATCH net-next v5 1/4] net: renesas: rswitch: rename rswitch.c to rswitch_main.c Michael Dege
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Michael Dege @ 2025-09-01  4:58 UTC (permalink / raw)
  To: Yoshihiro Shimoda, Niklas Söderlund, Paul Barker,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: netdev, linux-renesas-soc, linux-kernel, Michael Dege,
	Nikita Yushchenko, Andrew Lunn, Niklas Söderlund

Hello!

The current R-Car S4 rswitch driver only supports port based fowarding.
This patch set adds HW offloading for L2 switching/bridgeing. The driver
hooks into switchdev.

1. Rename the base driver file to keep the driver name (rswitch.ko)

2. Add setting of default MAC ageing time in hardware.

3. Add the L2 driver extension in a separate file. The HW offloading
is automatically configured when a port is added to the bridge device.

Usage example:
ip link add name br0 type bridge
ip link set dev tsn0 master br0
ip link set dev tsn1 master br0
ip link set dev br0 up
ip link set dev tsn0 up
ip link set dev tsn1 up

Layer 2 traffic is now fowarded by HW from port TSN0 to port TSN1.

4. Provides the functionality to set the MAC table ageing time in the
Rswitch.

Usage example:
ip link change dev br0 type bridge ageing 100

Changes in v5:
- Updated commit messeges [3/4] and [4/4] using iperative mood.
- Fixed incorrect id_len setting in rswitch_get_port_parent_id()
- Removed duplicate initialization of *rdev in 
  rswitch_update_ageing_time()
- Link to v4: https://lore.kernel.org/r/20250828-add_l2_switching-v4-0-89d7108c8592@renesas.com

Changes in v4:
- Added target tree to subject prefix.
- refactored rswitch_update_l2_hw_learning() and
  rswitch_update_l2_hw_forwarding() to remove duplicate code. 
- In function rswitch_update_offload_brdev() removed unused
  force_update_l2_offload parameter.
- Link to v3: https://lore.kernel.org/r/20250710-add_l2_switching-v3-0-c0a328327b43@renesas.com

Changes in v3:
- Split void rswitch_update_l2_offload(struct rswitch_private *priv) 
  into two functions to reduce the complexity.
- In rswitch_switchdev_blocking_event() returning -EOPNOTSUPP directly
  for unsupported events intead of calling function which returned
  -EOPNOTSUPP.
- Retuning result from rswitch_reg_wait() directly instead of using
  local variable at end of function.
- Restructured rswitch_update_offload_brdev() to fix smatch
  false-positive report.  
- Fixed reviewed-by tags in [1/4]
- Fixed oder of signed-off-by tags in [2/4]
- Removed magic number in [2/4]
- Link to v2: https://lore.kernel.org/r/20250708-add_l2_switching-v2-0-f91f5556617a@renesas.com

Changes in v2:
- Pulled default ageing setting into separate patch.
- Changed logging priority from info to dbg.
- Updated usage examples.
- Fixed passing of ageing parameter. Parameter is already in seconds
  no need to convert. Parameter checking improved.
- Updated commit message of [3/4] to point out that the switch hardware
  only supports the offloading of one bridge device. 
- Link to v1: https://lore.kernel.org/r/20250704-add_l2_switching-v1-0-ff882aacb258@renesas.com

Thanks,

Michael

Signed-off-by: Michael Dege <michael.dege@renesas.com>
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
---
To: Niklas Söderlund <niklas.soderlund@ragnatech.se>
To: Paul Barker <paul@pbarker.dev>
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>
Cc: netdev@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

---
Michael Dege (4):
      net: renesas: rswitch: rename rswitch.c to rswitch_main.c
      net: renesas: rswitch: configure default ageing time
      net: renesas: rswitch: add offloading for L2 switching
      net: renesas: rswitch: add modifiable ageing time

 drivers/net/ethernet/renesas/Makefile              |   1 +
 drivers/net/ethernet/renesas/rswitch.h             |  43 ++-
 drivers/net/ethernet/renesas/rswitch_l2.c          | 316 +++++++++++++++++++++
 drivers/net/ethernet/renesas/rswitch_l2.h          |  15 +
 .../ethernet/renesas/{rswitch.c => rswitch_main.c} |  86 +++++-
 5 files changed, 455 insertions(+), 6 deletions(-)
---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250616-add_l2_switching-345117105d0d

Best regards,
-- 
Michael Dege <michael.dege@renesas.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-09-04  8:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01  4:58 [net-next PATCH v5 0/4] net: renesas: rswitch: R-Car S4 add HW offloading for layer 2 switching Michael Dege
2025-09-01  4:58 ` [PATCH net-next v5 1/4] net: renesas: rswitch: rename rswitch.c to rswitch_main.c Michael Dege
2025-09-01  4:58 ` [PATCH net-next v5 2/4] net: renesas: rswitch: configure default ageing time Michael Dege
2025-09-01  4:58 ` [PATCH net-next v5 3/4] net: renesas: rswitch: add offloading for L2 switching Michael Dege
2025-09-01  4:58 ` [PATCH net-next v5 4/4] net: renesas: rswitch: add modifiable ageing time Michael Dege
2025-09-03 23:50 ` [net-next PATCH v5 0/4] net: renesas: rswitch: R-Car S4 add HW offloading for layer 2 switching Jakub Kicinski
2025-09-04  8:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).