ice: unify xdp_rings accesses
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Thu, 19 Aug 2021 11:59:59 +0000 (13:59 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 15 Oct 2021 14:39:02 +0000 (07:39 -0700)
commit0bb4f9ecadd463db28d8b1820bb1bcb96af009d2
treec41862877d8070fdb01ad81a7ee42854fce322ad
parente72bba21355dbb67512a0d666fec9f4b56dbfc2f
ice: unify xdp_rings accesses

There has been a long lasting issue of improper xdp_rings indexing for
XDP_TX and XDP_REDIRECT actions. Given that currently rx_ring->q_index
is mixed with smp_processor_id(), there could be a situation where Tx
descriptors are produced onto XDP Tx ring, but tail is never bumped -
for example pin a particular queue id to non-matching IRQ line.

Address this problem by ignoring the user ring count setting and always
initialize the xdp_rings array to be of num_possible_cpus() size. Then,
always use the smp_processor_id() as an index to xdp_rings array. This
provides serialization as at given time only a single softirq can run on
a particular CPU.

Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_main.c
drivers/net/ethernet/intel/ice/ice_txrx_lib.c