netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: netdev@vger.kernel.org
Cc: Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
	kuba@kernel.org, m-karicheri2@ti.com, vladimir.oltean@nxp.com,
	Jose.Abreu@synopsys.com, po.liu@nxp.com,
	intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com
Subject: [PATCH net-next v1 8/9] igc: Add support for exposing frame preemption stats registers
Date: Tue,  1 Dec 2020 20:53:24 -0800	[thread overview]
Message-ID: <20201202045325.3254757-9-vinicius.gomes@intel.com> (raw)
In-Reply-To: <20201202045325.3254757-1-vinicius.gomes@intel.com>

Expose the Frame Preemption counters, so the number of
express/preemptible packets can be monitored by userspace.

These registers are cleared when read, so the value shown is the
number of events that happened since the last read.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_ethtool.c |  8 ++++++++
 drivers/net/ethernet/intel/igc/igc_regs.h    | 10 ++++++++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index 492c6592c150..14a14a61de45 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -325,6 +325,14 @@ static void igc_ethtool_get_regs(struct net_device *netdev,
 
 	regs_buff[213] = adapter->stats.tlpic;
 	regs_buff[214] = adapter->stats.rlpic;
+	regs_buff[215] = rd32(IGC_PRMPTDTCNT);
+	regs_buff[216] = rd32(IGC_PRMEVNTTCNT);
+	regs_buff[217] = rd32(IGC_PRMPTDRCNT);
+	regs_buff[218] = rd32(IGC_PRMEVNTRCNT);
+	regs_buff[219] = rd32(IGC_PRMPBLTCNT);
+	regs_buff[220] = rd32(IGC_PRMPBLRCNT);
+	regs_buff[221] = rd32(IGC_PRMEXPTCNT);
+	regs_buff[222] = rd32(IGC_PRMEXPRCNT);
 }
 
 static void igc_ethtool_get_wol(struct net_device *netdev,
diff --git a/drivers/net/ethernet/intel/igc/igc_regs.h b/drivers/net/ethernet/intel/igc/igc_regs.h
index b52dd9d737e8..69e295d69d84 100644
--- a/drivers/net/ethernet/intel/igc/igc_regs.h
+++ b/drivers/net/ethernet/intel/igc/igc_regs.h
@@ -197,6 +197,16 @@
 
 #define IGC_FTQF(_n)	(0x059E0 + (4 * (_n)))  /* 5-tuple Queue Fltr */
 
+/* Time sync registers - preemption statistics */
+#define IGC_PRMPTDTCNT	0x04280  /* Good TX Preempted Packets */
+#define IGC_PRMEVNTTCNT	0x04298  /* TX Preemption event counter */
+#define IGC_PRMPTDRCNT	0x04284  /* Good RX Preempted Packets */
+#define IGC_PRMEVNTRCNT	0x0429C  /* RX Preemption event counter */
+#define IGC_PRMPBLTCNT	0x04288  /* Good TX Preemptable Packets */
+#define IGC_PRMPBLRCNT	0x0428C  /* Good RX Preemptable Packets */
+#define IGC_PRMEXPTCNT	0x04290  /* Good TX Express Packets */
+#define IGC_PRMEXPRCNT	0x042A0  /* Preemption Exception Counter */
+
 /* Transmit Scheduling Registers */
 #define IGC_TQAVCTRL		0x3570
 #define IGC_TXQCTL(_n)		(0x3344 + 0x4 * (_n))
-- 
2.29.2


  parent reply	other threads:[~2020-12-02  4:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02  4:53 [PATCH net-next v1 0/9] ethtool: Add support for frame preemption Vinicius Costa Gomes
2020-12-02  4:53 ` [PATCH net-next v1 1/9] ethtool: Add support for configuring " Vinicius Costa Gomes
2020-12-03  1:53   ` Jakub Kicinski
2020-12-05 17:43   ` Jakub Kicinski
2020-12-07 22:11     ` Vinicius Costa Gomes
2020-12-07 23:21       ` Jakub Kicinski
2020-12-08  0:24         ` Vinicius Costa Gomes
2020-12-08  0:27           ` Vladimir Oltean
2020-12-08  0:48             ` Jakub Kicinski
2020-12-08  6:22       ` Michal Kubecek
2020-12-02  4:53 ` [PATCH net-next v1 2/9] taprio: Add support for frame preemption offload Vinicius Costa Gomes
2020-12-02  4:53 ` [PATCH net-next v1 3/9] igc: Set the RX packet buffer size for TSN mode Vinicius Costa Gomes
2020-12-02  4:53 ` [PATCH net-next v1 4/9] igc: Only dump registers if configured to dump HW information Vinicius Costa Gomes
2020-12-02  4:53 ` [PATCH net-next v1 5/9] igc: Avoid TX Hangs because long cycles Vinicius Costa Gomes
2020-12-02  4:53 ` [PATCH net-next v1 6/9] igc: Add support for tuning frame preemption via ethtool Vinicius Costa Gomes
2020-12-05 18:00   ` Jakub Kicinski
2020-12-07 22:15     ` Vinicius Costa Gomes
2020-12-07 23:22       ` Jakub Kicinski
2020-12-02  4:53 ` [PATCH net-next v1 7/9] igc: Add support for Frame Preemption offload Vinicius Costa Gomes
2020-12-02  4:53 ` Vinicius Costa Gomes [this message]
2020-12-05 17:59   ` [PATCH net-next v1 8/9] igc: Add support for exposing frame preemption stats registers Jakub Kicinski
2020-12-07 22:29     ` Vinicius Costa Gomes
2020-12-02  4:53 ` [PATCH net-next v1 9/9] igc: Separate TSN configurations that can be updated Vinicius Costa Gomes
2020-12-05 17:50 ` [PATCH net-next v1 0/9] ethtool: Add support for frame preemption Jakub Kicinski
2020-12-07 22:49   ` Vinicius Costa Gomes
2020-12-07 23:12     ` Vladimir Oltean
2020-12-08  0:34       ` Vinicius Costa Gomes

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=20201202045325.3254757-9-vinicius.gomes@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=m-karicheri2@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=po.liu@nxp.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=xiyou.wangcong@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).