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 <alan.brady@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
557450c301
commit
e0346f9fcb
@ -1001,15 +1001,27 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
|
|||||||
if (v_opcode == VIRTCHNL_OP_EVENT) {
|
if (v_opcode == VIRTCHNL_OP_EVENT) {
|
||||||
struct virtchnl_pf_event *vpe =
|
struct virtchnl_pf_event *vpe =
|
||||||
(struct virtchnl_pf_event *)msg;
|
(struct virtchnl_pf_event *)msg;
|
||||||
|
bool link_up = vpe->event_data.link_event.link_status;
|
||||||
switch (vpe->event) {
|
switch (vpe->event) {
|
||||||
case VIRTCHNL_EVENT_LINK_CHANGE:
|
case VIRTCHNL_EVENT_LINK_CHANGE:
|
||||||
adapter->link_speed =
|
adapter->link_speed =
|
||||||
vpe->event_data.link_event.link_speed;
|
vpe->event_data.link_event.link_speed;
|
||||||
if (adapter->link_up !=
|
|
||||||
vpe->event_data.link_event.link_status) {
|
/* we've already got the right link status, bail */
|
||||||
adapter->link_up =
|
if (adapter->link_up == link_up)
|
||||||
vpe->event_data.link_event.link_status;
|
break;
|
||||||
if (adapter->link_up) {
|
|
||||||
|
/* If we get link up message and start queues before
|
||||||
|
* our queues are configured it will trigger a TX hang.
|
||||||
|
* In that case, just ignore the link status message,
|
||||||
|
* we'll get another one after we enable queues and
|
||||||
|
* actually prepared to send traffic.
|
||||||
|
*/
|
||||||
|
if (link_up && adapter->state != __I40EVF_RUNNING)
|
||||||
|
break;
|
||||||
|
|
||||||
|
adapter->link_up = link_up;
|
||||||
|
if (link_up) {
|
||||||
netif_tx_start_all_queues(netdev);
|
netif_tx_start_all_queues(netdev);
|
||||||
netif_carrier_on(netdev);
|
netif_carrier_on(netdev);
|
||||||
} else {
|
} else {
|
||||||
@ -1017,7 +1029,6 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
|
|||||||
netif_carrier_off(netdev);
|
netif_carrier_off(netdev);
|
||||||
}
|
}
|
||||||
i40evf_print_link_message(adapter);
|
i40evf_print_link_message(adapter);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case VIRTCHNL_EVENT_RESET_IMPENDING:
|
case VIRTCHNL_EVENT_RESET_IMPENDING:
|
||||||
dev_info(&adapter->pdev->dev, "PF reset warning received\n");
|
dev_info(&adapter->pdev->dev, "PF reset warning received\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user