Re: [PATCH net-next] net: mana: Add new device attributes for mana

From: Shradha Gupta
Date: Mon Apr 22 2024 - 06:09:36 EST


On Fri, Apr 19, 2024 at 08:51:02PM +0200, Andrew Lunn wrote:
> On Fri, Apr 19, 2024 at 09:59:26AM -0700, Shradha Gupta wrote:
> > On Thu, Apr 18, 2024 at 08:42:59PM +0200, Andrew Lunn wrote:
> > > > >From an RDMA perspective this is all available from other APIs already
> > > > at least and I wouldn't want to see new sysfs unless there is a netdev
> > > > justification.
> > >
> > > It is unlikely there is a netdev justification. Configuration happens
> > > via netlink, not sysfs.
> > >
> > > Andrew
> >
> > Thanks. Sure, it makes sense to make the generic attribute configurable
> > through the netdevice ops or netlink implementation. I will keep that in
> > mind while adding the next set of configuration attributes for the driver.
> > These attributes(from the patch) however, are hardware specific(that show
> > the maximum supported values by the hardware in most cases).
>
> ndev->max_mtu = gc->adapter_mtu - ETH_HLEN;
> ndev->min_mtu = ETH_MIN_MTU;
>
> This does not appear to be specific to your device. This is very
> generic. We already have /sys/class/net/eth42/mtu, why not add
> /sys/class/net/eth42/max_mtu and /sys/class/net/eth42/min_mtu for
> every driver?
>
> Are these values really hardware specific? Are they really unique to
> your hardware? I have to wounder because you clearly did not think
> much about MTU, and how it is actually generic...
>
> Andrew
That makes sense. I will make these as generic attributes in the next version.
Thanks.