mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Michael Dege <michael.dege@renesas.com>
Cc: "Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Paul Barker" <paul@pbarker.dev>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Nikita Yushchenko" <nikita.yoush@cogentembedded.com>
Subject: Re: [PATCH 2/3] net: renesas: rswitch: add offloading for L2 switching
Date: Fri, 4 Jul 2025 10:43:57 +0200	[thread overview]
Message-ID: <64e7de61-c4ed-4b42-83c6-5001a9d28ec0@lunn.ch> (raw)
In-Reply-To: <20250704-add_l2_switching-v1-2-ff882aacb258@renesas.com>

>  #include <linux/platform_device.h>
> +#include <linux/phy.h>
> +

It seems odd that a patch adding L2 support needs to touch PHYs?

> @@ -994,10 +1018,18 @@ struct rswitch_device {
>  	DECLARE_BITMAP(ts_skb_used, TS_TAGS_PER_PORT);
>  	bool disabled;
>  
> +	struct list_head list;
> +
>  	int port;
>  	struct rswitch_etha *etha;
>  	struct device_node *np_port;
>  	struct phy *serdes;
> +
> +	struct net_device *brdev;	/* master bridge device */

How many ports does this device have? If it is just two, this might
work. But for a multi-port device, you need to keep this in the port
structure.

> +bool is_rdev(const struct net_device *ndev);
> +void rswitch_modify(void __iomem *addr, enum rswitch_reg reg, u32 clear, u32 set);

Are these actually needed? It seems like they could be local
functions.

> +	if (offload_brdev && !priv->offload_brdev)
> +		dev_info(&priv->pdev->dev, "starting l2 offload for %s\n",
> +			 netdev_name(offload_brdev));
> +	else if (!offload_brdev && priv->offload_brdev)
> +		dev_info(&priv->pdev->dev, "stopping l2 offload for %s\n",
> +			 netdev_name(priv->offload_brdev));

Please don't spam the log like this dev_dbg() maybe.

> @@ -128,6 +134,14 @@ static void rswitch_fwd_init(struct rswitch_private *priv)
>  		iowrite32(0, priv->addr + FWPBFC(i));
>  	}
>  
> +	/* Configure MAC table aging */
> +	rswitch_modify(priv->addr, FWMACAGUSPC, FWMACAGUSPC_MACAGUSP,
> +		       FIELD_PREP(FWMACAGUSPC_MACAGUSP, 0x140));
> +
> +	reg_val = FIELD_PREP(FWMACAGC_MACAGT, RSW_AGEING_TIME);
> +	reg_val |= FWMACAGC_MACAGE | FWMACAGC_MACAGSL;
> +	iowrite32(reg_val, priv->addr + FWMACAGC);
> +

Please pull ageing out into a patch of its own.

    Andrew

---
pw-bot: cr

  reply	other threads:[~2025-07-04  8:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04  5:51 [PATCH 0/3] net: renesas: rswitch: R-Car S4 add HW offloading for layer 2 switching Michael Dege
2025-07-04  5:51 ` [PATCH 1/3] net: renesas: rswitch: rename rswitch.c to rswitch_main.c Michael Dege
2025-07-04  8:34   ` Andrew Lunn
2025-07-04  9:11   ` Niklas Söderlund
2025-07-04  5:51 ` [PATCH 2/3] net: renesas: rswitch: add offloading for L2 switching Michael Dege
2025-07-04  8:43   ` Andrew Lunn [this message]
2025-07-04  9:02     ` Nikita Yushchenko
2025-07-04 17:49       ` Andrew Lunn
2025-07-07  8:13     ` Michael Dege
2025-07-07  8:42       ` Michael Dege
2025-07-07 11:30       ` Andrew Lunn
2025-07-04  5:51 ` [PATCH 3/3] net: renesas: rswitch: add modifiable ageing time Michael Dege
2025-07-07 12:50   ` Geert Uytterhoeven
2025-07-07 12:59     ` Michael Dege
2025-07-04  8:33 ` [PATCH 0/3] net: renesas: rswitch: R-Car S4 add HW offloading for layer 2 switching Andrew Lunn
2025-07-07 10:41   ` Michael Dege
2025-07-07 11:53     ` Andrew Lunn
2025-07-07 12:25       ` Michael Dege
2025-07-04  8:46 ` Andrew Lunn
2025-07-04  9:05   ` Nikita Yushchenko
2025-07-04 17:53     ` Andrew Lunn
2025-07-04 17:56       ` Nikita Yushchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64e7de61-c4ed-4b42-83c6-5001a9d28ec0@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=michael.dege@renesas.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikita.yoush@cogentembedded.com \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=pabeni@redhat.com \
    --cc=paul@pbarker.dev \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®