Skip to content

Commit e0346f9

Browse files
atbrady-intelJeff Kirsher
authored andcommitted
i40evf: ignore link up if not running
If we receive the link status message from PF with link up before queues are actually enabled, it will trigger a TX hang. This fixes the issue by ignoring a link up message if the VF state is not yet in RUNNING state. Signed-off-by: Alan Brady <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 557450c commit e0346f9

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

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

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,23 +1001,34 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
10011001
if (v_opcode == VIRTCHNL_OP_EVENT) {
10021002
struct virtchnl_pf_event *vpe =
10031003
(struct virtchnl_pf_event *)msg;
1004+
bool link_up = vpe->event_data.link_event.link_status;
10041005
switch (vpe->event) {
10051006
case VIRTCHNL_EVENT_LINK_CHANGE:
10061007
adapter->link_speed =
10071008
vpe->event_data.link_event.link_speed;
1008-
if (adapter->link_up !=
1009-
vpe->event_data.link_event.link_status) {
1010-
adapter->link_up =
1011-
vpe->event_data.link_event.link_status;
1012-
if (adapter->link_up) {
1013-
netif_tx_start_all_queues(netdev);
1014-
netif_carrier_on(netdev);
1015-
} else {
1016-
netif_tx_stop_all_queues(netdev);
1017-
netif_carrier_off(netdev);
1018-
}
1019-
i40evf_print_link_message(adapter);
1009+
1010+
/* we've already got the right link status, bail */
1011+
if (adapter->link_up == link_up)
1012+
break;
1013+
1014+
/* If we get link up message and start queues before
1015+
* our queues are configured it will trigger a TX hang.
1016+
* In that case, just ignore the link status message,
1017+
* we'll get another one after we enable queues and
1018+
* actually prepared to send traffic.
1019+
*/
1020+
if (link_up && adapter->state != __I40EVF_RUNNING)
1021+
break;
1022+
1023+
adapter->link_up = link_up;
1024+
if (link_up) {
1025+
netif_tx_start_all_queues(netdev);
1026+
netif_carrier_on(netdev);
1027+
} else {
1028+
netif_tx_stop_all_queues(netdev);
1029+
netif_carrier_off(netdev);
10201030
}
1031+
i40evf_print_link_message(adapter);
10211032
break;
10221033
case VIRTCHNL_EVENT_RESET_IMPENDING:
10231034
dev_info(&adapter->pdev->dev, "PF reset warning received\n");

0 commit comments

Comments
 (0)