RE: [PATCH net-next v5 3/4] net: renesas: rswitch: add offloading for L2 switching
From: Michael Dege <hidden>
Date: 2025-09-30 11:36:10
Also in:
linux-renesas-soc, lkml
-----Original Message----- From: Christophe JAILLET <redacted> Sent: Monday, September 29, 2025 7:08 PM To: Michael Dege <redacted>; Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>; niklas.soderlund [off-list ref]; Paul Barker [off-list ref]; Andrew Lunn [off-list ref]; David S. Miller [off-list ref]; Eric Dumazet [off-list ref]; Jakub Kicinski [off-list ref]; Paolo Abeni [off-list ref] Cc: netdev@vger.kernel.org; linux-renesas-soc@vger.kernel.org; linux-kernel@vger.kernel.org; Nikita Yushchenko [off-list ref] 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 :quoted
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@cogentembedded.com> Signed-off-by: Michael Dege <redacted>...quoted
@@ -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
Hello Christophe, Thank you for your comment. I will look at your proposal and add it to the next patch set. Michael
quoted hunk ↗ jump to hunk
quoted
+ 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.cb/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; }
________________________________ Renesas Electronics Europe GmbH Registered Office: Arcadiastrasse 10 DE-40472 Duesseldorf Commercial Registry: Duesseldorf, HRB 3708 Managing Director: Carsten Jauch VAT-No.: DE 14978647 Tax-ID-No: 105/5839/1793 Legal Disclaimer: This e-mail communication (and any attachment/s) is confidential and contains proprietary information, some or all of which may be legally privileged. It is intended solely for the use of the individual or entity to which it is addressed. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.