Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp86402lqo; Thu, 9 May 2024 13:28:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJBQSFYVIUlCy3pAtu5d7V8BdS+lRh/pC2AzS/u5G9RR9h+GB1qFsLXK0PKEwmZV+fHidTt59cmnC+N4uGLbCOsbirdz9VrNZmcrIwaA== X-Google-Smtp-Source: AGHT+IHLJoC2EjpabAYr97vbSZV1f6rLVg52kGOyt6m7BlBRzTHJXwpKhYdQTOIPHHJU2mZTV0Y6 X-Received: by 2002:ac2:489a:0:b0:518:b283:1078 with SMTP id 2adb3069b0e04-5220fc7bf19mr479534e87.26.1715286506944; Thu, 09 May 2024 13:28:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715286506; cv=pass; d=google.com; s=arc-20160816; b=UcIf1PDLGfZctb2xzqJbq0tJpyDnpKJZZQMCT/XUix1AU43Lea0b5bpSxA1oF7HGwI yAbriyOCXVcn/3dr7VtPs/KCAUAgFiXki/xhNEgSCaG0b0CxV37hqM7/SDtZSP06MH3O QP4Qu03/3WpryI2FU0I0h9BDG/UH/eS3d1oLO0jB2725XjQhB2a8KGbtHMaIQLjDRyB4 gVZpgxOfEwgimM07tKqwL5w2LMzlKPdZ7UfHz8kjv9hwaWfbCKGkyESq7xGjSukKe1Ab +gRKb1O5GYZ1s9JnronW02qfOpv1xbWteJ34Q2NIubf3Wh0owZYNkcGIm3hi2w3GUZFO JSjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2Ct/oG04cz4M7nY829u2Qio1z6a5TPRCIdyjKCqCtGg=; fh=6mlLYgfvyOVV3/4evnw5VugjnygTkiWxUcrHrFOMNEI=; b=FHvjMuP3ztk6XfIlyHrNkOkIZPfa/O+dxvHVpUe9JXoLDttcT6wMEg8olh+bY1Uh7o LlK2/dbGs/HvY0zMZ0TDaHBZnbysuNDDeae+0q82rhditgPoJoh4RZEogjBRn1wMahBn df5zVxUPsz6iKVl6hO9Sh2vOQtc3m/CmkNvRaYvUp3FkI3tyvZJTL/3HI8LZiO0mTDQR w4cCYV061QeCr3Rlg36Ar+B2XWkWGcGsIWKYoFCJjVutcxn3Ppf4N00s4KaehkeGbbI+ rQ0aw7X1YEL2G08vhiey0NW7o8++3y4yHAaic8VXViA4MDhObdbkNGabT1Gg/SVgcnxU RIvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=zX+KV5aA; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-174920-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174920-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733beacb01si1174006a12.88.2024.05.09.13.28.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 13:28:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174920-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=zX+KV5aA; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-174920-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174920-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 am.mirrors.kernel.org (Postfix) with ESMTPS id A950C1F22805 for ; Thu, 9 May 2024 20:28:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B685E127B70; Thu, 9 May 2024 20:17:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="zX+KV5aA" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 405D380043; Thu, 9 May 2024 20:17:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715285843; cv=none; b=Tk4mGnTjrbeh8qvmyffjzQ7jwwRTDywDmXOi1p+8FckUBZTMiG6kE2W6We/Gk1mDdxiFjEFZTEYek92s0CJ7X1GLQjg1WGr2t9vhm8ugW+ksoRKdteLBjxchMus4tO3RinumiKiDFbc92pHxEPAJLzYuRMQ0VeeNbbEnJno+834= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715285843; c=relaxed/simple; bh=lICYDaRSn8HsmeXAurxSzsp+d+rM5QiHyZnsXPzU7TM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=esmp/TfaDpoE2reeQ8svcNTcSDQhSm/uv7SSc8N+JDxzqNKgPAIjBtyFamcHhGA3k/KyWNSVKIlsEhblIMcv+9zksBhJhd2xN+lNqsRIuRU5biM7TxwxXPLSS7LOeaV37vY8j0H4y1k/D+rYy+fsCoBNWI18C65f3Q7EcpQex7Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=zX+KV5aA; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=2Ct/oG04cz4M7nY829u2Qio1z6a5TPRCIdyjKCqCtGg=; b=zX+KV5aAAuuYlSsD4j+xGKxI28 oF0zirnqHjWj16/AD3Vti5CjmatTU9V4UD60sQq2VOrTUQzEuXR2j2XM+e9zwjJlrV9AHTM5errXT nHEbTs5DN4clan/cfjriWrxGljuiFMl7gcoMIFZm9iyz8+sPYfkBPLu7NaSv9qHxGpzo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1s5ACH-00F4pk-L3; Thu, 09 May 2024 22:16:57 +0200 Date: Thu, 9 May 2024 22:16:57 +0200 From: Andrew Lunn To: Ratheesh Kannoth Cc: Shradha Gupta , "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, Shradha Gupta Subject: Re: [PATCH net-next v3] net: Add sysfs atttribute for max_mtu Message-ID: <6203153e-780c-4570-9c4e-a053cfbc3290@lunn.ch> References: <1715245883-3467-1-git-send-email-shradhagupta@linux.microsoft.com> <20240509094225.GA1078660@maili.marvell.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240509094225.GA1078660@maili.marvell.com> On Thu, May 09, 2024 at 03:12:25PM +0530, Ratheesh Kannoth wrote: > On 2024-05-09 at 14:41:23, Shradha Gupta (shradhagupta@linux.microsoft.com) wrote: > > For drivers like MANA, max_mtu value is populated with the value of > > maximum MTU that the underlying hardware can support. > IIUC, this reads dev->mtu. I think you are misunderstanding the code. > > +NETDEVICE_SHOW_RO(max_mtu, fmt_dec); /* generate a show function for simple field */ #define NETDEVICE_SHOW(field, format_string) \ static ssize_t format_##field(const struct net_device *dev, char *buf) \ { \ return sysfs_emit(buf, format_string, dev->field); \ } \ static ssize_t field##_show(struct device *dev, \ struct device_attribute *attr, char *buf) \ { \ return netdev_show(dev, attr, buf, format_##field); \ } \ #define NETDEVICE_SHOW_RO(field, format_string) \ NETDEVICE_SHOW(field, format_string); \ static DEVICE_ATTR_RO(field) So field is max_mtu, so that dev->field gets expanded to dev->max_mtu. > you can read the same using ifconfig We stopped using ifconfig years ago. You actually mean "ip link show" > or any thing that uses SIOCGIFMTU. why do you need to add a new sysfs ? SIOCGIFMTU is still implemented, but obsolete, replaced by netlink, as Eric pointed out. Andrew