linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] net: dsa: mv88e6xxx: port mtu support
@ 2020-07-23  3:59 Chris Packham
  2020-07-23  3:59 ` [PATCH 1/4] net: dsa: mv88e6xxx: MV88E6097 does not support jumbo configuration Chris Packham
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Chris Packham @ 2020-07-23  3:59 UTC (permalink / raw)
  To: andrew, vivien.didelot, f.fainelli, davem, kuba
  Cc: netdev, linux-kernel, Chris Packham

This series connects up the mv88e6xxx switches to the dsa infrastructure for
configuring the port MTU. The first patch is also a bug fix which might be a
candiatate for stable.

Chris Packham (4):
  net: dsa: mv88e6xxx: MV88E6097 does not support jumbo configuration
  net: dsa: mv88e6xxx: Support jumbo configuration on 6190/6190X
  net: dsa: mv88e6xxx: Implement .port_change_mtu/.port_max_mtu
  net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU

 drivers/net/dsa/mv88e6xxx/chip.c    | 38 ++++++++++++++++++++++++++++-
 drivers/net/dsa/mv88e6xxx/chip.h    |  3 +++
 drivers/net/dsa/mv88e6xxx/global1.c | 17 +++++++++++++
 drivers/net/dsa/mv88e6xxx/global1.h |  2 ++
 4 files changed, 59 insertions(+), 1 deletion(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/4] net: dsa: mv88e6xxx: MV88E6097 does not support jumbo configuration
  2020-07-23  3:59 [PATCH 0/4] net: dsa: mv88e6xxx: port mtu support Chris Packham
@ 2020-07-23  3:59 ` Chris Packham
  2020-07-23 13:31   ` Andrew Lunn
  2020-07-23  3:59 ` [PATCH 2/4] net: dsa: mv88e6xxx: Support jumbo configuration on 6190/6190X Chris Packham
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Chris Packham @ 2020-07-23  3:59 UTC (permalink / raw)
  To: andrew, vivien.didelot, f.fainelli, davem, kuba
  Cc: netdev, linux-kernel, Chris Packham

The MV88E6097 chip does not support configuring jumbo frames. Prior to
commit 5f4366660d65 only the 6352, 6351, 6165 and 6320 chips configured
jumbo mode. The refactor accidentally added the function for the 6097.
Remove the erroneous function pointer assignment.

