ixgbe: dcb: IEEE PFC stats and reset logic incorrect
PFC stats are only tabulated when PFC is enabled. However in IEEE mode the ieee_pfc pfc_tc bits were not checked and the calculation was aborted. This results in statistics not being reported through ethtool and possible a false Tx hang occurring when receiving pause frames. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
a61d3d1422
commit
e1abc1bb85
|
@ -662,6 +662,13 @@ static int ixgbe_dcbnl_ieee_setpfc(struct net_device *dev,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pfc->pfc_en) {
|
||||||
|
adapter->last_lfc_mode = adapter->hw.fc.current_mode;
|
||||||
|
adapter->hw.fc.current_mode = ixgbe_fc_pfc;
|
||||||
|
} else {
|
||||||
|
adapter->hw.fc.current_mode = adapter->last_lfc_mode;
|
||||||
|
}
|
||||||
|
|
||||||
prio_tc = adapter->ixgbe_ieee_ets->prio_tc;
|
prio_tc = adapter->ixgbe_ieee_ets->prio_tc;
|
||||||
memcpy(adapter->ixgbe_ieee_pfc, pfc, sizeof(*adapter->ixgbe_ieee_pfc));
|
memcpy(adapter->ixgbe_ieee_pfc, pfc, sizeof(*adapter->ixgbe_ieee_pfc));
|
||||||
return ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc->pfc_en, prio_tc);
|
return ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc->pfc_en, prio_tc);
|
||||||
|
|
|
@ -637,7 +637,11 @@ static void ixgbe_update_xoff_received(struct ixgbe_adapter *adapter)
|
||||||
clear_bit(__IXGBE_HANG_CHECK_ARMED,
|
clear_bit(__IXGBE_HANG_CHECK_ARMED,
|
||||||
&adapter->tx_ring[i]->state);
|
&adapter->tx_ring[i]->state);
|
||||||
return;
|
return;
|
||||||
} else if (!(adapter->dcb_cfg.pfc_mode_enable))
|
} else if (((adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE) &&
|
||||||
|
!(adapter->dcb_cfg.pfc_mode_enable)) ||
|
||||||
|
((adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) &&
|
||||||
|
adapter->ixgbe_ieee_pfc &&
|
||||||
|
!(adapter->ixgbe_ieee_pfc->pfc_en)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* update stats for each tc, only valid with PFC enabled */
|
/* update stats for each tc, only valid with PFC enabled */
|
||||||
|
|
Loading…
Reference in New Issue