Commit f21fa060 authored by Dmitrii Golovanov's avatar Dmitrii Golovanov Committed by Jeff Kirsher

i40e: fix incorrect ethtool statistics veb and veb.tc_

This patch fixes missing call of i40e_update_veb_stats() in function
i40e_get_ethtool_stats() to update stats data of VEB and VEB TC
counters before they are written into ethtool buffer.
Before the patch ethtool counters may fell behind interface counters.
Signed-off-by: default avatarDmitrii Golovanov <dmitrii.golovanov@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent a9e21bea
...@@ -1021,6 +1021,7 @@ i40e_find_vsi_by_type(struct i40e_pf *pf, u16 type) ...@@ -1021,6 +1021,7 @@ i40e_find_vsi_by_type(struct i40e_pf *pf, u16 type)
return NULL; return NULL;
} }
void i40e_update_stats(struct i40e_vsi *vsi); void i40e_update_stats(struct i40e_vsi *vsi);
void i40e_update_veb_stats(struct i40e_veb *veb);
void i40e_update_eth_stats(struct i40e_vsi *vsi); void i40e_update_eth_stats(struct i40e_vsi *vsi);
struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi); struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi);
int i40e_fetch_switch_configuration(struct i40e_pf *pf, int i40e_fetch_switch_configuration(struct i40e_pf *pf,
......
...@@ -2250,7 +2250,7 @@ static void i40e_get_ethtool_stats(struct net_device *netdev, ...@@ -2250,7 +2250,7 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi; struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
struct i40e_veb *veb = pf->veb[pf->lan_veb]; struct i40e_veb *veb = NULL;
unsigned int i; unsigned int i;
bool veb_stats; bool veb_stats;
u64 *p = data; u64 *p = data;
...@@ -2273,8 +2273,14 @@ static void i40e_get_ethtool_stats(struct net_device *netdev, ...@@ -2273,8 +2273,14 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
goto check_data_pointer; goto check_data_pointer;
veb_stats = ((pf->lan_veb != I40E_NO_VEB) && veb_stats = ((pf->lan_veb != I40E_NO_VEB) &&
(pf->lan_veb < I40E_MAX_VEB) &&
(pf->flags & I40E_FLAG_VEB_STATS_ENABLED)); (pf->flags & I40E_FLAG_VEB_STATS_ENABLED));
if (veb_stats) {
veb = pf->veb[pf->lan_veb];
i40e_update_veb_stats(veb);
}
/* If veb stats aren't enabled, pass NULL instead of the veb so that /* If veb stats aren't enabled, pass NULL instead of the veb so that
* we initialize stats to zero and update the data pointer * we initialize stats to zero and update the data pointer
* intelligently * intelligently
......
...@@ -677,7 +677,7 @@ void i40e_update_eth_stats(struct i40e_vsi *vsi) ...@@ -677,7 +677,7 @@ void i40e_update_eth_stats(struct i40e_vsi *vsi)
* i40e_update_veb_stats - Update Switch component statistics * i40e_update_veb_stats - Update Switch component statistics
* @veb: the VEB being updated * @veb: the VEB being updated
**/ **/
static void i40e_update_veb_stats(struct i40e_veb *veb) void i40e_update_veb_stats(struct i40e_veb *veb)
{ {
struct i40e_pf *pf = veb->pf; struct i40e_pf *pf = veb->pf;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment