Thread (2 messages) flat view 2 messages, 2 authors, 2021-03-11

RE: [Intel-wired-lan] [PATCH intel-net] ice: fix napi work done reporting in xsk path

From: Bhandare, KiranX <hidden>
Date: 2021-03-11 12:07:37
Also in: intel-wired-lan

-----Original Message-----
From: Intel-wired-lan <redacted> On Behalf Of
Magnus Karlsson
Sent: Friday, February 5, 2021 2:39 PM
To: Karlsson, Magnus <magnus.karlsson@intel.com>; Topel, Bjorn
[off-list ref]; intel-wired-lan@lists.osuosl.org; Nguyen, Anthony
L [off-list ref]; Fijalkowski, Maciej
[off-list ref]; maciejromanfijalkowski@gmail.com
Cc: netdev@vger.kernel.org
Subject: [Intel-wired-lan] [PATCH intel-net] ice: fix napi work done reporting
in xsk path

From: Magnus Karlsson <magnus.karlsson@intel.com>

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: 5bb0c4b5eb61 ("ice, xsk: Move Rx allocation out of while-loop")
Reported-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_base.c |  6 ++++--
drivers/net/ethernet/intel/ice/ice_xsk.c  | 10 +++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)
Tested-by: Kiran Bhandare <redacted>  A Contingent Worker at Intel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help