Fixes for races between reset, remove and close in idpf, and a libie
transaction manager issue they depend on.

Patch 1 lets a reset racing with remove tear NAPI down in
idpf_detach_and_close() by dropping the IDPF_REMOVE_IN_PROG early return
from idpf_stop(), and tests IDPF_VPORT_UP under RTNL. Seen in testing,
trace in the commit message.

Patch 2 skips empty netdev slots in idpf_detach_and_close(). Reproduced
on a reset with FW reporting more max vports than default vports.

Patch 3 makes libie_ctlq_xn_shutdown() release all concurrent waiters.
Not reachable in idpf today, patch 4 adds a concurrent caller.

Patch 4 keeps the mailbox up for driver initiated resets, so the vports
are disabled before their memory is freed, with the transactions bounded
as on shutdown [1].

Testing: Patches 1 and 2 reproduced as described, patch 3 has no
reproducer, patch 4 was tested with a script stressing resets in the
middle of ethtool and ifup/down callbacks.

Changes in v2:
- Patch 1: test IDPF_VPORT_UP under RTNL and assert it is held. Dropped
  the Reviewed-by tags due to the change.
- Patches 2-4: new, found while addressing the review of v1.

v1: 
https://lore.kernel.org/all/[email protected]/
[1] 
https://lore.kernel.org/netdev/[email protected]/

Emil Tantilov (4):
  idpf: fix possible race on remove during a reset
  idpf: skip empty netdev slots when detaching for a reset
  libie: release all waiters once the transaction manager drains
  idpf: keep the mailbox alive for driver initiated resets

 drivers/net/ethernet/intel/idpf/idpf.h        |  5 +-
 drivers/net/ethernet/intel/idpf/idpf_lib.c    | 58 +++++++++++--------
 drivers/net/ethernet/intel/idpf/idpf_main.c   |  4 ++
 .../net/ethernet/intel/idpf/idpf_virtchnl.c   | 15 +++--
 drivers/net/ethernet/intel/libie/controlq.c   | 19 +++---
 5 files changed, 62 insertions(+), 39 deletions(-)

-- 
2.37.3

Reply via email to