netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>,
	Woojung Huh <woojung.huh@microchip.com>,
	UNGLinuxDriver@microchip.com, Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Arun Ramadoss <arun.ramadoss@microchip.com>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next v4 1/4] net: dsa: microchip: move max mtu to one location
Date: Thu, 10 Nov 2022 06:42:03 -0800	[thread overview]
Message-ID: <53bd4c46-17f9-91c1-fda5-bd2d09ae2ff7@gmail.com> (raw)
In-Reply-To: <20221110122225.1283326-2-o.rempel@pengutronix.de>



On 11/10/2022 4:22 AM, Oleksij Rempel wrote:
> There are no HW specific registers, so we can process all of them
> in one location.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Tested-by: Arun Ramadoss <arun.ramadoss@microchip.com> (KSZ9893 and LAN937x)

This looks good to me, just one nit see below

[snip]

> @@ -2500,10 +2499,23 @@ static int ksz_max_mtu(struct dsa_switch *ds, int port)
>   {
>   	struct ksz_device *dev = ds->priv;
>   
> -	if (!dev->dev_ops->max_mtu)
> -		return -EOPNOTSUPP;
> +	switch (dev->chip_id) {
> +	case KSZ8563_CHIP_ID:
> +	case KSZ9477_CHIP_ID:
> +	case KSZ9563_CHIP_ID:
> +	case KSZ9567_CHIP_ID:
> +	case KSZ9893_CHIP_ID:
> +	case KSZ9896_CHIP_ID:
> +	case KSZ9897_CHIP_ID:
> +	case LAN9370_CHIP_ID:
> +	case LAN9371_CHIP_ID:
> +	case LAN9372_CHIP_ID:
> +	case LAN9373_CHIP_ID:
> +	case LAN9374_CHIP_ID:
> +		return KSZ9477_MAX_FRAME_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN;

Rename to KSZ_MAX_FRAME_SIZE to denote this is a common constant?

> +	}
>   
> -	return dev->dev_ops->max_mtu(dev, port);
> +	return -EOPNOTSUPP;
>   }
>   
>   static void ksz_set_xmii(struct ksz_device *dev, int port,
> diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
> index c6726cbd5465..27c26ee15af4 100644
> --- a/drivers/net/dsa/microchip/ksz_common.h
> +++ b/drivers/net/dsa/microchip/ksz_common.h
> @@ -322,7 +322,6 @@ struct ksz_dev_ops {
>   	void (*get_caps)(struct ksz_device *dev, int port,
>   			 struct phylink_config *config);
>   	int (*change_mtu)(struct ksz_device *dev, int port, int mtu);
> -	int (*max_mtu)(struct ksz_device *dev, int port);
>   	void (*freeze_mib)(struct ksz_device *dev, int port, bool freeze);
>   	void (*port_init_cnt)(struct ksz_device *dev, int port);
>   	void (*phylink_mac_config)(struct ksz_device *dev, int port,
> @@ -588,6 +587,8 @@ static inline int is_lan937x(struct ksz_device *dev)
>   
>   #define PORT_SRC_PHY_INT		1
>   
> +#define KSZ9477_MAX_FRAME_SIZE		9000\

And here are as well.
-- 
Florian

  reply	other threads:[~2022-11-10 14:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 12:22 [PATCH net-next v4 0/4] net: dsa: microchip: add MTU support for KSZ8 series Oleksij Rempel
2022-11-10 12:22 ` [PATCH net-next v4 1/4] net: dsa: microchip: move max mtu to one location Oleksij Rempel
2022-11-10 14:42   ` Florian Fainelli [this message]
2022-11-11  5:26     ` Oleksij Rempel
2022-11-10 12:22 ` [PATCH net-next v4 2/4] net: dsa: microchip: do not store max MTU for all ports Oleksij Rempel
2022-11-10 13:04   ` Vladimir Oltean
2022-11-10 14:42   ` Florian Fainelli
2022-11-10 12:22 ` [PATCH net-next v4 3/4] net: dsa: microchip: add ksz_rmw8() function Oleksij Rempel
2022-11-10 14:42   ` Florian Fainelli
2022-11-10 12:22 ` [PATCH net-next v4 4/4] net: dsa: microchip: ksz8: add MTU configuration support Oleksij Rempel
2022-11-10 13:03   ` Vladimir Oltean
2022-11-11  5:29     ` Oleksij Rempel
2022-11-10 14:43   ` Florian Fainelli

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=53bd4c46-17f9-91c1-fda5-bd2d09ae2ff7@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=arun.ramadoss@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.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;
as well as URLs for NNTP newsgroup(s).