Re: [PATCH net-next 08/14] devlink: Allow rate node parents from other devlinks
From: Jiri Pirko
Date: Thu Nov 20 2025 - 09:55:50 EST
Thu, Nov 20, 2025 at 02:09:20PM +0100, tariqt@xxxxxxxxxx wrote:
>From: Cosmin Ratiu <cratiu@xxxxxxxxxx>
>
>This commit makes use of the building blocks previously added to
>implement cross-device rate nodes.
>
>A new 'supported_cross_device_rate_nodes' bool is added to devlink_ops
>which lets drivers advertise support for cross-device rate objects.
>If enabled and if there is a common shared devlink instance, then:
>- all rate objects will be stored in the top-most common nested instance
> and
>- rate objects can have parents from other devices sharing the same
> common instance.
>
>The parent devlink from info->user_ptr[1] is not locked, so none of its
>mutable fields can be used. But parent setting only requires comparing
>devlink pointer comparisons. Additionally, since the shared devlink is
>locked, other rate operations cannot concurrently happen.
>
>The rate lock/unlock functions are now exported, so that drivers
>implementing this can protect against concurrent modifications on any
>shared device structures.
>
>Signed-off-by: Cosmin Ratiu <cratiu@xxxxxxxxxx>
>Reviewed-by: Carolina Jubran <cjubran@xxxxxxxxxx>
>Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx>
Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>