Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [next PATCH S7 1/9] i40e: fix incorrect ethtool statistics veb and veb.tc_
@ 2019-07-02 12:22 Alice Michael
  2019-07-02 12:22 ` [Intel-wired-lan] [next PATCH S7 2/9] i40e: make visible changed vf mac on host Alice Michael
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Alice Michael @ 2019-07-02 12:22 UTC (permalink / raw)
  To: intel-wired-lan

From: Dmitrii Golovanov <dmitrii.golovanov@intel.com>

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: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h         | 1 +
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 8 +++++++-
 drivers/net/ethernet/intel/i40e/i40e_main.c    | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 84bd06901014..3e535d3263b3 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -1021,6 +1021,7 @@ i40e_find_vsi_by_type(struct i40e_pf *pf, u16 type)
 	return NULL;
 }
 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);
 struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi);
 int i40e_fetch_switch_configuration(struct i40e_pf *pf,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 527eb52c5401..65e016f54f58 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -2250,7 +2250,7 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_vsi *vsi = np->vsi;
 	struct i40e_pf *pf = vsi->back;
-	struct i40e_veb *veb = pf->veb[pf->lan_veb];
+	struct i40e_veb *veb = NULL;
 	unsigned int i;
 	bool veb_stats;
 	u64 *p = data;
@@ -2273,8 +2273,14 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
 		goto check_data_pointer;
 
 	veb_stats = ((pf->lan_veb != I40E_NO_VEB) &&
+		     (pf->lan_veb < I40E_MAX_VEB) &&
 		     (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
 	 * we initialize stats to zero and update the data pointer
 	 * intelligently
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 5361c08328f7..8dac7a87834d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -677,7 +677,7 @@ void i40e_update_eth_stats(struct i40e_vsi *vsi)
  * i40e_update_veb_stats - Update Switch component statistics
  * @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_hw *hw = &pf->hw;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-07-03 21:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-02 12:22 [Intel-wired-lan] [next PATCH S7 1/9] i40e: fix incorrect ethtool statistics veb and veb.tc_ Alice Michael
2019-07-02 12:22 ` [Intel-wired-lan] [next PATCH S7 2/9] i40e: make visible changed vf mac on host Alice Michael
2019-07-03 21:37   ` Bowers, AndrewX
2019-07-02 12:22 ` [Intel-wired-lan] [next PATCH S7 3/9] i40e: Log disable-fw-lldp flag change by ethtool Alice Michael
2019-07-03 21:39   ` Bowers, AndrewX
2019-07-02 12:22 ` [Intel-wired-lan] [next PATCH S7 4/9] i40e: don't report link up for a VF who hasn't enabled queues Alice Michael
2019-07-03 21:40   ` Bowers, AndrewX
2019-07-02 12:22 ` [Intel-wired-lan] [next PATCH S7 5/9] i40e: fix code comments Alice Michael
2019-07-03 21:41   ` Bowers, AndrewX
2019-07-02 12:22 ` [Intel-wired-lan] [next PATCH S7 6/9] i40e: Update visual effect for advertised FEC mode Alice Michael
2019-07-03 21:41   ` Bowers, AndrewX
2019-07-02 12:22 ` [Intel-wired-lan] [next PATCH S7 7/9] i40e: Log info when PF is entering and leaving Allmulti mode Alice Michael
2019-07-03 21:42   ` Bowers, AndrewX
2019-07-02 12:22 ` [Intel-wired-lan] [next PATCH S7 8/9] i40e: verify string count matches even on early return Alice Michael
2019-07-03 21:42   ` Bowers, AndrewX
2019-07-02 12:22 ` [Intel-wired-lan] [next PATCH S7 9/9] i40e: Remove unicast log when VF is leaving multicast mode Alice Michael
2019-07-03 21:43   ` Bowers, AndrewX
2019-07-03 21:33 ` [Intel-wired-lan] [next PATCH S7 1/9] i40e: fix incorrect ethtool statistics veb and veb.tc_ Bowers, AndrewX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox