lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 10 Aug 2022 11:27:45 +0300
From:   Sergei Antonov <saproj@...il.com>
To:     netdev@...r.kernel.org
Cc:     Sergei Antonov <saproj@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>
Subject: [PATCH] net: dsa: mv88e6060: report max mtu 1536

This driver sets the MaxFrameSize bit to 1 during setup,
see GLOBAL_CONTROL_MAX_FRAME_1536 in mv88e6060_setup_global().
Thus MTU is always 1536.
Introduce mv88e6060_port_max_mtu() to report it back to system.

Signed-off-by: Sergei Antonov <saproj@...il.com>
CC: Vladimir Oltean <olteanv@...il.com>
CC: Florian Fainelli <f.fainelli@...il.com>
---
 drivers/net/dsa/mv88e6060.c | 7 ++++++-
 drivers/net/dsa/mv88e6060.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6060.c b/drivers/net/dsa/mv88e6060.c
index a4c6eb9a52d0..c53734379b96 100644
--- a/drivers/net/dsa/mv88e6060.c
+++ b/drivers/net/dsa/mv88e6060.c
@@ -160,7 +160,6 @@ static int mv88e6060_setup_addr(struct mv88e6060_priv *priv)
 	u16 val;
 
 	eth_random_addr(addr);
-
 	val = addr[0] << 8 | addr[1];
 
 	/* The multicast bit is always transmitted as a zero, so the switch uses
@@ -212,6 +211,11 @@ static int mv88e6060_setup(struct dsa_switch *ds)
 	return 0;
 }
 
+static int mv88e6060_port_max_mtu(struct dsa_switch *ds, int port)
+{
+	return MV88E6060_MAX_MTU;
+}
+
 static int mv88e6060_port_to_phy_addr(int port)
 {
 	if (port >= 0 && port < MV88E6060_PORTS)
@@ -247,6 +251,7 @@ mv88e6060_phy_write(struct dsa_switch *ds, int port, int regnum, u16 val)
 static const struct dsa_switch_ops mv88e6060_switch_ops = {
 	.get_tag_protocol = mv88e6060_get_tag_protocol,
 	.setup		= mv88e6060_setup,
+	.port_max_mtu	= mv88e6060_port_max_mtu,
 	.phy_read	= mv88e6060_phy_read,
 	.phy_write	= mv88e6060_phy_write,
 };
diff --git a/drivers/net/dsa/mv88e6060.h b/drivers/net/dsa/mv88e6060.h
index 6c13c2421b64..382fe462fb2d 100644
--- a/drivers/net/dsa/mv88e6060.h
+++ b/drivers/net/dsa/mv88e6060.h
@@ -11,6 +11,7 @@
 #define __MV88E6060_H
 
 #define MV88E6060_PORTS	6
+#define MV88E6060_MAX_MTU	1536
 
 #define REG_PORT(p)		(0x8 + (p))
 #define PORT_STATUS		0x00
-- 
2.32.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