ice: parameterize functions responsible for Tx ring management
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Thu, 20 May 2021 06:35:00 +0000 (08:35 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 9 Jun 2021 20:15:10 +0000 (13:15 -0700)
commit2e84f6b3773f43263124c76499c0c4ec3f40aa9b
tree8fd3ad4899994a37f948ea278257dd606dce5a56
parentebc5399ea1dfcddac31974091086a3379141899b
ice: parameterize functions responsible for Tx ring management

Commit ae15e0ba1b33 ("ice: Change number of XDP Tx queues to match
number of Rx queues") tried to address the incorrect setting of XDP
queue count that was based on the Tx queue count, whereas in theory we
should provide the XDP queue per Rx queue. However, the routines that
setup and destroy the set of Tx resources are still based on the
vsi->num_txq.

Ice supports the asynchronous Tx/Rx queue count, so for a setup where
vsi->num_txq > vsi->num_rxq, ice_vsi_stop_tx_rings and ice_vsi_cfg_txqs
will be accessing the vsi->xdp_rings out of the bounds.

Parameterize two mentioned functions so they get the size of Tx resources
array as the input.

Fixes: ae15e0ba1b33 ("ice: Change number of XDP Tx queues to match number of Rx queues")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Kiran Bhandare <kiranx.bhandare@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_lib.c