Re: [PATCH net-next] net: dsa: loop: Fix devlink resource ID

From: David Yang

Date: Wed Jun 10 2026 - 09:45:33 EST


On Wed, Jun 10, 2026 at 3:23 PM Andrew Lunn <andrew@xxxxxxx> wrote:
>
> On Wed, Jun 10, 2026 at 02:25:45PM +0800, David Yang wrote:
> > Fix collision with DEVLINK_RESOURCE_ID_PARENT_TOP (0) by keeping the
> > real resource IDs in enum dsa_loop_devlink_resource_id starting at 1.
>
> Please could you expand on this. What is actually wrong here?
>
> When i look at mv88e6xxx, hellcreak and b53 it does the same.
>
> Andrew

dsa_devlink_resource_register() is, but other users of
devl_resource_register() (mlxsw and netdevsim) avoid 0 explicitly.

In this case for dsa_loop, the usage is semantically questionable (0
being its own parent) but might just work as well. But it is a real
problem on mv88e6xxx, where ATU_bin_* are in fact registered as
top-level siblings, not as children of ATU, due to ATU ID colliding
with PARENT_TOP.