igc: Correct the short interval between PTM requests.
Subsystems (3)
PATCH 1/1 igc: Correct the short interval between PTM requests.
With the 10us interval, we were seeing PTM transactions taking around 12us. With the 1us interval, PTM dialogs took around 2us. Checked with the PCIe sniffer.
--- drivers/net/ethernet/intel/igc/igc_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igc/igc_defines.h +1 -1
@@ -549,7 +549,7 @@#define IGC_PTM_CTRL_SHRT_CYC (usec) (((usec) & 0x2f) << 2)#define IGC_PTM_CTRL_PTM_TO (usec) (((usec) & 0xff) << 8) -#define IGC_PTM_SHORT_CYC_DEFAULT 10/* Default Short/interrupted cycle interval */ +#define IGC_PTM_SHORT_CYC_DEFAULT 1/* Default short cycle interval */ #define IGC_PTM_CYC_TIME_DEFAULT 5/* Default PTM cycle time */ #define IGC_PTM_TIMEOUT_DEFAULT 255/* Default timeout for PTM errors */
Signature · 6 lines
2.34.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
[Cc: [email protected]]
Dear Sasha,
Thank you for your patch.
Maybe be more specific in the commit message summary. Maybe:
igc: Decrease PTM short interval from 10 us to 1 us
Am 17.07.23 um 19:19 schrieb Sasha Neftin:
Quoted 3 lines
With the 10us interval, we were seeing PTM transactions taking around 12us. With the 1us interval, PTM dialogs took around 2us. Checked with the PCIe sniffer.
On what board, and with what device and what firmware versions?
Quoted 12 lines
Fixes a90ec8483732 ("igc: Add support for PTP getcrosststamp()")Suggested-by Vinicius Costa Gomes <[email protected]>Signed-off-by Sasha Neftin <[email protected]>--- drivers/net/ethernet/intel/igc/igc_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/igc/igc_defines.h +0
-0
drivers/net/ethernet/intel/igc/igc_defines.h line 552
Quoted 5 lines
drivers/net/ethernet/intel/igc/igc_defines.h +1
-1@@ -549,7 +549,7 @@#define IGC_PTM_CTRL_SHRT_CYC (usec) (((usec) & 0x2f) << 2)#define IGC_PTM_CTRL_PTM_TO (usec) (((usec) & 0xff) << 8) -#define IGC_PTM_SHORT_CYC_DEFAULT 10/* Default Short/interrupted cycle interval */ +#define IGC_PTM_SHORT_CYC_DEFAULT 1/* Default short cycle interval */
Why is the comment updated?
drivers/net/ethernet/intel/igc/igc_defines.h line 554
Quoted 2 lines
drivers/net/ethernet/intel/igc/igc_defines.h +0
-0#define IGC_PTM_CYC_TIME_DEFAULT 5/* Default PTM cycle time */ #define IGC_PTM_TIMEOUT_DEFAULT 255/* Default timeout for PTM errors */
Kind regards,
Paul
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 10 lines · Paul Menzel
[Cc: [email protected]]
Dear Sasha,
Thank you for your patch.
Maybe be more specific in the commit message summary. Maybe:
igc: Decrease PTM short interval from 10 us to 1 us
Good.
Quoted 7 lines
Am 17.07.23 um 19:19 schrieb Sasha Neftin:
Quoted 3 lines
With the 10us interval, we were seeing PTM transactions taking around 12us. With the 1us interval, PTM dialogs took around 2us. Checked with the PCIe sniffer.
On what board, and with what device and what firmware versions?
Any with the PTM support. HW feature and not dependent on the firmware.
Quoted 8 lines
Quoted 8 lines
Fixes a90ec8483732 ("igc: Add support for PTP getcrosststamp()")Suggested-by Vinicius Costa Gomes <[email protected]>Signed-off-by Sasha Neftin <[email protected]>---
drivers/net/ethernet/intel/igc/igc_defines.h| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
Quoted 11 lines
drivers/net/ethernet/intel/igc/igc_defines.h +0
-1@@ -549,7 +549,7 @@ #define IGC_PTM_CTRL_SHRT_CYC(usec) (((usec) & 0x2f) << 2) #define IGC_PTM_CTRL_PTM_TO(usec) (((usec) & 0xff) << 8) -#define IGC_PTM_SHORT_CYC_DEFAULT 10/* Default Short/interrupted cycle interval */
+#define IGC_PTM_SHORT_CYC_DEFAULT 1 /* Default short cycle interval */Why is the comment updated?
Interval, not interrupt...
Quoted 8 lines
Quoted 3 lines
#define IGC_PTM_CYC_TIME_DEFAULT 5 /* Default PTM cycle time */ #define IGC_PTM_TIMEOUT_DEFAULT 255 /* Default timeout for PTM errors */
Kind regards,
Paul
Sasha
[Cc: +Vinicius]
Dear Sasha,
Am 18.07.23 um 18:15 schrieb Neftin, Sasha:
Quoted 2 lines · Paul Menzel
Quoted 1 line
[Cc: [email protected]]
[…]
Quoted 6 lines
Quoted 3 lines
Maybe be more specific in the commit message summary. Maybe:
igc: Decrease PTM short interval from 10 us to 1 us
Good.
Quoted 8 lines
Quoted 6 lines
Am 17.07.23 um 19:19 schrieb Sasha Neftin:
Quoted 3 lines
With the 10us interval, we were seeing PTM transactions taking around 12us. With the 1us interval, PTM dialogs took around 2us. Checked with the PCIe sniffer.
On what board, and with what device and what firmware versions?
Any with the PTM support. HW feature and not dependent on the firmware.
Still you tested it. It’s always beneficial to at least denote one of the systems with all the details. Especially as it shouldn’t cost you more than a minute to add these details.
Quoted 20 lines
Quoted 7 lines
Quoted 7 lines
Fixes a90ec8483732 ("igc: Add support for PTP getcrosststamp()")Suggested-by Vinicius Costa Gomes <[email protected]>Signed-off-by Sasha Neftin <[email protected]>---
drivers/net/ethernet/intel/igc/igc_defines.h| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Quoted 12 lines
Quoted 10 lines
drivers/net/ethernet/intel/igc/igc_defines.h +1
-1@@ -549,7 +549,7 @@ #define IGC_PTM_CTRL_SHRT_CYC(usec) (((usec) & 0x2f) << 2) #define IGC_PTM_CTRL_PTM_TO(usec) (((usec) & 0xff) << 8) -#define IGC_PTM_SHORT_CYC_DEFAULT 10/* Default Short/interrupted cycle interval */ +#define IGC_PTM_SHORT_CYC_DEFAULT 1/* Default short cycle interval */
Why is the comment updated?
Quoted 1 line
Interval, not interrupt...
Sorry, I do not understand your answer. It’d be great, if you elaborated.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
#define IGC_PTM_CYC_TIME_DEFAULT 5 /* Default PTM cycle time */ #define IGC_PTM_TIMEOUT_DEFAULT 255 /* Default timeout for PTM errors */
Kind regards,
Paul
[+cc Paul, Vinicius, Kai-Heng, Guilherme]
Quoted 16 lines · Sasha Neftin
With the 10us interval, we were seeing PTM transactions taking around 12us. With the 1us interval, PTM dialogs took around 2us. Checked with the PCIe sniffer.
Fixes a90ec8483732 ("igc: Add support for PTP getcrosststamp()")Suggested-by Vinicius Costa Gomes <[email protected]>Signed-off-by Sasha Neftin <[email protected]>--- drivers/net/ethernet/intel/igc/igc_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/igc/igc_defines.h +0
-0
drivers/net/ethernet/intel/igc/igc_defines.h line 552
Quoted 5 lines
drivers/net/ethernet/intel/igc/igc_defines.h +1
-1@@ -549,7 +549,7 @@#define IGC_PTM_CTRL_SHRT_CYC (usec) (((usec) & 0x2f) << 2)#define IGC_PTM_CTRL_PTM_TO (usec) (((usec) & 0xff) << 8) -#define IGC_PTM_SHORT_CYC_DEFAULT 10/* Default Short/interrupted cycle interval */ +#define IGC_PTM_SHORT_CYC_DEFAULT 1/* Default short cycle interval */
Not related to *this* patch, but from looking at igc_ptp_reset(), where IGC_PTM_SHORT_CYC_DEFAULT is used,
/* PCIe PTM Control */ #define IGC_PTM_CTRL_START_NOW BIT(29) /* Start PTM Now */ #define IGC_PTM_CTRL_EN BIT(30) /* Enable PTM */
ctrl = IGC_PTM_CTRL_EN |
IGC_PTM_CTRL_START_NOW | IGC_PTM_CTRL_SHRT_CYC(IGC_PTM_SHORT_CYC_DEFAULT) | IGC_PTM_CTRL_PTM_TO(IGC_PTM_TIMEOUT_DEFAULT) | IGC_PTM_CTRL_TRIG;
wr32(IGC_PTM_CTRL, ctrl);
Obviously this must be implementation-specific PTM configuration, which is fine. But I assume even though this sets IGC_PTM_CTRL_EN and IGC_PTM_CTRL_START_NOW, the device will not actually send PTM Request messages unless the architected PTM Enable bit in the PTM Capability is set (PCIe r6.0, sec 7.9.15.3). Right?
I'm asking because Kai-Heng has been working on issues where Unsupported Request errors are reported because some devices seem to send PTM Requests when we don't think they should. See
https://lore.kernel.org/r/[email protected]
Quoted 2 lines
drivers/net/ethernet/intel/igc/igc_defines.h +0
-0#define IGC_PTM_CYC_TIME_DEFAULT 5/* Default PTM cycle time */ #define IGC_PTM_TIMEOUT_DEFAULT 255/* Default timeout for PTM errors */
Quoted 40 lines · Bjorn Helgaas
[+cc Paul, Vinicius, Kai-Heng, Guilherme]
Quoted 16 lines · Sasha Neftin
With the 10us interval, we were seeing PTM transactions taking around 12us. With the 1us interval, PTM dialogs took around 2us. Checked with the PCIe sniffer.
Fixes a90ec8483732 ("igc: Add support for PTP getcrosststamp()")Suggested-by Vinicius Costa Gomes <[email protected]>Signed-off-by Sasha Neftin <[email protected]>--- drivers/net/ethernet/intel/igc/igc_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/igc/igc_defines.h +0
-0drivers/net/ethernet/intel/igc/igc_defines.h line 552
Quoted 5 lines
drivers/net/ethernet/intel/igc/igc_defines.h +1
-1@@ -549,7 +549,7 @@#define IGC_PTM_CTRL_SHRT_CYC (usec) (((usec) & 0x2f) << 2)#define IGC_PTM_CTRL_PTM_TO (usec) (((usec) & 0xff) << 8) -#define IGC_PTM_SHORT_CYC_DEFAULT 10/* Default Short/interrupted cycle interval */ +#define IGC_PTM_SHORT_CYC_DEFAULT 1/* Default short cycle interval */ Not related to *this* patch, but from looking at
igc_ptp_reset(), whereIGC_PTM_SHORT_CYC_DEFAULTis used,/* PCIe PTM Control */ #define IGC_PTM_CTRL_START_NOW BIT(29) /* Start PTM Now */ #define IGC_PTM_CTRL_EN BIT(30) /* Enable PTM */ctrl = IGC_PTM_CTRL_EN | IGC_PTM_CTRL_START_NOW | IGC_PTM_CTRL_SHRT_CYC(IGC_PTM_SHORT_CYC_DEFAULT) | IGC_PTM_CTRL_PTM_TO(IGC_PTM_TIMEOUT_DEFAULT) | IGC_PTM_CTRL_TRIG; wr32(IGC_PTM_CTRL, ctrl);
Quoted 5 lines
Obviously this must be implementation-specific PTM configuration, which is fine. But I assume even though this sets
IGC_PTM_CTRL_ENandIGC_PTM_CTRL_START_NOW, the device will not actually send PTM Request messages unless the architected PTM Enable bit in the PTM Capability is set (PCIe r6.0, sec 7.9.15.3). Right?
Right.
Quoted 5 lines
I'm asking because Kai-Heng has been working on issues where Unsupported Request errors are reported because some devices seem to send PTM Requests when we don't think they should. See
https://lore.kernel.org/r/[email protected]
I know. This is a different problem. (I can not reproduce, we will try to get HP dock). We will think how to help here.
Quoted 3 lines
Quoted 3 lines
drivers/net/ethernet/intel/igc/igc_defines.h +0
-0#define IGC_PTM_CYC_TIME_DEFAULT 5/* Default PTM cycle time */ #define IGC_PTM_TIMEOUT_DEFAULT 255/* Default timeout for PTM errors */