iavf: Fix not to overload flags
Subsystems (2)
PATCH 1/1 iavf: Fix not to overload flags
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 with a new name 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
PATCH 1/1 iavf: Fix not to overload flags
Dear Karen,
Am 01.09.21 um 10:27 schrieb Karen Sornek:
Quoted 9 lines
The
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 with a new name and use that to trigger MSI-X reinit.
Please mention the macro name in the commit message.
For the summary, please use a statement (with a verb in imperative mood). Maybe:
iavf: Fix RTNL deadlock with new flag IAVF_FLAG_REINIT_MSIX_NEEDED
Quoted 26 lines
Fixes 5b36e8d04b44 ("i40evf: Enable VF to request an alternate queue allocation")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(-)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 +0
-0
drivers/net/ethernet/intel/iavf/iavf_main.c int iavf_process_config(struct iavf_adapter *adapter) · line 3562
Quoted 8 lines
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 ;
The diff looks good to me.
Kind regards,
Paul