Re: [PATCH net-next v3] net: Add sysfs atttribute for max_mtu

From: Eric Dumazet
Date: Thu May 09 2024 - 06:02:04 EST


On Thu, May 9, 2024 at 11:11 AM Shradha Gupta
<shradhagupta@xxxxxxxxxxxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxxxxxxxxxxx>
> Reviewed-by: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
> ---
> 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(+)


Sorry, this is a NACK from my side.

Adding sysfs attributes is costly for setups adding/deleting many
netns/devices per second.

RTNL already provides this value.

net/core/rtnetlink.c:1850: nla_put_u32(skb, IFLA_MAX_MTU,
READ_ONCE(dev->max_mtu)) ||