On Tue, 10 Nov 2026 15:07:21 +0100 Przemek Kitszel wrote:
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..