Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/2] net: intel: igb: minor ethool regdump amendment
@ 2019-06-18 11:55 Artem Bityutskiy
  2019-06-18 11:55 ` [PATCH 2/2] net: intel: igb: add RR2DCDELAY to ethtool registers dump Artem Bityutskiy
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2019-06-18 11:55 UTC (permalink / raw)
  To: David S. Miller; +Cc: Jeff Kirsher, intel-wired-lan, netdev, Todd Fujinaka

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

This patch has no functional impact and it is just a preparation
for the following patch. It removes an early return from the
'igb_get_regs()' function by moving the 82576-only registers
dump into an "if" block. With this preparation, we can dump more
non-82576 registers at the end of this function.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 drivers/net/ethernet/intel/igb/igb_ethtool.c | 70 ++++++++++----------
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index c645d9e648e0..401bc2bd6b21 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -675,41 +675,41 @@ static void igb_get_regs(struct net_device *netdev,
 		regs_buff[554] = adapter->stats.b2ogprc;
 	}
 
-	if (hw->mac.type != e1000_82576)
-		return;
-	for (i = 0; i < 12; i++)
-		regs_buff[555 + i] = rd32(E1000_SRRCTL(i + 4));
-	for (i = 0; i < 4; i++)
-		regs_buff[567 + i] = rd32(E1000_PSRTYPE(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[571 + i] = rd32(E1000_RDBAL(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[583 + i] = rd32(E1000_RDBAH(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[595 + i] = rd32(E1000_RDLEN(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[607 + i] = rd32(E1000_RDH(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[619 + i] = rd32(E1000_RDT(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[631 + i] = rd32(E1000_RXDCTL(i + 4));
-
-	for (i = 0; i < 12; i++)
-		regs_buff[643 + i] = rd32(E1000_TDBAL(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[655 + i] = rd32(E1000_TDBAH(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[667 + i] = rd32(E1000_TDLEN(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[679 + i] = rd32(E1000_TDH(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[691 + i] = rd32(E1000_TDT(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[703 + i] = rd32(E1000_TXDCTL(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[715 + i] = rd32(E1000_TDWBAL(i + 4));
-	for (i = 0; i < 12; i++)
-		regs_buff[727 + i] = rd32(E1000_TDWBAH(i + 4));
+	if (hw->mac.type == e1000_82576) {
+		for (i = 0; i < 12; i++)
+			regs_buff[555 + i] = rd32(E1000_SRRCTL(i + 4));
+		for (i = 0; i < 4; i++)
+			regs_buff[567 + i] = rd32(E1000_PSRTYPE(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[571 + i] = rd32(E1000_RDBAL(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[583 + i] = rd32(E1000_RDBAH(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[595 + i] = rd32(E1000_RDLEN(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[607 + i] = rd32(E1000_RDH(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[619 + i] = rd32(E1000_RDT(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[631 + i] = rd32(E1000_RXDCTL(i + 4));
+
+		for (i = 0; i < 12; i++)
+			regs_buff[643 + i] = rd32(E1000_TDBAL(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[655 + i] = rd32(E1000_TDBAH(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[667 + i] = rd32(E1000_TDLEN(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[679 + i] = rd32(E1000_TDH(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[691 + i] = rd32(E1000_TDT(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[703 + i] = rd32(E1000_TXDCTL(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[715 + i] = rd32(E1000_TDWBAL(i + 4));
+		for (i = 0; i < 12; i++)
+			regs_buff[727 + i] = rd32(E1000_TDWBAH(i + 4));
+	}
 }
 
 static int igb_get_eeprom_len(struct net_device *netdev)
-- 
2.20.1


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

* [PATCH 2/2] net: intel: igb: add RR2DCDELAY to ethtool registers dump
  2019-06-18 11:55 [PATCH 1/2] net: intel: igb: minor ethool regdump amendment Artem Bityutskiy
@ 2019-06-18 11:55 ` Artem Bityutskiy
  2019-06-21  1:47   ` Brown, Aaron F
  2019-06-18 13:58 ` [PATCH 1/2] net: intel: igb: minor ethool regdump amendment Andrew Lunn
  2019-06-21  1:45 ` Brown, Aaron F
  2 siblings, 1 reply; 5+ messages in thread
From: Artem Bityutskiy @ 2019-06-18 11:55 UTC (permalink / raw)
  To: David S. Miller; +Cc: Jeff Kirsher, intel-wired-lan, netdev, Todd Fujinaka

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

This patch adds the RR2DCDELAY register to the ethtool registers dump.
RR2DCDELAY exists on I210 and I211 Intel Gigabit Ethernet chips and it stands
for "Read Request To Data Completion Delay". Here is how this register is
described in the I210 datasheet:

"This field captures the maximum PCIe split time in 16 ns units, which is the
maximum delay between the read request to the first data completion. This is
giving an estimation of the PCIe round trip time."

In other words, whenever I210 reads from the host memory (e.g., fetches a
descriptor from the ring), the chip measures every PCI DMA read transaction and
captures the maximum value. So it ends up containing the longest DMA
transaction time.

This register is very useful for troubleshooting and research purposes. If you
are dealing with time-sensitive networks, this register can help you get
an idea of your "I210-to-ring" latency. This helps answering questions like
"should I have PCIe ASPM enabled?" or "should I enable deep C-states?" on
my system.

It is safe to read this register at any point, reading it has no effect on
the I210 chip functionality.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 drivers/net/ethernet/intel/igb/e1000_regs.h  | 2 ++
 drivers/net/ethernet/intel/igb/igb_ethtool.c | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igb/e1000_regs.h b/drivers/net/ethernet/intel/igb/e1000_regs.h
index 0ad737d2f289..9cb49980ec2d 100644
--- a/drivers/net/ethernet/intel/igb/e1000_regs.h
+++ b/drivers/net/ethernet/intel/igb/e1000_regs.h
@@ -409,6 +409,8 @@ do { \
 #define E1000_I210_TQAVCC(_n)	(0x3004 + ((_n) * 0x40))
 #define E1000_I210_TQAVHC(_n)	(0x300C + ((_n) * 0x40))
 
+#define E1000_I210_RR2DCDELAY	0x5BF4
+
 #define E1000_INVM_DATA_REG(_n)	(0x12120 + 4*(_n))
 #define E1000_INVM_SIZE		64 /* Number of INVM Data Registers */
 
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 401bc2bd6b21..3182b059bf55 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -448,7 +448,7 @@ static void igb_set_msglevel(struct net_device *netdev, u32 data)
 
 static int igb_get_regs_len(struct net_device *netdev)
 {
-#define IGB_REGS_LEN 739
+#define IGB_REGS_LEN 740
 	return IGB_REGS_LEN * sizeof(u32);
 }
 
@@ -710,6 +710,9 @@ static void igb_get_regs(struct net_device *netdev,
 		for (i = 0; i < 12; i++)
 			regs_buff[727 + i] = rd32(E1000_TDWBAH(i + 4));
 	}
+
+	if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211)
+		regs_buff[739] = rd32(E1000_I210_RR2DCDELAY);
 }
 
 static int igb_get_eeprom_len(struct net_device *netdev)
-- 
2.20.1


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

* Re: [PATCH 1/2] net: intel: igb: minor ethool regdump amendment
  2019-06-18 11:55 [PATCH 1/2] net: intel: igb: minor ethool regdump amendment Artem Bityutskiy
  2019-06-18 11:55 ` [PATCH 2/2] net: intel: igb: add RR2DCDELAY to ethtool registers dump Artem Bityutskiy
