* [PATCH] ethtool: igb: dump RR2DCDELAY register
@ 2019-07-15 6:52 Artem Bityutskiy
2019-07-15 9:13 ` Michal Kubecek
2019-07-15 10:59 ` [PATCH v2] " Artem Bityutskiy
0 siblings, 2 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2019-07-15 6:52 UTC (permalink / raw)
To: John W . Linville; +Cc: netdev
Decode 'RR2DCDELAY' register which Linux kernel provides starting from version
5.3. The corresponding commit in the Linux kernel is:
cd502a7f7c9c igb: add RR2DCDELAY to ethtool registers dump
The RR2DCDELAY register is present in 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 practice, this register can be used to measure the time it takes the NIC to
read data from the host memory.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
igb.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/igb.c b/igb.c
index e0ccef9..ab0896f 100644
--- a/igb.c
+++ b/igb.c
@@ -859,6 +859,18 @@ igb_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
"0x03430: TDFPC (Tx data FIFO packet count) 0x%08X\n",
regs_buff[550]);
+ /*
+ * Starting from kernel version 5.3 the registers dump buffer grew from
+ * 739 4-byte words to 740 words, and word 740 contains the RR2DCDLAY
+ * register.
+ */
+ if (regs->len < 740)
+ return 0;
+
+ fprintf(stdout,
+ "0x05BF4: RR2DCDELAY (Max. DMA read delay) 0x%08X\n",
+ regs_buff[739]);
+
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ethtool: igb: dump RR2DCDELAY register
2019-07-15 6:52 [PATCH] ethtool: igb: dump RR2DCDELAY register Artem Bityutskiy
@ 2019-07-15 9:13 ` Michal Kubecek
2019-07-15 11:01 ` Artem Bityutskiy
2019-07-15 10:59 ` [PATCH v2] " Artem Bityutskiy
1 sibling, 1 reply; 6+ messages in thread
From: Michal Kubecek @ 2019-07-15 9:13 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: John W . Linville, netdev
On Mon, Jul 15, 2019 at 09:52:28AM +0300, Artem Bityutskiy wrote:
> Decode 'RR2DCDELAY' register which Linux kernel provides starting from version
> 5.3. The corresponding commit in the Linux kernel is:
> cd502a7f7c9c igb: add RR2DCDELAY to ethtool registers dump
>
> The RR2DCDELAY register is present in 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 practice, this register can be used to measure the time it takes the NIC to
> read data from the host memory.
>
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> ---
> igb.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/igb.c b/igb.c
> index e0ccef9..ab0896f 100644
> --- a/igb.c
> +++ b/igb.c
> @@ -859,6 +859,18 @@ igb_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
> "0x03430: TDFPC (Tx data FIFO packet count) 0x%08X\n",
> regs_buff[550]);
>
> + /*
> + * Starting from kernel version 5.3 the registers dump buffer grew from
> + * 739 4-byte words to 740 words, and word 740 contains the RR2DCDLAY
nit: "E" missing here: ^
> + * register.
> + */
> + if (regs->len < 740)
> + return 0;
> +
> + fprintf(stdout,
> + "0x05BF4: RR2DCDELAY (Max. DMA read delay) 0x%08X\n",
> + regs_buff[739]);
Showing a delay as hex number doesn't seem very user friendly but that
also applies to many existing registers so it's probably better to be
consistent and perhaps do an overall cleanup later.
Michal
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] ethtool: igb: dump RR2DCDELAY register
2019-07-15 6:52 [PATCH] ethtool: igb: dump RR2DCDELAY register Artem Bityutskiy
2019-07-15 9:13 ` Michal Kubecek
@ 2019-07-15 10:59 ` Artem Bityutskiy
2019-07-15 19:26 ` Michal Kubecek
2019-07-26 15:26 ` John W. Linville
1 sibling, 2 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2019-07-15 10:59 UTC (permalink / raw)
To: John W . Linville; +Cc: netdev
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Decode 'RR2DCDELAY' register which Linux kernel provides starting from version
5.3. The corresponding commit in the Linux kernel is:
cd502a7f7c9c igb: add RR2DCDELAY to ethtool registers dump
The RR2DCDELAY register is present in 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 practice, this register can be used to measure the time it takes the NIC to
read data from the host memory.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
igb.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
Changelog:
v2: Fixed a typo in the commentary.
v1: Initial pach version.
diff --git a/igb.c b/igb.c
index e0ccef9..cb24877 100644
--- a/igb.c
+++ b/igb.c
@@ -859,6 +859,18 @@ igb_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
"0x03430: TDFPC (Tx data FIFO packet count) 0x%08X\n",
regs_buff[550]);
+ /*
+ * Starting from kernel version 5.3 the registers dump buffer grew from
+ * 739 4-byte words to 740 words, and word 740 contains the RR2DCDELAY
+ * register.
+ */
+ if (regs->len < 740)
+ return 0;
+
+ fprintf(stdout,
+ "0x05BF4: RR2DCDELAY (Max. DMA read delay) 0x%08X\n",
+ regs_buff[739]);
+
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ethtool: igb: dump RR2DCDELAY register
2019-07-15 9:13 ` Michal Kubecek
@ 2019-07-15 11:01 ` Artem Bityutskiy
0 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2019-07-15 11:01 UTC (permalink / raw)
To: Michal Kubecek; +Cc: John W . Linville, netdev
On Mon, 2019-07-15 at 11:13 +0200, Michal Kubecek wrote:
> > + /*
> > + * Starting from kernel version 5.3 the registers dump buffer grew from
> > + * 739 4-byte words to 740 words, and word 740 contains the RR2DCDLAY
>
> nit: "E" missing here: ^
Fixed and sent out v2.
> > + fprintf(stdout,
> > + "0x05BF4: RR2DCDELAY (Max. DMA read delay) 0x%08X\n",
> > + regs_buff[739]);
>
> Showing a delay as hex number doesn't seem very user friendly but that
> also applies to many existing registers so it's probably better to be
> consistent and perhaps do an overall cleanup later.
Agree.
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] ethtool: igb: dump RR2DCDELAY register
2019-07-15 10:59 ` [PATCH v2] " Artem Bityutskiy
@ 2019-07-15 19:26 ` Michal Kubecek
2019-07-26 15:26 ` John W. Linville
1 sibling, 0 replies; 6+ messages in thread
From: Michal Kubecek @ 2019-07-15 19:26 UTC (permalink / raw)
To: netdev; +Cc: Artem Bityutskiy, John W . Linville
On Mon, Jul 15, 2019 at 01:59:33PM +0300, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
>
> Decode 'RR2DCDELAY' register which Linux kernel provides starting from version
> 5.3. The corresponding commit in the Linux kernel is:
> cd502a7f7c9c igb: add RR2DCDELAY to ethtool registers dump
>
> The RR2DCDELAY register is present in 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 practice, this register can be used to measure the time it takes the NIC to
> read data from the host memory.
>
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> ---
> igb.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> Changelog:
> v2: Fixed a typo in the commentary.
> v1: Initial pach version.
>
>
> diff --git a/igb.c b/igb.c
> index e0ccef9..cb24877 100644
> --- a/igb.c
> +++ b/igb.c
> @@ -859,6 +859,18 @@ igb_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
> "0x03430: TDFPC (Tx data FIFO packet count) 0x%08X\n",
> regs_buff[550]);
>
> + /*
> + * Starting from kernel version 5.3 the registers dump buffer grew from
> + * 739 4-byte words to 740 words, and word 740 contains the RR2DCDELAY
> + * register.
> + */
> + if (regs->len < 740)
> + return 0;
> +
> + fprintf(stdout,
> + "0x05BF4: RR2DCDELAY (Max. DMA read delay) 0x%08X\n",
> + regs_buff[739]);
> +
> return 0;
> }
>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] ethtool: igb: dump RR2DCDELAY register
2019-07-15 10:59 ` [PATCH v2] " Artem Bityutskiy
2019-07-15 19:26 ` Michal Kubecek
@ 2019-07-26 15:26 ` John W. Linville
1 sibling, 0 replies; 6+ messages in thread
From: John W. Linville @ 2019-07-26 15:26 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: netdev
On Mon, Jul 15, 2019 at 01:59:33PM +0300, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
>
> Decode 'RR2DCDELAY' register which Linux kernel provides starting from version
> 5.3. The corresponding commit in the Linux kernel is:
> cd502a7f7c9c igb: add RR2DCDELAY to ethtool registers dump
>
> The RR2DCDELAY register is present in 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 practice, this register can be used to measure the time it takes the NIC to
> read data from the host memory.
>
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Queued for next release -- thanks!
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-07-26 15:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-15 6:52 [PATCH] ethtool: igb: dump RR2DCDELAY register Artem Bityutskiy
2019-07-15 9:13 ` Michal Kubecek
2019-07-15 11:01 ` Artem Bityutskiy
2019-07-15 10:59 ` [PATCH v2] " Artem Bityutskiy
2019-07-15 19:26 ` Michal Kubecek
2019-07-26 15:26 ` John W. Linville
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).