All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catherine Sullivan <catherine.sullivan@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [next PATCH S9 11/15] i40e: Strip VEB stats if they are disabled in HW
Date: Thu, 23 Jul 2015 16:54:40 -0400	[thread overview]
Message-ID: <1437684884-222825-12-git-send-email-catherine.sullivan@intel.com> (raw)
In-Reply-To: <1437684884-222825-1-git-send-email-catherine.sullivan@intel.com>

From: Anjali Singhai Jain <anjali.singhai@intel.com>

Due to performance reasons, VEB stats have been disabled in the hw. This
patch adds code to check for that condition before accumulating these
stats.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Change-ID: I7d805669476fedabb073790403703798ae5d878e
---
 drivers/net/ethernet/intel/i40e/i40e.h         |  1 +
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  9 ++++++---
 drivers/net/ethernet/intel/i40e/i40e_main.c    | 13 +++++++++----
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index d821c99..5a25c2c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -326,6 +326,7 @@ struct i40e_pf {
 #define I40E_FLAG_OUTER_UDP_CSUM_CAPABLE	BIT_ULL(33)
 #define I40E_FLAG_128_QP_RSS_CAPABLE		BIT_ULL(34)
 #define I40E_FLAG_WB_ON_ITR_CAPABLE		BIT_ULL(35)
+#define I40E_FLAG_VEB_STATS_ENABLED		BIT_ULL(37)
 #define I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE	BIT_ULL(38)
 #define I40E_FLAG_VEB_MODE_ENABLED		BIT_ULL(40)
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index dd2b620..1345de2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1264,7 +1264,8 @@ static int i40e_get_sset_count(struct net_device *netdev, int sset)
 		if (vsi == pf->vsi[pf->lan_vsi] && pf->hw.partition_id == 1) {
 			int len = I40E_PF_STATS_LEN(netdev);
 
-			if (pf->lan_veb != I40E_NO_VEB)
+			if ((pf->lan_veb != I40E_NO_VEB) &&
+			    (pf->flags & I40E_FLAG_VEB_STATS_ENABLED))
 				len += I40E_VEB_STATS_TOTAL;
 			return len;
 		} else {
@@ -1337,7 +1338,8 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
 	if (vsi != pf->vsi[pf->lan_vsi] || pf->hw.partition_id != 1)
 		return;
 
-	if (pf->lan_veb != I40E_NO_VEB) {
+	if ((pf->lan_veb != I40E_NO_VEB) &&
+	    (pf->flags & I40E_FLAG_VEB_STATS_ENABLED)) {
 		struct i40e_veb *veb = pf->veb[pf->lan_veb];
 		for (j = 0; j < I40E_VEB_STATS_LEN; j++) {
 			p = (char *)veb;
@@ -1410,7 +1412,8 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
 		if (vsi != pf->vsi[pf->lan_vsi] || pf->hw.partition_id != 1)
 			return;
 
-		if (pf->lan_veb != I40E_NO_VEB) {
+		if ((pf->lan_veb != I40E_NO_VEB) &&
+		    (pf->flags & I40E_FLAG_VEB_STATS_ENABLED)) {
 			for (i = 0; i < I40E_VEB_STATS_LEN; i++) {
 				snprintf(p, ETH_GSTRING_LEN, "veb.%s",
 					i40e_gstrings_veb_stats[i].stat_string);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 4f0660f..464fba3 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5761,10 +5761,12 @@ static void i40e_watchdog_subtask(struct i40e_pf *pf)
 		if (pf->vsi[i] && pf->vsi[i]->netdev)
 			i40e_update_stats(pf->vsi[i]);
 
-	/* Update the stats for the active switching components */
-	for (i = 0; i < I40E_MAX_VEB; i++)
-		if (pf->veb[i])
-			i40e_update_veb_stats(pf->veb[i]);
+	if (pf->flags & I40E_FLAG_VEB_STATS_ENABLED) {
+		/* Update the stats for the active switching components */
+		for (i = 0; i < I40E_MAX_VEB; i++)
+			if (pf->veb[i])
+				i40e_update_veb_stats(pf->veb[i]);
+	}
 
 	i40e_ptp_rx_hang(pf->vsi[pf->lan_vsi]);
 }
@@ -7851,6 +7853,9 @@ static int i40e_sw_init(struct i40e_pf *pf)
 	pf->lan_veb = I40E_NO_VEB;
 	pf->lan_vsi = I40E_NO_VSI;
 
+	/* By default FW has this off for performance reasons */
+	pf->flags &= ~I40E_FLAG_VEB_STATS_ENABLED;
+
 	/* set up queue assignment tracking */
 	size = sizeof(struct i40e_lump_tracking)
 		+ (sizeof(u16) * pf->hw.func_caps.num_tx_qp);
-- 
1.9.3


  parent reply	other threads:[~2015-07-23 20:54 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23 20:54 [Intel-wired-lan] [next PATCH S9 00/15] i40e/i40evf updates Catherine Sullivan
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 01/15] i40e/i40evf: fix up type clash in i40e_aq_rc_to_posix conversion Catherine Sullivan
2015-07-28 20:33   ` Bowers, AndrewX
2015-09-29 21:44     ` Sullivan, Catherine
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 02/15] i40e: Fix a port VLAN configuration bug Catherine Sullivan
2015-07-29 20:34   ` Bowers, AndrewX
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 03/15] i40e: fixup padding issue in get_cee_dcb_cfg_v1_resp Catherine Sullivan
2015-07-28 20:40   ` Bowers, AndrewX
2015-09-29 21:45     ` Sullivan, Catherine
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 04/15] i40e: rename variable to prevent clash of understanding Catherine Sullivan
2015-07-28 20:44   ` Bowers, AndrewX
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 05/15] i40e/i40evf: fix tx hang workaround code Catherine Sullivan
2015-07-28 20:49   ` Bowers, AndrewX
2015-09-29 21:47     ` Sullivan, Catherine
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 06/15] i40e: count drops in netstat interface Catherine Sullivan
2015-07-28 20:51   ` Bowers, AndrewX
2015-09-29 21:48     ` Sullivan, Catherine
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 07/15] i40e: use qos field consistently Catherine Sullivan
2015-07-28 20:55   ` Bowers, AndrewX
2015-09-29 21:49     ` Sullivan, Catherine
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 08/15] i40e: limit debugfs io ops Catherine Sullivan
2015-07-28 21:09   ` Bowers, AndrewX
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 09/15] i40e: Remove useless message Catherine Sullivan
2015-07-28 21:11   ` Bowers, AndrewX
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 10/15] i40e/i40evf: add new device id 1588 Catherine Sullivan
2015-07-28 21:14   ` Bowers, AndrewX
2015-07-23 20:54 ` Catherine Sullivan [this message]
2015-07-28 21:17   ` [Intel-wired-lan] [next PATCH S9 11/15] i40e: Strip VEB stats if they are disabled in HW Bowers, AndrewX
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 12/15] i40e: refactor interrupt enable Catherine Sullivan
2015-07-28 21:22   ` Bowers, AndrewX
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 13/15] i40e: warn on double free Catherine Sullivan
2015-07-28 21:24   ` Bowers, AndrewX
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 14/15] i40evf: tighten up reset polling Catherine Sullivan
2015-07-23 20:54 ` [Intel-wired-lan] [next PATCH S9 15/15] i40e/i40evf: Bump i40e to 1.3.12 and i40evf to 1.3.6 Catherine Sullivan
2015-07-28 20:26   ` Bowers, AndrewX
2015-07-28 21:25   ` Bowers, AndrewX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437684884-222825-12-git-send-email-catherine.sullivan@intel.com \
    --to=catherine.sullivan@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.