@ 2019-06-18 13:58 ` Andrew Lunn
  2019-06-21  1:45 ` Brown, Aaron F
  2 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2019-06-18 13:58 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: David S. Miller, Jeff Kirsher, intel-wired-lan, netdev, Todd Fujinaka

On Tue, Jun 18, 2019 at 02:55:12PM +0300, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

Hi Artem.

The subject line is missing a t in ethtool.

> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

Otherwise

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH 1/2] net: intel: igb: minor ethool regdump amendment
  2019-06-18 11:55 [PATCH 1/2] net: intel: igb: minor ethool regdump amendment Artem Bityutskiy
  2019-06-18 11:55 ` [PATCH 2/2] net: intel: igb: add RR2DCDELAY to ethtool registers dump Artem Bityutskiy
  2019-06-18 13:58 ` [PATCH 1/2] net: intel: igb: minor ethool regdump amendment Andrew Lunn
@ 2019-06-21  1:45 ` Brown, Aaron F
  2 siblings, 0 replies; 5+ messages in thread
From: Brown, Aaron F @ 2019-06-21  1:45 UTC (permalink / raw)
  To: Artem Bityutskiy, David S. Miller
  Cc: Kirsher, Jeffrey T, Fujinaka, Todd, intel-wired-lan, netdev

On Tue, 2019-06-18 at 14:55 +0300, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> 
> This patch has no functional impact and it is just a preparation
> for the following patch. It removes an early return from the
> 'igb_get_regs()' function by moving the 82576-only registers
> dump into an "if" block. With this preparation, we can dump more
> non-82576 registers at the end of this function.
> 
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> ---
>  drivers/net/ethernet/intel/igb/igb_ethtool.c | 70 ++++++++++----------
>  1 file changed, 35 insertions(+), 35 deletions(-)
> 
Aside from teh missing "t" for ethtool in the subject that Andrew Lunn pointed out...

Tested-by: Aaron Brown <aaron.f.brown@intel.com>

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

* Re: [PATCH 2/2] net: intel: igb: add RR2DCDELAY to ethtool registers dump
  2019-06-18 11:55 ` [PATCH 2/2] net: intel: igb: add RR2DCDELAY to ethtool registers dump Artem Bityutskiy
