iavf: Fix RTNL deadlock with new flag IAVF_FLAG_REINIT_MSIX_NEEDED
Subsystems (2)
PATCH 1/1 iavf: Fix RTNL deadlock with new flag IAVF_FLAG_REINIT_MSIX_NEEDED
The IAVF_FLAG_REINIT_ITR_NEEDED flag was being used for two different purposes. As originally written, it indicates to the ITR mechanism to update the interrupt registers to a new setting. Sometime later, it was overloaded to indicate that interrupts need to be completely reinitialized during reset. This causes problems when ethtool -C is used while a reset is in progress, and can lead to RTNL deadlocks.
To fix this, add a new flag IAVF_FLAG_REINIT_MSIX_NEEDED and use that to trigger MSI-X reinit.
--- drivers/net/ethernet/intel/iavf/iavf.h | 1 + drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf.h +1 -0
@@ -272,6 +272,7 @@ struct iavf_adapter {#define IAVF_FLAG_LEGACY_RX BIT(15)#define IAVF_FLAG_REINIT_ITR_NEEDED BIT(16)#define IAVF_FLAG_QUEUES_DISABLED BIT(17) +#define IAVF_FLAG_REINIT_MSIX_NEEDED BIT(20)/* duplicates for common code */ #define IAVF_FLAG_DCB_ENABLED 0/* flags for admin queue service task */
drivers/net/ethernet/intel/iavf/iavf_main.c +1 -1
@@ -3556,7 +3556,7 @@ int iavf_process_config(struct iavf_adapter *adapter)"Requested %d queues, but PF only gave us %d.\n" , num_req_queues, adapter->vsi_res->num_queue_pairs); - adapter->flags |=IAVF_FLAG_REINIT_ITR_NEEDED ; + adapter->flags |=IAVF_FLAG_REINIT_MSIX_NEEDED ; adapter->num_req_queues = adapter->vsi_res->num_queue_pairs;iavf_schedule_reset (adapter);return -ENODEV ;
Signature · 1 line
2.27.0
Kuruvinakunnel
PATCH 1/1 iavf: Fix RTNL deadlock with new flag IAVF_FLAG_REINIT_MSIX_NEEDED
Quoted 20 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Karen Sornek
Sent: Wednesday, September 1, 2021 2:15 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Williams, Mitch A <[email protected]>; Sornek, Karen <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1] iavf: Fix RTNL deadlock with new flagIAVF_FLAG_REINIT_MSIX_NEEDEDThe
IAVF_FLAG_REINIT_ITR_NEEDEDflag was being used for two different purposes. As originally written, it indicates to the ITR mechanism to update the interrupt registers to a new setting. Sometime later, it was overloaded to indicate that interrupts need to be completely reinitialized during reset. This causes problems when ethtool -C is used while a reset is in progress, and can lead to RTNL deadlocks.To fix this, add a new flag
IAVF_FLAG_REINIT_MSIX_NEEDEDand use that to trigger MSI-X reinit.
Quoted 8 lines
Fixes 129cf89e5856 ("iavf: rename functions and structs to new name")Signed-off-by Mitch Williams <[email protected]>Signed-off-by Karen Sornek <[email protected]>--- drivers/net/ethernet/intel/iavf/iavf.h | 1 + drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)