• Magnus Karlsson's avatar
    ice: fix napi work done reporting in xsk path · ed0907e3
    Magnus Karlsson authored
    Fix the wrong napi work done reporting in the xsk path of the ice
    driver. The code in the main Rx processing loop was written to assume
    that the buffer allocation code returns true if all allocations where
    successful and false if not. In contrast with all other Intel NIC xsk
    drivers, the ice_alloc_rx_bufs_zc() has the inverted logic messing up
    the work done reporting in the napi loop.
    
    This can be fixed either by inverting the return value from
    ice_alloc_rx_bufs_zc() in the function that uses this in an incorrect
    way, or by changing the return value of ice_alloc_rx_bufs_zc(). We
    chose the latter as it makes all the xsk allocation functions for
    Intel NICs behave in the same way. My guess is that it was this
    unexpected discrepancy that gave rise to this bug in the first place.
    
    Fixes: 5bb0c4b5 ("ice, xsk: Move Rx allocation out of while-loop")
    Reported-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
    Signed-off-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
    Tested-by: default avatarKiran Bhandare <kiranx.bhandare@intel.com>
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    ed0907e3
ice_xsk.c 19.9 KB