linux/drivers/net/ethernet/intel
Jacob Keller 1082b360e3 ice: refactor ice_discover_caps to avoid need to retry
The ice_discover_caps function is used to read the device and function
capabilities, updating the hardware capabilities structures with
relevant data.

The exact number of capabilities returned by the hardware is unknown
ahead of time. The AdminQ command will report the total number of
capabilities in the return buffer.

The current implementation involves requesting capabilities once,
reading this returned size, and then re-requested with that size.

This isn't really necessary. The firmware interface has a maximum size
of ICE_AQ_MAX_BUF_LEN. Firmware can never return more than
ICE_AQ_MAX_BUF_LEN / sizeof(struct ice_aqc_list_caps_elem) capabilities.

Avoid the retry loop by simply allocating a buffer of size
ICE_AQ_MAX_BUF_LEN. This is significantly simpler than retrying. The
extra allocation isn't a big deal, as it will be released after we
finish parsing the capabilities.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2020-07-23 14:16:02 -07:00
..
e1000 ethernet/intel: Convert fallthrough code comments 2020-07-01 13:47:43 -07:00
e1000e ethernet/intel: Convert fallthrough code comments 2020-07-01 13:47:43 -07:00
fm10k fm10k: convert to new udp_tunnel_nic infra 2020-07-14 17:04:27 -07:00
i40e i40e: introduce new dump desc XDP command 2020-07-01 14:44:17 -07:00
iavf iavf: Fix updating statistics 2020-07-01 14:45:59 -07:00
ice ice: refactor ice_discover_caps to avoid need to retry 2020-07-23 14:16:02 -07:00
igb ethernet/intel: Convert fallthrough code comments 2020-07-01 13:47:43 -07:00
igbvf ethernet/intel: Convert fallthrough code comments 2020-07-01 13:47:43 -07:00
igc ethernet/intel: Convert fallthrough code comments 2020-07-01 13:47:43 -07:00
ixgb net/intel: remove driver versions from Intel drivers 2020-06-25 22:25:13 -07:00
ixgbe ixgbe: convert to new udp_tunnel_nic infra 2020-07-10 13:54:00 -07:00
ixgbevf ethernet/intel: Convert fallthrough code comments 2020-07-01 13:47:43 -07:00
e100.c net/intel: remove driver versions from Intel drivers 2020-06-25 22:25:13 -07:00
Kconfig docs: networking: reorganize driver documentation again 2020-06-26 16:08:44 -07:00
Makefile