public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: <Arun.Ramadoss@microchip.com>
To: <olteanv@gmail.com>, <UNGLinuxDriver@microchip.com>,
	<vivien.didelot@gmail.com>, <andrew@lunn.ch>,
	<f.fainelli@gmail.com>, <kuba@kernel.org>, <edumazet@google.com>,
	<pabeni@redhat.com>, <o.rempel@pengutronix.de>,
	<Woojung.Huh@microchip.com>, <davem@davemloft.net>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<kernel@pengutronix.de>
Subject: Re: [PATCH net-next v3 1/3] net: dsa: microchip: move max mtu to one location
Date: Wed, 9 Nov 2022 15:19:36 +0000	[thread overview]
Message-ID: <40adce4bb17a90ead75bf216d61b157f7d40fc0c.camel@microchip.com> (raw)
In-Reply-To: <20221108054336.4165931-2-o.rempel@pengutronix.de>

Hi Oleksij,

On Tue, 2022-11-08 at 06:43 +0100, Oleksij Rempel wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> 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)
> ---
>  drivers/net/dsa/microchip/ksz9477.c     |  5 -----
>  drivers/net/dsa/microchip/ksz9477.h     |  1 -
>  drivers/net/dsa/microchip/ksz9477_reg.h |  2 --
>  drivers/net/dsa/microchip/ksz_common.c  | 21 ++++++++++++++++-----
>  drivers/net/dsa/microchip/ksz_common.h  |  3 ++-
>  5 files changed, 18 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/net/dsa/microchip/ksz9477.c
> b/drivers/net/dsa/microchip/ksz9477.c
> index a6a0321a8931..e3adb126fdff 100644
> diff --git a/drivers/net/dsa/microchip/ksz_common.c
> b/drivers/net/dsa/microchip/ksz_common.c
> index d612181b3226..486ad03d0acf 100644
> --- a/drivers/net/dsa/microchip/ksz_common.c
> +++ b/drivers/net/dsa/microchip/ksz_common.c
> @@ -14,6 +14,7 @@
>  #include <linux/phy.h>
>  #include <linux/etherdevice.h>
>  #include <linux/if_bridge.h>
> +#include <linux/if_vlan.h>
>  #include <linux/irq.h>
>  #include <linux/irqdomain.h>
>  #include <linux/of_mdio.h>
> @@ -206,7 +207,6 @@ static const struct ksz_dev_ops ksz9477_dev_ops =
> {
>         .mdb_add = ksz9477_mdb_add,
>         .mdb_del = ksz9477_mdb_del,
>         .change_mtu = ksz9477_change_mtu,
> -       .max_mtu = ksz9477_max_mtu,
>         .phylink_mac_link_up = ksz9477_phylink_mac_link_up,
>         .config_cpu_port = ksz9477_config_cpu_port,
>         .enable_stp_addr = ksz9477_enable_stp_addr,
> @@ -243,7 +243,6 @@ static const struct ksz_dev_ops lan937x_dev_ops =
> {
>         .mdb_add = ksz9477_mdb_add,
>         .mdb_del = ksz9477_mdb_del,
>         .change_mtu = lan937x_change_mtu,
> -       .max_mtu = ksz9477_max_mtu,
>         .phylink_mac_link_up = ksz9477_phylink_mac_link_up,
>         .config_cpu_port = lan937x_config_cpu_port,
>         .enable_stp_addr = ksz9477_enable_stp_addr,
> @@ -2473,10 +2472,22 @@ 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 KSZ9567_CHIP_ID:
> +       case KSZ9893_CHIP_ID:

Patch to add KSZ9563 is now accepted in net-next, so add
KSZ9563_CHIP_ID in this case statement , in the next version of patch.

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=ef912fe443ad

> +       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;
> +       }
> 
> -       return dev->dev_ops->max_mtu(dev, port);
> +       return -EOPNOTSUPP;
>  }
> 
> 

  reply	other threads:[~2022-11-09 15:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08  5:43 [PATCH net-next v3 0/3] net: dsa: microchip: add MTU support for KSZ8 series Oleksij Rempel
2022-11-08  5:43 ` [PATCH net-next v3 1/3] net: dsa: microchip: move max mtu to one location Oleksij Rempel
2022-11-09 15:19   ` Arun.Ramadoss [this message]
2022-11-08  5:43 ` [PATCH net-next v3 2/3] net: dsa: microchip: add ksz_rmw8() function Oleksij Rempel
2022-11-08  5:43 ` [PATCH net-next v3 3/3] net: dsa: microchip: ksz8: add MTU configuration support Oleksij Rempel
2022-11-08  6:47   ` Arun.Ramadoss
2022-11-08  9:21   ` Vladimir Oltean

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=40adce4bb17a90ead75bf216d61b157f7d40fc0c.camel@microchip.com \
    --to=arun.ramadoss@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.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 \
    /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