[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1713954817-30133-1-git-send-email-shradhagupta@linux.microsoft.com>
Date: Wed, 24 Apr 2024 03:33:37 -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>,
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,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>,
Dexuan Cui <decui@...rosoft.com>,
Long Li <longli@...rosoft.com>,
Souradeep Chakrabarti <schakrabarti@...ux.microsoft.com>,
Konstantin Taranov <kotaranov@...rosoft.com>,
Yury Norov <yury.norov@...il.com>,
linux-hyperv@...r.kernel.org
Cc: Shradha Gupta <shradhagupta@...ux.microsoft.com>,
shradhagupta@...rosoft.com
Subject: [PATCH net-next v2 1/2] net: Add sysfs atttributes for max_mtu min_mtu
Add sysfs attributes to read max_mtu and min_mtu value for
network devices
Signed-off-by: Shradha Gupta <shradhagupta@...ux.microsoft.com>
---
Changes in v2:
* Created a new patch for generic attributes
---
Documentation/ABI/testing/sysfs-class-net | 16 ++++++++++++++++
net/core/net-sysfs.c | 4 ++++
2 files changed, 20 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-class-net b/Documentation/ABI/testing/sysfs-class-net
index ebf21beba846..f68f3b9be6ec 100644
--- a/Documentation/ABI/testing/sysfs-class-net
+++ b/Documentation/ABI/testing/sysfs-class-net
@@ -352,3 +352,19 @@ 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.
+
+What: /sys/class/net/<iface>/min_mtu
+Date: April 2024
+KernelVersion: 6.10
+Contact: netdev@...r.kernel.org
+Description:
+ Indicates the interface's minimum 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..525b85d47676 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -114,6 +114,8 @@ 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);
+NETDEVICE_SHOW_RO(min_mtu, fmt_dec);
static ssize_t iflink_show(struct device *dev, struct device_attribute *attr,
char *buf)
@@ -671,6 +673,8 @@ static struct attribute *net_class_attrs[] __ro_after_init = {
&dev_attr_carrier_up_count.attr,
&dev_attr_carrier_down_count.attr,
&dev_attr_threaded.attr,
+ &dev_attr_max_mtu.attr,
+ &dev_attr_min_mtu.attr,
NULL,
};
ATTRIBUTE_GROUPS(net_class);
--
2.34.1
Powered by blists - more mailing lists