diff mbox series

[net-next,v5,5/5] net: dsa: microchip: enable MTU normalization for KSZ8795 and KSZ9477 compatible switches

Message ID 20221123112625.2082797-6-o.rempel@pengutronix.de (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: microchip: add MTU support for KSZ8 series | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Oleksij Rempel Nov. 23, 2022, 11:26 a.m. UTC
KSZ8795 and KSZ9477 compatible series of switches use global max frame
size configuration register. So, enable MTU normalization for this reason.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/dsa/microchip/ksz8795.c | 2 ++
 drivers/net/dsa/microchip/ksz9477.c | 2 ++
 2 files changed, 4 insertions(+)

Comments

Arun Ramadoss Nov. 23, 2022, 1:41 p.m. UTC | #1
Hi Oleksij,

On Wed, 2022-11-23 at 12:26 +0100, Oleksij Rempel wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> KSZ8795 and KSZ9477 compatible series of switches use global max
> frame
> size configuration register. So, enable MTU normalization for this
> reason.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  drivers/net/dsa/microchip/ksz8795.c | 2 ++
>  drivers/net/dsa/microchip/ksz9477.c | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/net/dsa/microchip/ksz8795.c
> b/drivers/net/dsa/microchip/ksz8795.c
> index d01bfd609130..d88d0b989e1a 100644
> --- a/drivers/net/dsa/microchip/ksz8795.c
> +++ b/drivers/net/dsa/microchip/ksz8795.c
> @@ -1426,6 +1426,8 @@ int ksz8_switch_init(struct ksz_device *dev)
>          */
>         dev->ds->vlan_filtering_is_global = true;
> 
> +       dev->ds->mtu_enforcement_ingress = true;
> +
>         return 0;
>  }
> 
> diff --git a/drivers/net/dsa/microchip/ksz9477.c
> b/drivers/net/dsa/microchip/ksz9477.c
> index f6e7968ab105..4fb07fbdf565 100644
> --- a/drivers/net/dsa/microchip/ksz9477.c
> +++ b/drivers/net/dsa/microchip/ksz9477.c
> @@ -1134,6 +1134,8 @@ int ksz9477_setup(struct dsa_switch *ds)
>         struct ksz_device *dev = ds->priv;
>         int ret = 0;
> 
> +       dev->ds->mtu_enforcement_ingress = true;
> +

For the ksz8, you have added enforcement_ingress in ksz8_switch_init
but for ksz9477, you added in ksz9477_setup. Can you move
initialization from ksz8_switch_init to ksz8_setup to make similar
implementation for both the switches.

>         /* Required for port partitioning. */
>         ksz9477_cfg32(dev, REG_SW_QM_CTRL__4, UNICAST_VLAN_BOUNDARY,
>                       true);
> --
> 2.30.2
>
diff mbox series

Patch

diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
index d01bfd609130..d88d0b989e1a 100644
--- a/drivers/net/dsa/microchip/ksz8795.c
+++ b/drivers/net/dsa/microchip/ksz8795.c
@@ -1426,6 +1426,8 @@  int ksz8_switch_init(struct ksz_device *dev)
 	 */
 	dev->ds->vlan_filtering_is_global = true;
 
+	dev->ds->mtu_enforcement_ingress = true;
+
 	return 0;
 }
 
diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
index f6e7968ab105..4fb07fbdf565 100644
--- a/drivers/net/dsa/microchip/ksz9477.c
+++ b/drivers/net/dsa/microchip/ksz9477.c
@@ -1134,6 +1134,8 @@  int ksz9477_setup(struct dsa_switch *ds)
 	struct ksz_device *dev = ds->priv;
 	int ret = 0;
 
+	dev->ds->mtu_enforcement_ingress = true;
+
 	/* Required for port partitioning. */
 	ksz9477_cfg32(dev, REG_SW_QM_CTRL__4, UNICAST_VLAN_BOUNDARY,
 		      true);