Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp1018353lqo; Thu, 9 May 2024 02:12:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU87nIrxNIzVU5m8oUqKgDQEp70X0TPl6QoEoHbHKGQ1g6QODmMBL4dzNHG+C/Y/urdSv+DNgvyDX7+9FicJAlvuxpNOnkUdSeA+P70EA== X-Google-Smtp-Source: AGHT+IEOlwRkqY6v9ysa3etS5MQH3fz3VahptNjK4JYqPjVNANaO1pekWXbjQXIRYirb+pzfkLK6 X-Received: by 2002:a05:6871:7994:b0:22e:c17e:4aa1 with SMTP id 586e51a60fabf-24097c62010mr5258218fac.20.1715245929263; Thu, 09 May 2024 02:12:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715245929; cv=pass; d=google.com; s=arc-20160816; b=y8NbWt+RTR1CoVEQf5xk/MbIFUdl8XKbDjkWo29kMbFZzb42jca26kgpoGSBrnY/3a 9OJAsUG0kc09mQ9ZE0oaEQTCU81R82Ws+fl5pRJJcmAbOtfCAuktoh+p0PLG+1YFvFnI h3mxaP56qzIZIGwGqCW5t5QHKHElSklsTtbH0u2TZWXMIMYHYxlGQTdpZomwzll7fxBB TGBiW8FwBrL+CMY73kgafYUwxjLd6mQ2BolAVMjqFxeQfJQQjtkJYxSwDq25gNtjK/9m QhEWDyGXxA3If6nqBxcKM/sn/vJWNNHzwGRyGVbCx6+qInj7jyzRIiGIN5cJgpvU5sQb JkSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=OMMgT6984I7d/5ikV2+Qam6oJc08svn3gC0xGzvFYrk=; fh=7m1B9pfhXWzExAXMBj7kiXvxjoHPtR2vBXMzC/Gwi54=; b=jvmR6jwyATwMGp34rRPpPmpMOAlpi+yXRXjW4sGnPRvGZjmisYLKj8BRqBjoybVxOx e7FUAlsnoBkDyXAYvKftPYY04qGUSRNRnSkEDEfxZzfQv+QR6XetQn200l1Dq+HkW2HK thsVA/HmXctWVXwj5V86B3Ezwtq/ZUUbJ3R05Zulgq4QCi7vCYyX4qyyvTnEmAjnoM6X 4118kothg9ulzqwvh5uMvAd4cGod0Y/8w6+9AOd4hXBzThybQEwv6PCjy1l1WOQPx5JU t9i2eZ47xHfQDtoJxAWQph1F0t5UBM2yMy4cuTUsBdQxbH4Ts2ezI4i334aNv1uL9wgF SOMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=j3V+3T4w; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-174333-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6340fe3aea9si999863a12.283.2024.05.09.02.12.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 02:12:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174333-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=j3V+3T4w; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-174333-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id BDD27B20AB5 for ; Thu, 9 May 2024 09:11:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45FB414A4EE; Thu, 9 May 2024 09:11:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="j3V+3T4w" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35FA51D6A5; Thu, 9 May 2024 09:11:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715245887; cv=none; b=s3cfn3TMCHIDxy2RNbSylkDzHJrBtgBG0IeHxcclM8rcmN4j8guvEW1t8LMPw1eX9VWr3RbGmnbMjPWsJ9/k5g9xxFRu2rSgypg3I10Qr+z8zf7l7no482uIFu6/4NAel6ZT2t0T/ElB4ifWQa0ZmUQCw0pZNd34C8Fx8y/bIWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715245887; c=relaxed/simple; bh=PhA2isl0xqvqqwLsz+Hq49gLXJdHdLhs9QtkmvjsCjI=; h=From:To:Cc:Subject:Date:Message-Id; b=QTNjpXJHBQreyXjhdb1R35TtucE/Kw5bAizIoVa8Yv2ono0wpPOLlVKYxJ51wq2fcS+bYpViSFt+h8q3sbuuAN49CtXSurBg6W+sNhviCJMgS8L8jugCCfGo8VR86VY+iBS7VcqeieuY6ebmVKlpXTu3kFNSgOSIU8UqLE/sfUc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=j3V+3T4w; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: by linux.microsoft.com (Postfix, from userid 1134) id 9BC172085C24; Thu, 9 May 2024 02:11:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9BC172085C24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715245885; bh=OMMgT6984I7d/5ikV2+Qam6oJc08svn3gC0xGzvFYrk=; h=From:To:Cc:Subject:Date:From; b=j3V+3T4wpPWaAbVLE7UwJwpWCtJd6qf/YO83D0MhXTAH0JQMNd+RdjI7H5fnYNm8+ K59ePRjPuvZ4fN51yeTBwrEFKSF09Ws/VWqz26z1iyj0OAkYlux88dDGE6IxagOmKq +hUMJwjiXuAudUIZv04TG0o+qS/a+Q8Wtu53RV6I= From: Shradha Gupta To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bjorn Helgaas , Jonathan Corbet , Haiyang Zhang , Randy Dunlap , Johannes Berg , Breno Leitao , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Shradha Gupta , Shradha Gupta Subject: [PATCH net-next v3] net: Add sysfs atttribute for max_mtu Date: Thu, 9 May 2024 02:11:23 -0700 Message-Id: <1715245883-3467-1-git-send-email-shradhagupta@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Reviewed-by: Haiyang Zhang --- 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//max_mtu +Date: April 2024 +KernelVersion: 6.10 +Contact: netdev@vger.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