Fixes: 5f4366660d65 ("net: dsa: mv88e6xxx: Refactor setting of jumbo frames")
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 7627ea61e0ea..fbfa4087eb7b 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3469,7 +3469,6 @@ static const struct mv88e6xxx_ops mv88e6097_ops = {
 	.port_set_frame_mode = mv88e6351_port_set_frame_mode,
 	.port_set_egress_floods = mv88e6352_port_set_egress_floods,
 	.port_set_ether_type = mv88e6351_port_set_ether_type,
-	.port_set_jumbo_size = mv88e6165_port_set_jumbo_size,
 	.port_egress_rate_limiting = mv88e6095_port_egress_rate_limiting,
 	.port_pause_limit = mv88e6097_port_pause_limit,
 	.port_disable_learn_limit = mv88e6xxx_port_disable_learn_limit,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/4] net: dsa: mv88e6xxx: Support jumbo configuration on 6190/6190X
  2020-07-23  3:59 [PATCH 0/4] net: dsa: mv88e6xxx: port mtu support Chris Packham
  2020-07-23  3:59 ` [PATCH 1/4] net: dsa: mv88e6xxx: MV88E6097 does not support jumbo configuration Chris Packham
@ 2020-07-23  3:59 ` Chris Packham
  2020-07-23 13:32   ` Andrew Lunn
  2020-07-23  3:59 ` [PATCH 3/4] net: dsa: mv88e6xxx: Implement .port_change_mtu/.port_max_mtu Chris Packham
  2020-07-23  3:59 ` [PATCH 4/4] net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU Chris Packham
  3 siblings, 1 reply; 13+ messages in thread
From: Chris Packham @ 2020-07-23  3:59 UTC (permalink / raw)
  To: andrew, vivien.didelot, f.fainelli, davem, kuba
  Cc: netdev, linux-kernel, Chris Packham

The MV88E6190 and MV88E6190X both support per port jumbo configuration
just like the other GE switches. Install the appropriate ops.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---

I'm including this change in my series for completeness. Looking at the
datasheets I think this is an unintentional omission but I don't have actual
hardware to test this change on so some testing from someone with access to the
right chip would be appreciated.

 drivers/net/dsa/mv88e6xxx/chip.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index fbfa4087eb7b..c2a4ac99545d 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3933,6 +3933,7 @@ static const struct mv88e6xxx_ops mv88e6190_ops = {
 	.port_set_frame_mode = mv88e6351_port_set_frame_mode,
 	.port_set_egress_floods = mv88e6352_port_set_egress_floods,
 	.port_set_ether_type = mv88e6351_port_set_ether_type,
+	.port_set_jumbo_size = mv88e6165_port_set_jumbo_size,
 	.port_pause_limit = mv88e6390_port_pause_limit,
 	.port_disable_learn_limit = mv88e6xxx_port_disable_learn_limit,
 	.port_disable_pri_override = mv88e6xxx_port_disable_pri_override,
@@ -3991,6 +3992,7 @@ static const struct mv88e6xxx_ops mv88e6190x_ops = {
 	.port_set_frame_mode = mv88e6351_port_set_frame_mode,
 	.port_set_egress_floods = mv88e6352_port_set_egress_floods,
 	.port_set_ether_type = mv88e6351_port_set_ether_type,
+	.port_set_jumbo_size = mv88e6165_port_set_jumbo_size,
 	.port_pause_limit = mv88e6390_port_pause_limit,
 	.port_disable_learn_limit = mv88e6xxx_port_disable_learn_limit,
 	.port_disable_pri_override = mv88e6xxx_port_disable_pri_override,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/4] net: dsa: mv88e6xxx: Implement .port_change_mtu/.port_max_mtu
  2020-07-23  3:59 [PATCH 0/4] net: dsa: mv88e6xxx: port mtu support Chris Packham
  2020-07-23  3:59 ` [PATCH 1/4] net: dsa: mv88e6xxx: MV88E6097 does not support jumbo configuration Chris Packham
  2020-07-23  3:59 ` [PATCH 2/4] net: dsa: mv88e6xxx: Support jumbo configuration on 6190/6190X Chris Packham
@ 2020-07-23  3:59 ` Chris Packham
  2020-07-23 13:31   ` Andrew Lunn
  2020-07-23  3:59 ` [PATCH 4/4] net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU Chris Packham
  3 siblings, 1 reply; 13+ messages in thread
From: Chris Packham @ 2020-07-23  3:59 UTC (permalink / raw)
  To: andrew, vivien.didelot, f.fainelli, davem, kuba
  Cc: netdev, linux-kernel, Chris Packham

Add implementations for the mv88e6xxx switches to connect with the
generic dsa operations for configuring the port MTU.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index c2a4ac99545d..04e4a7291d14 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2841,6 +2841,30 @@ static int mv88e6xxx_devlink_param_set(struct dsa_switch *ds, u32 id,
 	return err;
 }
 
