ice: Rework ice_ena_msix_range
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Fri, 2 Aug 2019 08:25:23 +0000 (01:25 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 27 Aug 2019 06:52:29 +0000 (23:52 -0700)
commit152b978a1f904f252ae3df548bc2e183e7368c6d
tree69e6533a5a82ba7bf7ca00ad0c27872468be3480
parentcb6a8dc07827086a7ce4151c62367d959c6ad5f1
ice: Rework ice_ena_msix_range

The current implementation of ice_ena_msix_range is difficult to read
and has subtle issues. This patch reworks the said function for
clarity and correctness.

More specifically,

1. Add more checks to bail out of 'needed' is greater than 'v_left'.

2. Simplify fallback logic

3. Do not set pf->num_avail_sw_msix in ice_ena_msix_range as it
   gets overwritten by ice_init_interrupt_scheme.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@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_main.c