]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ice: add extack when unable to read device caps
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 6 May 2021 15:39:57 +0000 (08:39 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 7 Jun 2021 15:59:01 +0000 (08:59 -0700)
When filling out information for the DEVLINK_CMD_INFO_GET, the driver
needs to read some device capabilities. Add an extack message to
properly inform the caller of the failure, as we do for other failures
in this function.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_devlink.c

index cf685eeea198e440fbf162cd8fc924a4cdcb445a..2923591d01ea5ebc1e5b69a0e2b3d56b605b88ba 100644 (file)
@@ -283,6 +283,9 @@ static int ice_devlink_info_get(struct devlink *devlink,
        /* discover capabilities first */
        status = ice_discover_dev_caps(hw, &ctx->dev_caps);
        if (status) {
+               dev_dbg(dev, "Failed to discover device capabilities, status %s aq_err %s\n",
+                       ice_stat_str(status), ice_aq_str(hw->adminq.sq_last_status));
+               NL_SET_ERR_MSG_MOD(extack, "Unable to discover device capabilities");
                err = -EIO;
                goto out_free_ctx;
        }