Re: [PATCH net-next V4 06/14] devlink: Add parent dev to devlink API
From: Simon Horman
Date: Thu Nov 27 2025 - 10:28:13 EST
On Tue, Nov 25, 2025 at 10:06:05PM +0200, Tariq Toukan wrote:
> From: Cosmin Ratiu <cratiu@xxxxxxxxxx>
>
> Upcoming changes to the rate commands need the parent devlink specified.
> This change adds a nested 'parent-dev' attribute to the API and helpers
> to obtain and put a reference to the parent devlink instance in
> info->user_ptr[1].
>
> To avoid deadlocks, the parent devlink is unlocked before obtaining the
> main devlink instance that is the target of the request.
> A reference to the parent is kept until the end of the request to avoid
> it suddenly disappearing.
>
> This means that this reference is of limited use without additional
> protection.
>
> Signed-off-by: Cosmin Ratiu <cratiu@xxxxxxxxxx>
> Reviewed-by: Carolina Jubran <cjubran@xxxxxxxxxx>
> Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>
> Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx>
> ---
> Documentation/netlink/specs/devlink.yaml | 11 ++++
> include/uapi/linux/devlink.h | 2 +
> net/devlink/devl_internal.h | 2 +
> net/devlink/netlink.c | 67 ++++++++++++++++++++++--
> net/devlink/netlink_gen.c | 5 ++
> net/devlink/netlink_gen.h | 8 +++
Hi,
I think that the updates to netlink_gen.[ch] belong in
the following patch rather than this one.
You can observe this using
tools/net/ynl/ynl-regen.sh -f && git diff