Re: [PATCH net-next v5 3/4] net: renesas: rswitch: add offloading for L2 switching
From: Christophe JAILLET
Date: Mon Sep 29 2025 - 13:09:35 EST
Le 01/09/2025 à 06:58, Michael Dege a écrit :
Add hardware offloading for L2 switching on R-Car S4.
On S4 brdev is limited to one per-device (not per port). Reasoning
is that hw L2 forwarding support lacks any sort of source port based
filtering, which makes it unusable to offload more than one bridge
device. Either you allow hardware to forward destination MAC to a
port, or you have to send it to CPU. You can't make it forward only
if src and dst ports are in the same brdev.
Signed-off-by: Nikita Yushchenko <nikita.yoush@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Michael Dege <michael.dege@xxxxxxxxxxx>
...
@@ -2153,6 +2210,8 @@ static int renesas_eth_sw_probe(struct platform_device *pdev)
if (!priv->gwca.queues)
return -ENOMEM;
+ INIT_LIST_HEAD(&priv->port_list);
+
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);
@@ -2163,6 +2222,15 @@ static int renesas_eth_sw_probe(struct platform_device *pdev)
return ret;
}
+ if (list_empty(&priv->port_list))
+ dev_warn(&pdev->dev, "could not initialize any ports\n");
+
+ ret = rswitch_register_notifiers();
+ if (ret) {
+ dev_err(&pdev->dev, "could not register notifiers\n");
+ return ret;
+ }
The error handling of the probe should be updated, as done in the remove function.
net-next is closed, so I'm just posting here
CJ
+
device_set_wakeup_capable(&pdev->dev, 1);
return ret;
@@ -2196,6 +2264,7 @@ static void renesas_eth_sw_remove(struct platform_device *pdev)
{
struct rswitch_private *priv = platform_get_drvdata(pdev);
+ rswitch_unregister_notifiers();
rswitch_deinit(priv);
pm_runtime_put(&pdev->dev);
The proposed fix would be:
diff --git a/drivers/net/ethernet/renesas/rswitch_main.c b/drivers/net/ethernet/renesas/rswitch_main.c
index 8d8acc2124b8..0f17c2e12cea 100644
--- a/drivers/net/ethernet/renesas/rswitch_main.c
+++ b/drivers/net/ethernet/renesas/rswitch_main.c
@@ -2213,11 +2213,8 @@ static int renesas_eth_sw_probe(struct platform_device *pdev)
pm_runtime_get_sync(&pdev->dev);
ret = rswitch_init(priv);
- if (ret < 0) {
- pm_runtime_put(&pdev->dev);
- pm_runtime_disable(&pdev->dev);
- return ret;
- }
+ if (ret < 0)
+ goto err_disable_pm_runtime;
if (list_empty(&priv->port_list))
dev_warn(&pdev->dev, "could not initialize any ports\n");
@@ -2225,11 +2222,19 @@ static int renesas_eth_sw_probe(struct platform_device *pdev)
ret = rswitch_register_notifiers();
if (ret) {
dev_err(&pdev->dev, "could not register notifiers\n");
- return ret;
+ goto err_deinit_rswitch;
}
device_set_wakeup_capable(&pdev->dev, 1);
+ return 0;
+
+err_deinit_rswitch:
+ rswitch_deinit(priv);
+err_disable_pm_runtime:
+ pm_runtime_put(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+
return ret;
}