Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ice: report link down for VF when PF's queues are not enabled

This is port of a fix from i40e commit 2ad1274fa35a ("i40e: don't
report link up for a VF who hasn't enabled queues")

Older VF drivers do not respond well to receiving a link
up notification before queues are enabled. This can cause their state
machine to think that it is safe to send traffic. This results in a Tx
hang on the VF.

Record whether the PF has actually enabled queues for the VF. When
reporting link status, always report link down if the queues aren't
enabled. In this way, the VF driver will never receive a link up
notification until after its queues are enabled.

Signed-off-by: Lukasz Czapnik <lukasz.czapnik@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Lukasz Czapnik and committed by
Jeff Kirsher
c61d2342 29d42f1f

+4 -1
+4 -1
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
··· 129 129 pfe.event = VIRTCHNL_EVENT_LINK_CHANGE; 130 130 pfe.severity = PF_EVENT_SEVERITY_INFO; 131 131 132 - if (vf->link_forced) 132 + /* Always report link is down if the VF queues aren't enabled */ 133 + if (!vf->num_qs_ena) 134 + ice_set_pfe_link(vf, &pfe, ICE_AQ_LINK_SPEED_UNKNOWN, false); 135 + else if (vf->link_forced) 133 136 ice_set_pfe_link_forced(vf, &pfe, vf->link_up); 134 137 else 135 138 ice_set_pfe_link(vf, &pfe, ls->link_speed, ls->link_info &