+static int mv88e6xxx_port_change_mtu(struct dsa_switch *ds, int port,
+				     int new_mtu)
+{
+	struct mv88e6xxx_chip *chip = ds->priv;
+	int err = -EOPNOTSUPP;
+
+	mv88e6xxx_reg_lock(chip);
+	if (chip->info->ops->port_set_jumbo_size)
+		err = chip->info->ops->port_set_jumbo_size(chip, port, new_mtu);
+	mv88e6xxx_reg_unlock(chip);
+
+	return err;
+}
+
+static int mv88e6xxx_port_max_mtu(struct dsa_switch *ds, int port)
+{
+	struct mv88e6xxx_chip *chip = ds->priv;
+
+	if (chip->info->ops->port_set_jumbo_size)
+		return 10240;
+
+	return 1518;
+}
+
 static const struct devlink_param mv88e6xxx_devlink_params[] = {
 	DSA_DEVLINK_PARAM_DRIVER(MV88E6XXX_DEVLINK_PARAM_ID_ATU_HASH,
 				 "ATU_hash", DEVLINK_PARAM_TYPE_U8,
@@ -5562,6 +5586,8 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
 	.get_ts_info		= mv88e6xxx_get_ts_info,
 	.devlink_param_get	= mv88e6xxx_devlink_param_get,
 	.devlink_param_set	= mv88e6xxx_devlink_param_set,
+	.port_change_mtu	= mv88e6xxx_port_change_mtu,
+	.port_max_mtu		= mv88e6xxx_port_max_mtu,
 };
 
 static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/4] net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU
  2020-07-23  3:59 [PATCH 0/4] net: dsa: mv88e6xxx: port mtu support Chris Packham
                   ` (2 preceding siblings ...)
  2020-07-23  3:59 ` [PATCH 3/4] net: dsa: mv88e6xxx: Implement .port_change_mtu/.port_max_mtu Chris Packham
@ 2020-07-23  3:59 ` Chris Packham
  2020-07-23 13:34   ` Andrew Lunn
  3 siblings, 1 reply; 13+ messages in thread
From: Chris Packham @ 2020-07-23  3:59 UTC (permalink / raw)
  To: andrew, vivien.didelot, f.fainelli, davem, kuba
  Cc: netdev, linux-kernel, Chris Packham

Some of the chips in the mv88e6xxx family don't support jumbo
configuration per port. But they do have a chip-wide max frame size that
can be used. Use this to approximate the behaviour of configuring a port
based MTU.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---

The only hardware I have access to uses a 88E6097. I've included the 6085, 6123
and 6185 based on reading the datasheets.

 drivers/net/dsa/mv88e6xxx/chip.c    |  9 +++++++++
 drivers/net/dsa/mv88e6xxx/chip.h    |  3 +++
 drivers/net/dsa/mv88e6xxx/global1.c | 17 +++++++++++++++++
 drivers/net/dsa/mv88e6xxx/global1.h |  2 ++
 4 files changed, 31 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 04e4a7291d14..836d7c894ef2 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2850,6 +2850,8 @@ static int mv88e6xxx_port_change_mtu(struct dsa_switch *ds, int port,
 	mv88e6xxx_reg_lock(chip);
 	if (chip->info->ops->port_set_jumbo_size)
 		err = chip->info->ops->port_set_jumbo_size(chip, port, new_mtu);
+	else if (chip->info->ops->set_max_frame_size)
+		err = chip->info->ops->set_max_frame_size(chip, new_mtu);
 	mv88e6xxx_reg_unlock(chip);
 
 	return err;
@@ -2861,6 +2863,8 @@ static int mv88e6xxx_port_max_mtu(struct dsa_switch *ds, int port)
 
 	if (chip->info->ops->port_set_jumbo_size)
 		return 10240;
+	else if (chip->info->ops->set_max_frame_size)
+		return 1632;
 
 	return 1518;
 }
