]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
devlink: fix parallel flash notifications processing
authorJiri Pirko <jiri@nvidia.com>
Thu, 25 Aug 2022 08:04:20 +0000 (10:04 +0200)
committerDavid Ahern <dsahern@kernel.org>
Thu, 1 Sep 2022 02:37:29 +0000 (20:37 -0600)
Now that it is possible to flash multiple devlink instances in parallel,
the notification processing callback needs to count in the fact that it
receives message that belongs to different devlink instance. So handle
the it gracefully and don't error out.

Reported-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
devlink/devlink.c

index b2439aef4d10f1cbf406e1f4d3ae09e12df49d24..4f77e42f2d4808fe9d5fa680c5558d3dc9902a60 100644 (file)
@@ -3812,12 +3812,12 @@ static int cmd_dev_flash_status_cb(const struct nlmsghdr *nlh, void *data)
 
        mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
        if (!tb[DEVLINK_ATTR_BUS_NAME] || !tb[DEVLINK_ATTR_DEV_NAME])
-               return MNL_CB_ERROR;
+               return MNL_CB_STOP;
        bus_name = mnl_attr_get_str(tb[DEVLINK_ATTR_BUS_NAME]);
        dev_name = mnl_attr_get_str(tb[DEVLINK_ATTR_DEV_NAME]);
        if (strcmp(bus_name, opts->bus_name) ||
            strcmp(dev_name, opts->dev_name))
-               return MNL_CB_ERROR;
+               return MNL_CB_STOP;
 
        if (genl->cmd == DEVLINK_CMD_FLASH_UPDATE_END) {
                pr_out("\n");