[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a17f9051-9676-4ab0-a69f-75aa2575b933@wanadoo.fr>
Date: Mon, 29 Sep 2025 19:08:20 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Michael Dege <michael.dege@...esas.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Niklas Söderlund <niklas.soderlund@...natech.se>,
Paul Barker <paul@...rker.dev>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Nikita Yushchenko <nikita.yoush@...entembedded.com>
Subject: Re: [PATCH net-next v5 3/4] net: renesas: rswitch: add offloading for
L2 switching
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@...entembedded.com>
> Signed-off-by: Michael Dege <michael.dege@...esas.com>
...
> @@ -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;
}
Powered by blists - more mailing lists