@@ -3449,6 +3453,7 @@ static const struct mv88e6xxx_ops mv88e6085_ops = {
 	.vtu_getnext = mv88e6352_g1_vtu_getnext,
 	.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
 	.phylink_validate = mv88e6185_phylink_validate,
+	.set_max_frame_size = mv88e6185_g1_set_max_frame_size,
 };
 
 static const struct mv88e6xxx_ops mv88e6095_ops = {
@@ -3477,6 +3482,7 @@ static const struct mv88e6xxx_ops mv88e6095_ops = {
 	.vtu_getnext = mv88e6185_g1_vtu_getnext,
 	.vtu_loadpurge = mv88e6185_g1_vtu_loadpurge,
 	.phylink_validate = mv88e6185_phylink_validate,
+	.set_max_frame_size = mv88e6185_g1_set_max_frame_size,
 };
 
 static const struct mv88e6xxx_ops mv88e6097_ops = {
@@ -3514,6 +3520,7 @@ static const struct mv88e6xxx_ops mv88e6097_ops = {
 	.vtu_getnext = mv88e6352_g1_vtu_getnext,
 	.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
 	.phylink_validate = mv88e6185_phylink_validate,
+	.set_max_frame_size = mv88e6185_g1_set_max_frame_size,
 };
 
 static const struct mv88e6xxx_ops mv88e6123_ops = {
@@ -3548,6 +3555,7 @@ static const struct mv88e6xxx_ops mv88e6123_ops = {
 	.vtu_getnext = mv88e6352_g1_vtu_getnext,
 	.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
 	.phylink_validate = mv88e6185_phylink_validate,
+	.set_max_frame_size = mv88e6185_g1_set_max_frame_size,
 };
 
 static const struct mv88e6xxx_ops mv88e6131_ops = {
@@ -3937,6 +3945,7 @@ static const struct mv88e6xxx_ops mv88e6185_ops = {
 	.vtu_getnext = mv88e6185_g1_vtu_getnext,
 	.vtu_loadpurge = mv88e6185_g1_vtu_loadpurge,
 	.phylink_validate = mv88e6185_phylink_validate,
+	.set_max_frame_size = mv88e6185_g1_set_max_frame_size,
 };
 
 static const struct mv88e6xxx_ops mv88e6190_ops = {
diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
index e5430cf2ad71..f9faf48139e0 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.h
+++ b/drivers/net/dsa/mv88e6xxx/chip.h
@@ -552,6 +552,9 @@ struct mv88e6xxx_ops {
 	void (*phylink_validate)(struct mv88e6xxx_chip *chip, int port,
 				 unsigned long *mask,
 				 struct phylink_link_state *state);
+
+	/* Max Frame Size */
+	int (*set_max_frame_size)(struct mv88e6xxx_chip *chip, int mtu);
 };
 
 struct mv88e6xxx_irq_ops {
diff --git a/drivers/net/dsa/mv88e6xxx/global1.c b/drivers/net/dsa/mv88e6xxx/global1.c
index ca3a7a7a73c3..f62aa83ca08d 100644
--- a/drivers/net/dsa/mv88e6xxx/global1.c
+++ b/drivers/net/dsa/mv88e6xxx/global1.c
@@ -196,6 +196,23 @@ int mv88e6185_g1_ppu_disable(struct mv88e6xxx_chip *chip)
 	return mv88e6185_g1_wait_ppu_disabled(chip);
 }
 
+int mv88e6185_g1_set_max_frame_size(struct mv88e6xxx_chip *chip, int mtu)
+{
+	u16 val;
+	int err;
+
+	err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_CTL1, &val);
+	if (err)
+		return err;
+
+	val &= ~MV88E6185_G1_CTL1_MAX_FRAME_1632;
+
+	if (mtu > 1518)
+		val |= MV88E6185_G1_CTL1_MAX_FRAME_1632;
+
+	return mv88e6xxx_g1_write(chip, MV88E6XXX_G1_CTL1, val);
+}
+
 /* Offset 0x10: IP-PRI Mapping Register 0
  * Offset 0x11: IP-PRI Mapping Register 1
  * Offset 0x12: IP-PRI Mapping Register 2
diff --git a/drivers/net/dsa/mv88e6xxx/global1.h b/drivers/net/dsa/mv88e6xxx/global1.h
index 5324c6f4ae90..1e3546f8b072 100644
--- a/drivers/net/dsa/mv88e6xxx/global1.h
+++ b/drivers/net/dsa/mv88e6xxx/global1.h
@@ -282,6 +282,8 @@ int mv88e6250_g1_reset(struct mv88e6xxx_chip *chip);
 int mv88e6185_g1_ppu_enable(struct mv88e6xxx_chip *chip);
 int mv88e6185_g1_ppu_disable(struct mv88e6xxx_chip *chip);
 
+int mv88e6185_g1_set_max_frame_size(struct mv88e6xxx_chip *chip, int mtu);
+
 int mv88e6xxx_g1_stats_snapshot(struct mv88e6xxx_chip *chip, int port);
 int mv88e6320_g1_stats_snapshot(struct mv88e6xxx_chip *chip, int port);
 int mv88e6390_g1_stats_snapshot(struct mv88e6xxx_chip *chip, int port);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/4] net: dsa: mv88e6xxx: Implement .port_change_mtu/.port_max_mtu
  2020-07-23  3:59 ` [PATCH 3/4] net: dsa: mv88e6xxx: Implement .port_change_mtu/.port_max_mtu Chris Packham
@ 2020-07-23 13:31   ` Andrew Lunn
  2020-07-23 20:50     ` Chris Packham
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2020-07-23 13:31 UTC (permalink / raw)
  To: Chris Packham
  Cc: vivien.didelot, f.fainelli, davem, kuba, netdev, linux-kernel

On Thu, Jul 23, 2020 at 03:59:41PM +1200, Chris Packham wrote:
> Add implementations for the mv88e6xxx switches to connect with the
> generic dsa operations for configuring the port MTU.

Hi Chris

What tree is this against?

commit 2a550aec36543b20f087e4b3063882e9465f7175
Author: Andrew Lunn <andrew@lunn.ch>
Date:   Sat Jul 11 22:32:05 2020 +0200

    net: dsa: mv88e6xxx: Implement MTU change
    
    The Marvell Switches support jumbo packages. So implement the
    callbacks needed for changing the MTU.
    
    Signed-off-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index d995f5bf0d40..6f019955ae42 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2693,6 +2693,31 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
        return mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_DEFAULT_VLAN, 0);
 }
 
+static int mv88e6xxx_get_max_mtu(struct dsa_switch *ds, int port)
+{
+       struct mv88e6xxx_chip *chip = ds->priv;
+
+       if (chip->info->ops->port_set_jumbo_size)
+               return 10240;
+       return 1522;
+}
+
+static int mv88e6xxx_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
+{
...
	Andrew

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/4] net: dsa: mv88e6xxx: MV88E6097 does not support jumbo configuration
  2020-07-23  3:59 ` [PATCH 1/4] net: dsa: mv88e6xxx: MV88E6097 does not support jumbo configuration Chris Packham
@ 2020-07-23 13:31   ` Andrew Lunn
  0 siblings, 0 replies; 13+ messages in thread
From: Andrew Lunn @ 2020-07-23 13:31 UTC (permalink / raw)
  To: Chris Packham
  Cc: vivien.didelot, f.fainelli, davem, kuba, netdev, linux-kernel

On Thu, Jul 23, 2020 at 03:59:39PM +1200, Chris Packham wrote:
> The MV88E6097 chip does not support configuring jumbo frames. Prior to
> commit 5f4366660d65 only the 6352, 6351, 6165 and 6320 chips configured
> jumbo mode. The refactor accidentally added the function for the 6097.
> Remove the erroneous function pointer assignment.
> 
> Fixes: 5f4366660d65 ("net: dsa: mv88e6xxx: Refactor setting of jumbo frames")
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/4] net: dsa: mv88e6xxx: Support jumbo configuration on 6190/6190X
  2020-07-23  3:59 ` [PATCH 2/4] net: dsa: mv88e6xxx: Support jumbo configuration on 6190/6190X Chris Packham
@ 2020-07-23 13:32   ` Andrew Lunn
  0 siblings, 0 replies; 13+ messages in thread
From: Andrew Lunn @ 2020-07-23 13:32 UTC (permalink / raw)
  To: Chris Packham
  Cc: vivien.didelot, f.fainelli, davem, kuba, netdev, linux-kernel

On Thu, Jul 23, 2020 at 03:59:40PM +1200, Chris Packham wrote:
> The MV88E6190 and MV88E6190X both support per port jumbo configuration
> just like the other GE switches. Install the appropriate ops.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU
  2020-07-23  3:59 ` [PATCH 4/4] net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU Chris Packham
@ 2020-07-23 13:34   ` Andrew Lunn
  2020-07-23 20:54     ` Chris Packham
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2020-07-23 13:34 UTC (permalink / raw)
  To: Chris Packham
  Cc: vivien.didelot, f.fainelli, davem, kuba, netdev, linux-kernel

On Thu, Jul 23, 2020 at 03:59:42PM +1200, Chris Packham wrote:
> Some of the chips in the mv88e6xxx family don't support jumbo
> configuration per port. But they do have a chip-wide max frame size that
> can be used. Use this to approximate the behaviour of configuring a port
> based MTU.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Hi Chris

This patch will need a bit of rework for net-next, but the basic idea
is O.K.

   Andrew

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/4] net: dsa: mv88e6xxx: Implement .port_change_mtu/.port_max_mtu
  2020-07-23 13:31   ` Andrew Lunn
@ 2020-07-23 20:50     ` Chris Packham
  2020-07-23 21:02       ` Andrew Lunn
  0 siblings, 1 reply; 13+ messages in thread
From: Chris Packham @ 2020-07-23 20:50 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: vivien.didelot, f.fainelli, davem, kuba, netdev, linux-kernel


On 24/07/20 1:31 am, Andrew Lunn wrote:
> On Thu, Jul 23, 2020 at 03:59:41PM +1200, Chris Packham wrote:
>> Add implementations for the mv88e6xxx switches to connect with the
>> generic dsa operations for configuring the port MTU.
> Hi Chris
>
> What tree is this against?
$ git config remote.origin.url
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
$ git describe `git merge-base HEAD origin/master`
v5.8-rc6-3-g4fa640dc5230

> commit 2a550aec36543b20f087e4b3063882e9465f7175
> Author: Andrew Lunn <andrew@lunn.ch>
> Date:   Sat Jul 11 22:32:05 2020 +0200
>
>      net: dsa: mv88e6xxx: Implement MTU change
>      
>      The Marvell Switches support jumbo packages. So implement the
>      callbacks needed for changing the MTU.
>      
>      Signed-off-by: Andrew Lunn <andrew@lunn.ch>
>      Signed-off-by: David S. Miller <davem@davemloft.net>
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index d995f5bf0d40..6f019955ae42 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -2693,6 +2693,31 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
>          return mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_DEFAULT_VLAN, 0);
>   }
>   
> +static int mv88e6xxx_get_max_mtu(struct dsa_switch *ds, int port)
> +{
> +       struct mv88e6xxx_chip *chip = ds->priv;
> +
> +       if (chip->info->ops->port_set_jumbo_size)
> +               return 10240;
> +       return 1522;
> +}
> +
> +static int mv88e6xxx_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
> +{
> ...
Snap. I created my series because I need it on an internal 5.7 based 
kernel. So I'm happy to drop mine and back-port your implementation.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU
  2020-07-23 13:34   ` Andrew Lunn
@ 2020-07-23 20:54     ` Chris Packham
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Packham @ 2020-07-23 20:54 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: vivien.didelot, f.fainelli, davem, kuba, netdev, linux-kernel

On 24/07/20 1:34 am, Andrew Lunn wrote:
> On Thu, Jul 23, 2020 at 03:59:42PM +1200, Chris Packham wrote:
>> Some of the chips in the mv88e6xxx family don't support jumbo
>> configuration per port. But they do have a chip-wide max frame size that
>> can be used. Use this to approximate the behaviour of configuring a port
>> based MTU.
>>
>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Hi Chris
>
> This patch will need a bit of rework for net-next, but the basic idea
> is O.K.

I'll rebase my series on top of net-next.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/4] net: dsa: mv88e6xxx: Implement .port_change_mtu/.port_max_mtu
  2020-07-23 20:50     ` Chris Packham
@ 2020-07-23 21:02       ` Andrew Lunn
  2020-07-23 21:16         ` Chris Packham
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2020-07-23 21:02 UTC (permalink / raw)
  To: Chris Packham
  Cc: vivien.didelot, f.fainelli, davem, kuba, netdev, linux-kernel

On Thu, Jul 23, 2020 at 08:50:27PM +0000, Chris Packham wrote:
> 
> On 24/07/20 1:31 am, Andrew Lunn wrote:
> > On Thu, Jul 23, 2020 at 03:59:41PM +1200, Chris Packham wrote:
> >> Add implementations for the mv88e6xxx switches to connect with the
> >> generic dsa operations for configuring the port MTU.
> > Hi Chris
> >
> > What tree is this against?
> $ git config remote.origin.url
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> $ git describe `git merge-base HEAD origin/master`

Hi Chris

Networking patches are expected to be against net-next. Or net if they
are fixes. Please don't submit patches to netdev against other trees.

	   Andrew

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/4] net: dsa: mv88e6xxx: Implement .port_change_mtu/.port_max_mtu
  2020-07-23 21:02       ` Andrew Lunn
@ 2020-07-23 21:16         ` Chris Packham
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Packham @ 2020-07-23 21:16 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: vivien.didelot, f.fainelli, davem, kuba, netdev, linux-kernel


On 24/07/20 9:02 am, Andrew Lunn wrote:
> On Thu, Jul 23, 2020 at 08:50:27PM +0000, Chris Packham wrote:
>> On 24/07/20 1:31 am, Andrew Lunn wrote:
>>> On Thu, Jul 23, 2020 at 03:59:41PM +1200, Chris Packham wrote:
>>>> Add implementations for the mv88e6xxx switches to connect with the
>>>> generic dsa operations for configuring the port MTU.
>>> Hi Chris
>>>
>>> What tree is this against?
>> $ git config remote.origin.url
>> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>> $ git describe `git merge-base HEAD origin/master`
> Hi Chris
>
> Networking patches are expected to be against net-next. Or net if they
> are fixes. Please don't submit patches to netdev against other trees.

OK. I'll try to remember that for next time. For this series in 
particular it's a little hard for me to test net-next because the 
hardware in question relies on a bunch of code that is not upstream.



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-07-23 21:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23  3:59 [PATCH 0/4] net: dsa: mv88e6xxx: port mtu support Chris Packham
2020-07-23  3:59 ` [PATCH 1/4] net: dsa: mv88e6xxx: MV88E6097 does not support jumbo configuration Chris Packham
2020-07-23 13:31   ` Andrew Lunn
2020-07-23  3:59 ` [PATCH 2/4] net: dsa: mv88e6xxx: Support jumbo configuration on 6190/6190X Chris Packham
2020-07-23 13:32   ` Andrew Lunn
2020-07-23  3:59 ` [PATCH 3/4] net: dsa: mv88e6xxx: Implement .port_change_mtu/.port_max_mtu Chris Packham
2020-07-23 13:31   ` Andrew Lunn
2020-07-23 20:50     ` Chris Packham
2020-07-23 21:02       ` Andrew Lunn
2020-07-23 21:16         ` Chris Packham
2020-07-23  3:59 ` [PATCH 4/4] net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU Chris Packham
2020-07-23 13:34   ` Andrew Lunn
2020-07-23 20:54     ` Chris Packham

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).