Re: [PATCH net-next v5 12/15] devlink: give user option to allocate resources

From
Przemek Kitszel <przemyslaw.kitszel@intel.com>
Date
2026-11-19 14:03:00
Reply to
Jakub Kicinski, 2026-11-19
On 11/19/26 2:00 AM, Jakub Kicinski wrote:
On Tue, 10 Nov 2026 15:07:21 +0100 Przemek Kitszel wrote:
quoted
Current devlink resources are designed as a thing that user could limit,
but there is not much otherwise that could be done with them.
Perhaps that's the reason there is not much adoption despite API being
there for multiple years.

Add new mode of operation, where user could allocate/assign resources
(from a common pool) to specific devices.

That requires a new .occ_set() driver callback, called on
DEVLINK_CMD_RESOURCE_SET with the requested DEVLINK_ATTR_RESOURCE_SIZE,
instead of staging the size until the next reload. Driver registers it
together with .occ_get() by devl_resource_occ_set_get_register(). For
such resources the getter value is reported as DEVLINK_ATTR_RESOURCE_SIZE,
as opposed to DEVLINK_ATTR_RESOURCE_OCC (current occupation) in the
"legacy" mode, and there is no DEVLINK_ATTR_RESOURCE_SIZE_NEW.
I haven't read the driver code but I wonder why you're making such
changes. It seems like you want something like param cmode - your
size change is applied at runtime which existing size_new stuff
is built to require driver_init. Why not add cmode to the resource
to express when change will be applied?

Why you're messing with "occ" I don't get at all. occ(upancy) is
current use. See comments on the driver patch as well..

Good idea, resource with cmode=runtime matches what I need. As far as I
can tell now, swapping my occ_set for it does not turn the series upside
down: the driver still applies the change synchronously and can fail it,
size becomes the value set by the user, and occ goes back to the current
use.
Thread (38 messages) 38 messages, 6 authors, last reply 3h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help