Subject: Re: [PATCH net-next 05/10] devlink: support index-based lookup via bus_name/dev_name handle

From: Jakub Kicinski <[email-masked]>
Date: Tue, 24 Feb 2026 18:22:01 -0800

On Mon, 23 Feb 2026 15:55:52 +0100 Jiri Pirko wrote:
> Devlink instances without a backing device use bus_name
> "devlink_index" and dev_name set to the decimal index string.
> When user space sends this handle, detect the pattern and perform
> a direct xarray lookup by index instead of iterating all instances.

Transient build breakage here. I'll also send out what the AI found for
your consideration. I haven't looked if the complaints are valid but
hopefully that'll let us avoid a repost.

../net/devlink/netlink.c:203:23: error: use of undeclared identifier 'DEVLINK_INDEX_BUS_NAME'; did you mean 'DEVLINK_ATTR_BUS_NAME'?
  203 |         if (!strcmp(busname, DEVLINK_INDEX_BUS_NAME)) {
      |                              ^~~~~~~~~~~~~~~~~~~~~~
      |                              DEVLINK_ATTR_BUS_NAME
../include/uapi/linux/devlink.h:414:2: note: 'DEVLINK_ATTR_BUS_NAME' declared here
  414 |         DEVLINK_ATTR_BUS_NAME,                  /* string */
      |         ^
../net/devlink/netlink.c:203:23: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
  203 |         if (!strcmp(busname, DEVLINK_INDEX_BUS_NAME)) {
      |                              ^~~~~~~~~~~~~~~~~~~~~~
../include/linux/string.h:161:44: note: passing argument to parameter here
  161 | extern int strcmp(const char *,const char *);
      |                                            ^
-- 
pw-bot: cr