Skip to content

Commit 5dbbbd0

Browse files
dmertmananguy11
authored andcommitted
ice: Avoid RTNL lock when re-creating auxiliary device
If a call to re-create the auxiliary device happens in a context that has already taken the RTNL lock, then the call flow that recreates auxiliary device can hang if there is another attempt to claim the RTNL lock by the auxiliary driver. To avoid this, any call to re-create auxiliary devices that comes from an source that is holding the RTNL lock (e.g. netdev notifier when interface exits a bond) should execute in a separate thread. To accomplish this, add a flag to the PF that will be evaluated in the service task and dealt with there. Fixes: f9f5301 ("ice: Register auxiliary device to provide RDMA") Signed-off-by: Dave Ertman <[email protected]> Reviewed-by: Jonathan Toppins <[email protected]> Tested-by: Gurucharan G <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent bea1898 commit 5dbbbd0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ enum ice_pf_flags {
483483
ICE_FLAG_VF_TRUE_PROMISC_ENA,
484484
ICE_FLAG_MDD_AUTO_RESET_VF,
485485
ICE_FLAG_LINK_LENIENT_MODE_ENA,
486+
ICE_FLAG_PLUG_AUX_DEV,
486487
ICE_PF_FLAGS_NBITS /* must be last */
487488
};
488489

@@ -887,7 +888,7 @@ static inline void ice_set_rdma_cap(struct ice_pf *pf)
887888
if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) {
888889
set_bit(ICE_FLAG_RDMA_ENA, pf->flags);
889890
set_bit(ICE_FLAG_AUX_ENA, pf->flags);
890-
ice_plug_aux_dev(pf);
891+
set_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags);
891892
}
892893
}
893894

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,6 +2253,9 @@ static void ice_service_task(struct work_struct *work)
22532253
return;
22542254
}
22552255

2256+
if (test_and_clear_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags))
2257+
ice_plug_aux_dev(pf);
2258+
22562259
ice_clean_adminq_subtask(pf);
22572260
ice_check_media_subtask(pf);
22582261
ice_check_for_hang_subtask(pf);

0 commit comments

Comments
 (0)