@ 2019-06-21  1:47   ` Brown, Aaron F
  0 siblings, 0 replies; 5+ messages in thread
From: Brown, Aaron F @ 2019-06-21  1:47 UTC (permalink / raw)
  To: Artem Bityutskiy, David S. Miller
  Cc: Kirsher, Jeffrey T, Fujinaka, Todd, intel-wired-lan, netdev

On Tue, 2019-06-18 at 14:55 +0300, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> 
> This patch adds the RR2DCDELAY register to the ethtool registers dump.
> RR2DCDELAY exists on I210 and I211 Intel Gigabit Ethernet chips and it stands
> for "Read Request To Data Completion Delay". Here is how this register is
> described in the I210 datasheet:
> 
> "This field captures the maximum PCIe split time in 16 ns units, which is the
> maximum delay between the read request to the first data completion. This is
> giving an estimation of the PCIe round trip time."
> 
> In other words, whenever I210 reads from the host memory (e.g., fetches a
> descriptor from the ring), the chip measures every PCI DMA read transaction and
> captures the maximum value. So it ends up containing the longest DMA
> transaction time.
> 
> This register is very useful for troubleshooting and research purposes. If you
> are dealing with time-sensitive networks, this register can help you get
> an idea of your "I210-to-ring" latency. This helps answering questions like
> "should I have PCIe ASPM enabled?" or "should I enable deep C-states?" on
> my system.
> 
> It is safe to read this register at any point, reading it has no effect on
> the I210 chip functionality.
> 
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> ---
>  drivers/net/ethernet/intel/igb/e1000_regs.h  | 2 ++
>  drivers/net/ethernet/intel/igb/igb_ethtool.c | 5 ++++-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 

Tested-by: Aaron Brown <aaron.f.brown@intel.com>

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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 11:55 [PATCH 1/2] net: intel: igb: minor ethool regdump amendment Artem Bityutskiy
2019-06-18 11:55 ` [PATCH 2/2] net: intel: igb: add RR2DCDELAY to ethtool registers dump Artem Bityutskiy
2019-06-21  1:47   ` Brown, Aaron F
2019-06-18 13:58 ` [PATCH 1/2] net: intel: igb: minor ethool regdump amendment Andrew Lunn
2019-06-21  1:45 ` Brown, Aaron F

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox