[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1715245883-3467-1-git-send-email-shradhagupta@linux.microsoft.com>
Date: Thu, 9 May 2024 02:11:23 -0700
From: Shradha Gupta <shradhagupta@...ux.microsoft.com>
To: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Jonathan Corbet <corbet@....net>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Randy Dunlap <rdunlap@...radead.org>,
Johannes Berg <johannes.berg@...el.com>,
Breno Leitao <leitao@...ian.org>,
linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Cc: Shradha Gupta <shradhagupta@...ux.microsoft.com>,
Shradha Gupta <shradhagupta@...rosoft.com>
Subject: [PATCH net-next v3] net: Add sysfs atttribute for max_mtu
For drivers like MANA, max_mtu value is populated with the value of
maximum MTU that the underlying hardware can support.
Exposing this attribute as sysfs param, would be helpful in debugging
and customization of config issues with such drivers.
Signed-off-by: Shradha Gupta <shradhagupta@...ux.microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@...rosoft.com>
---
Changes in v3:
* Removed the min_mtu sysfs attribute as it was not needed
* Improved the commit message to explain the need for the changes
* Seperated this patch from other mana attributes requirements.
---
Documentation/ABI/testing/sysfs-class-net | 8 ++++++++
net/core/net-sysfs.c | 2 ++
2 files changed, 10 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-class-net b/Documentation/ABI/testing/sysfs-class-net
index ebf21beba846..5dcab8648283 100644
--- a/Documentation/ABI/testing/sysfs-class-net
+++ b/Documentation/ABI/testing/sysfs-class-net
@@ -352,3 +352,11 @@ Description:
0 threaded mode disabled for this dev
1 threaded mode enabled for this dev
== ==================================
+
+What: /sys/class/net/<iface>/max_mtu
+Date: April 2024
+KernelVersion: 6.10
+Contact: netdev@...r.kernel.org
+Description:
+ Indicates the interface's maximum supported MTU value, in
+ bytes, and in decimal format.
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index e3d7a8cfa20b..381becdd73a8 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -114,6 +114,7 @@ NETDEVICE_SHOW_RO(addr_len, fmt_dec);
NETDEVICE_SHOW_RO(ifindex, fmt_dec);
NETDEVICE_SHOW_RO(type, fmt_dec);
NETDEVICE_SHOW_RO(link_mode, fmt_dec);
+NETDEVICE_SHOW_RO(max_mtu, fmt_dec);
static ssize_t iflink_show(struct device *dev, struct device_attribute *attr,
char *buf)
@@ -660,6 +661,7 @@ static struct attribute *net_class_attrs[] __ro_after_init = {
&dev_attr_ifalias.attr,
&dev_attr_carrier.attr,
&dev_attr_mtu.attr,
+ &dev_attr_max_mtu.attr,
&dev_attr_flags.attr,
&dev_attr_tx_queue_len.attr,
&dev_attr_gro_flush_timeout.attr,
--
2.34.1
Powered by blists - more mailing lists