OSDN Git Service

ice: Use capability count returned by the firmware
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Thu, 18 Oct 2018 15:37:06 +0000 (08:37 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 24 Oct 2018 21:00:05 +0000 (14:00 -0700)
The firmware now returns the capability count in the command buffer.
Use it.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_common.c

index c52f450..78df54b 100644 (file)
@@ -1531,9 +1531,7 @@ ice_aq_discover_caps(struct ice_hw *hw, void *buf, u16 buf_size, u32 *cap_count,
        if (!status)
                ice_parse_caps(hw, buf, le32_to_cpu(cmd->count), opc);
        else if (hw->adminq.sq_last_status == ICE_AQ_RC_ENOMEM)
-               *cap_count =
-                       DIV_ROUND_UP(le16_to_cpu(desc.datalen),
-                                    sizeof(struct ice_aqc_list_caps_elem));
+               *cap_count = le32_to_cpu(cmd->count);
        return status;
 }