Skip to content

Commit 836ce5e

Browse files
Avinash DayanandJeff Kirsher
authored andcommitted
i40evf: Fix link up issue when queues are disabled
One of the previous patch fixes the link up issue by ignoring it if i40evf is not in __I40EVF_RUNNING state. However this doesn't fix the race condition when queues are disabled esp for ADq on VF. Hence check if all queues are enabled before starting all queues. Signed-off-by: Avinash Dayanand <avinash.dayanand@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 1d63158 commit 836ce5e

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

drivers/net/ethernet/intel/i40evf/i40evf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ struct i40evf_adapter {
240240
#define I40EVF_FLAG_ALLMULTI_ON BIT(14)
241241
#define I40EVF_FLAG_LEGACY_RX BIT(15)
242242
#define I40EVF_FLAG_REINIT_ITR_NEEDED BIT(16)
243+
#define I40EVF_FLAG_QUEUES_DISABLED BIT(17)
243244
/* duplicates for common code */
244245
#define I40E_FLAG_DCB_ENABLED 0
245246
#define I40E_FLAG_RX_CSUM_ENABLED I40EVF_FLAG_RX_CSUM_ENABLED

drivers/net/ethernet/intel/i40evf/i40evf_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,7 @@ static void i40evf_reset_task(struct work_struct *work)
19131913
i40evf_free_all_rx_resources(adapter);
19141914
i40evf_free_all_tx_resources(adapter);
19151915

1916+
adapter->flags |= I40EVF_FLAG_QUEUES_DISABLED;
19161917
/* kill and reinit the admin queue */
19171918
i40evf_shutdown_adminq(hw);
19181919
adapter->current_op = VIRTCHNL_OP_UNKNOWN;

drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,14 +1017,25 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
10171017
if (adapter->link_up == link_up)
10181018
break;
10191019

1020-
/* If we get link up message and start queues before
1021-
* our queues are configured it will trigger a TX hang.
1022-
* In that case, just ignore the link status message,
1023-
* we'll get another one after we enable queues and
1024-
* actually prepared to send traffic.
1025-
*/
1026-
if (link_up && adapter->state != __I40EVF_RUNNING)
1027-
break;
1020+
if (link_up) {
1021+
/* If we get link up message and start queues
1022+
* before our queues are configured it will
1023+
* trigger a TX hang. In that case, just ignore
1024+
* the link status message,we'll get another one
1025+
* after we enable queues and actually prepared
1026+
* to send traffic.
1027+
*/
1028+
if (adapter->state != __I40EVF_RUNNING)
1029+
break;
1030+
1031+
/* For ADq enabled VF, we reconfigure VSIs and
1032+
* re-allocate queues. Hence wait till all
1033+
* queues are enabled.
1034+
*/
1035+
if (adapter->flags &
1036+
I40EVF_FLAG_QUEUES_DISABLED)
1037+
break;
1038+
}
10281039

10291040
adapter->link_up = link_up;
10301041
if (link_up) {
@@ -1108,6 +1119,7 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
11081119
case VIRTCHNL_OP_ENABLE_QUEUES:
11091120
/* enable transmits */
11101121
i40evf_irq_enable(adapter, true);
1122+
adapter->flags &= ~I40EVF_FLAG_QUEUES_DISABLED;
11111123
break;
11121124
case VIRTCHNL_OP_DISABLE_QUEUES:
11131125
i40evf_free_all_tx_resources(adapter);

0 commit comments

Comments
 (0)