All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net v1] iavf: Fix RTNL deadlock with new flag IAVF_FLAG_REINIT_MSIX_NEEDED
@ 2021-09-01  9:15 Karen Sornek
  2021-11-04 20:49 ` Kuruvinakunnel, George
  0 siblings, 1 reply; 2+ messages in thread
From: Karen Sornek @ 2021-09-01  9:15 UTC (permalink / raw)
  To: intel-wired-lan

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.

Fixes: 129cf89e5856 ("iavf: rename functions and structs to new name")
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Karen Sornek <karen.sornek@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf.h      | 1 +
 drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf.h b/drivers/net/ethernet/intel/iavf/iavf.h
index 21c957755..5a36af8b9 100644
--- a/drivers/net/ethernet/intel/iavf/iavf.h
+++ b/drivers/net/ethernet/intel/iavf/iavf.h
@@ -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 */
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 80437ef26..4b7a670de 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -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;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Intel-wired-lan] [PATCH net v1] iavf: Fix RTNL deadlock with new flag IAVF_FLAG_REINIT_MSIX_NEEDED
  2021-09-01  9:15 [Intel-wired-lan] [PATCH net v1] iavf: Fix RTNL deadlock with new flag IAVF_FLAG_REINIT_MSIX_NEEDED Karen Sornek
@ 2021-11-04 20:49 ` Kuruvinakunnel, George
  0 siblings, 0 replies; 2+ messages in thread
From: Kuruvinakunnel, George @ 2021-11-04 20:49 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> 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 <mitch.a.williams@intel.com>; Sornek, Karen
> <karen.sornek@intel.com>
> Subject: [Intel-wired-lan] [PATCH net v1] 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.
> 
> Fixes: 129cf89e5856 ("iavf: rename functions and structs to new name")
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Signed-off-by: Karen Sornek <karen.sornek@intel.com>
> ---
>  drivers/net/ethernet/intel/iavf/iavf.h      | 1 +
>  drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 

Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-04 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  9:15 [Intel-wired-lan] [PATCH net v1] iavf: Fix RTNL deadlock with new flag IAVF_FLAG_REINIT_MSIX_NEEDED Karen Sornek
2021-11-04 20:49 ` Kuruvinakunnel, George

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.