Commit ce317dd9 authored by Anirudh Venkataramanan's avatar Anirudh Venkataramanan Committed by Jeff Kirsher
Browse files

ice: Set carrier state and start/stop queues in rebuild



Set the carrier state post rebuild by querying the link status. Also
start/stop queues based on link status.

Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 042cb564
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -3296,7 +3296,7 @@ static void ice_rebuild(struct ice_pf *pf)
	struct device *dev = &pf->pdev->dev;
	struct ice_hw *hw = &pf->hw;
	enum ice_status ret;
	int err;
	int err, i;

	if (test_bit(__ICE_DOWN, pf->state))
		goto clear_recovery;
@@ -3370,6 +3370,22 @@ static void ice_rebuild(struct ice_pf *pf)
	}

	ice_reset_all_vfs(pf, true);

	for (i = 0; i < pf->num_alloc_vsi; i++) {
		bool link_up;

		if (!pf->vsi[i] || pf->vsi[i]->type != ICE_VSI_PF)
			continue;
		ice_get_link_status(pf->vsi[i]->port_info, &link_up);
		if (link_up) {
			netif_carrier_on(pf->vsi[i]->netdev);
			netif_tx_wake_all_queues(pf->vsi[i]->netdev);
		} else {
			netif_carrier_off(pf->vsi[i]->netdev);
			netif_tx_stop_all_queues(pf->vsi[i]->netdev);
		}
	}

	/* if we get here, reset flow is successful */
	clear_bit(__ICE_RESET_FAILED, pf->state);
	return;