Subject: Re: [PATCH RFC v2 net-next 1/2] devlink: Add shared descriptor eswitch attr

From: Jakub Kicinski <[email-masked]>
Date: Tue, 5 Mar 2024 18:30:49 -0800

On Tue, 5 Mar 2024 16:27:50 -0800 William Tu wrote:
> > Can we use bytes as the unit? Like the page pool. Descriptors don't
> > mean much to the user.  
> But how about the unit size? do we assume unit size = 1 page?
> so page pool has
> order: 2^order pages on allocation
> pool_size: size of ptr_ring
> 
> How about we assume that order is 0, and let user set pool_size (number 
> of page-size entries).

Do you mean because the user doesn't know the granularity,
e.g. we can't allocate 12345 bytes most likely?

For shared buffer (the switch buffer configuration API)
we report cell size IIRC. In ethtool a lot of drivers just
round up to whatever they support. We could also treat 
the user-configured value as "upper bound" and effectively
round down but keep what the user configured exactly, when
they read back. I like the last one the most, if it makes sense.

> > Do we need this knob?
> > Can we not assume that shared-pool-count == 0 means disabled?  
> do you mean assume or not assume?

Sorry for the double negation (:

> I guess you mean assume, so use "shared-pool-count == 0" to indicate 
> disable?
> That will also work so we only need to introduce 1 attribute.

SG!