r8169 NICs on some platforms have abysmal speed when ASPM is enabled.
Same issue can be observed with older vendor drivers.
The issue is however solved by the latest vendor driver. There's a new
mechanism, which disables r8169's internal ASPM when the NIC traffic has
more than 10 packets, and vice versa.
Realtek confirmed that all their PCIe LAN NICs, r8106, r8168 and r8125
use dynamic ASPM under Windows. So implement the same mechanism here to
resolve the issue.
Signed-off-by: Kai-Heng Feng <redacted>
---
v2:
- Use delayed_work instead of timer_list to avoid interrupt context
- Use mutex to serialize packet counter read/write
- Wording change
drivers/net/ethernet/realtek/r8169_main.c | 45 +++++++++++++++++++++++
1 file changed, 45 insertions(+)
The latest vendor driver enables ASPM for more recent r8168 NICs, do the
same here to match the behavior.
In addition, pci_disable_link_state() is only used for RTL8168D/8111D in
vendor driver, also match that.
Signed-off-by: Kai-Heng Feng <redacted>
---
v2:
- No change
drivers/net/ethernet/realtek/r8169_main.c | 34 +++++++++++++++++------
1 file changed, 26 insertions(+), 8 deletions(-)
@@ -2667,8 +2667,11 @@ static void rtl_pcie_state_l2l3_disable(struct rtl8169_private *tp)staticvoidrtl_hw_aspm_clkreq_enable(structrtl8169_private*tp,boolenable){+if(!tp->aspm_supported)+return;+/* Don't enable ASPM in the chip if OS can't control ASPM */-if(enable&&tp->aspm_manageable){+if(enable){RTL_W8(tp,Config5,RTL_R8(tp,Config5)|ASPM_en);RTL_W8(tp,Config2,RTL_R8(tp,Config2)|ClkReqEn);}else{
r8169 NICs on some platforms have abysmal speed when ASPM is enabled.
Same issue can be observed with older vendor drivers.
The issue is however solved by the latest vendor driver. There's a new
mechanism, which disables r8169's internal ASPM when the NIC traffic has
more than 10 packets, and vice versa.
Realtek confirmed that all their PCIe LAN NICs, r8106, r8168 and r8125
use dynamic ASPM under Windows. So implement the same mechanism here to
resolve the issue.
Realtek using something in their Windows drivers isn't really a proof of
quality. Still my concerns haven't been addressed. If ASPM is enabled and
there's a congestion in the chip it may take up to a second until ASPM
gets disabled. In this second traffic very likely is heavily affected.
Who takes care in case of problem reports?
This is a massive change for basically all chip versions. And experience
shows that in case of problem reports Realtek never cares, even though
they are listed as maintainers. All I see is that they copy more and more
code from r8169 into their own drivers. This seems to indicate that they
consider quality of their own drivers as not sufficient.
Still my proposal: Apply this downstream, and if there are no complaints
after a few months it may be considered for mainline.
Last but not least the formal issues:
- no cover letter
- no net/net-next annotation
quoted hunk
Signed-off-by: Kai-Heng Feng <redacted>
---
v2:
- Use delayed_work instead of timer_list to avoid interrupt context
- Use mutex to serialize packet counter read/write
- Wording change
drivers/net/ethernet/realtek/r8169_main.c | 45 +++++++++++++++++++++++
1 file changed, 45 insertions(+)
The latest vendor driver enables ASPM for more recent r8168 NICs, do the
same here to match the behavior.
In addition, pci_disable_link_state() is only used for RTL8168D/8111D in
vendor driver, also match that.
Signed-off-by: Kai-Heng Feng <redacted>
---
v2:
- No change
drivers/net/ethernet/realtek/r8169_main.c | 34 +++++++++++++++++------
1 file changed, 26 insertions(+), 8 deletions(-)
@@ -2667,8 +2667,11 @@ static void rtl_pcie_state_l2l3_disable(struct rtl8169_private *tp)staticvoidrtl_hw_aspm_clkreq_enable(structrtl8169_private*tp,boolenable){+if(!tp->aspm_supported)+return;+/* Don't enable ASPM in the chip if OS can't control ASPM */-if(enable&&tp->aspm_manageable){+if(enable){RTL_W8(tp,Config5,RTL_R8(tp,Config5)|ASPM_en);RTL_W8(tp,Config2,RTL_R8(tp,Config2)|ClkReqEn);}else{
This shouldn't be needed because ASPM support is announced the
standard PCI way. Max a blacklist should be needed if there are
chip versions that announce ASPM support whilst in reality they
do not support it (or support is completely broken).
r8169 NICs on some platforms have abysmal speed when ASPM is enabled.
Same issue can be observed with older vendor drivers.
The issue is however solved by the latest vendor driver. There's a new
mechanism, which disables r8169's internal ASPM when the NIC traffic has
more than 10 packets, and vice versa.
Realtek confirmed that all their PCIe LAN NICs, r8106, r8168 and r8125
As we have Realtek in this mail thread:
Typically hw issues affect 1-3 chip versions only. The ASPM problems seem
to have been existing for at least 15 years now, in every chip version.
It seems that even the new RTL8125 chip generation still has broken ASPM.
Why was this never fixed? ASPM not considered to be relevant? HW design
too broken?
quoted hunk
use dynamic ASPM under Windows. So implement the same mechanism here to
resolve the issue.
Signed-off-by: Kai-Heng Feng <redacted>
---
v2:
- Use delayed_work instead of timer_list to avoid interrupt context
- Use mutex to serialize packet counter read/write
- Wording change
drivers/net/ethernet/realtek/r8169_main.c | 45 +++++++++++++++++++++++
1 file changed, 45 insertions(+)
j
On Fri, Aug 13, 2021 at 3:39 AM Heiner Kallweit [off-list ref] wrote:
On 12.08.2021 17:53, Kai-Heng Feng wrote:
quoted
r8169 NICs on some platforms have abysmal speed when ASPM is enabled.
Same issue can be observed with older vendor drivers.
The issue is however solved by the latest vendor driver. There's a new
mechanism, which disables r8169's internal ASPM when the NIC traffic has
more than 10 packets, and vice versa.
Realtek confirmed that all their PCIe LAN NICs, r8106, r8168 and r8125
use dynamic ASPM under Windows. So implement the same mechanism here to
resolve the issue.
Realtek using something in their Windows drivers isn't really a proof of
quality.
I agree. So it'll be great if Realtek can work with us here.
Still my concerns haven't been addressed. If ASPM is enabled and
there's a congestion in the chip it may take up to a second until ASPM
gets disabled. In this second traffic very likely is heavily affected.
Who takes care in case of problem reports?
I think we'll know that once the patch is merged in downstream kernel.
This is a massive change for basically all chip versions. And experience
shows that in case of problem reports Realtek never cares, even though
they are listed as maintainers. All I see is that they copy more and more
code from r8169 into their own drivers. This seems to indicate that they
consider quality of their own drivers as not sufficient.
I wonder why they don't want to put their efforts to r8169...
Obviously they are doing a great job for rtw88 and r8152.
Still my proposal: Apply this downstream, and if there are no complaints
after a few months it may be considered for mainline.
Yes that's my plan. But I'd still like it to be reviewed before
putting it to the downstream kernel.
Last but not least the formal issues:
- no cover letter
Will write it up once it's tested dowstream.
- no net/net-next annotation
Does it mean put "net/net-next" in the subject line?
quoted
Signed-off-by: Kai-Heng Feng <redacted>
---
v2:
- Use delayed_work instead of timer_list to avoid interrupt context
- Use mutex to serialize packet counter read/write
- Wording change
drivers/net/ethernet/realtek/r8169_main.c | 45 +++++++++++++++++++++++
1 file changed, 45 insertions(+)
On Fri, Aug 13, 2021 at 2:49 PM Heiner Kallweit [off-list ref] wrote:
On 12.08.2021 17:53, Kai-Heng Feng wrote:
quoted
r8169 NICs on some platforms have abysmal speed when ASPM is enabled.
Same issue can be observed with older vendor drivers.
The issue is however solved by the latest vendor driver. There's a new
mechanism, which disables r8169's internal ASPM when the NIC traffic has
more than 10 packets, and vice versa.
Realtek confirmed that all their PCIe LAN NICs, r8106, r8168 and r8125
As we have Realtek in this mail thread:
Is it still in active use? I always think it's just a dummy address...
Typically hw issues affect 1-3 chip versions only. The ASPM problems seem
to have been existing for at least 15 years now, in every chip version.
It seems that even the new RTL8125 chip generation still has broken ASPM.
Is there a bug report for that?
Why was this never fixed? ASPM not considered to be relevant? HW design
too broken?
IIUC, ASPM is extremely relevant to pass EU/US power consumption
regulation. So I really don't know why the situation under Linux is so
dire.
Kai-Heng
quoted
use dynamic ASPM under Windows. So implement the same mechanism here to
resolve the issue.
Signed-off-by: Kai-Heng Feng <redacted>
---
v2:
- Use delayed_work instead of timer_list to avoid interrupt context
- Use mutex to serialize packet counter read/write
- Wording change
drivers/net/ethernet/realtek/r8169_main.c | 45 +++++++++++++++++++++++
1 file changed, 45 insertions(+)
On Fri, Aug 13, 2021 at 3:39 AM Heiner Kallweit [off-list ref] wrote:
On 12.08.2021 17:53, Kai-Heng Feng wrote:
quoted
The latest vendor driver enables ASPM for more recent r8168 NICs, do the
same here to match the behavior.
In addition, pci_disable_link_state() is only used for RTL8168D/8111D in
vendor driver, also match that.
Signed-off-by: Kai-Heng Feng <redacted>
---
v2:
- No change
drivers/net/ethernet/realtek/r8169_main.c | 34 +++++++++++++++++------
1 file changed, 26 insertions(+), 8 deletions(-)
@@ -2667,8 +2667,11 @@ static void rtl_pcie_state_l2l3_disable(struct rtl8169_private *tp)staticvoidrtl_hw_aspm_clkreq_enable(structrtl8169_private*tp,boolenable){+if(!tp->aspm_supported)+return;+/* Don't enable ASPM in the chip if OS can't control ASPM */-if(enable&&tp->aspm_manageable){+if(enable){RTL_W8(tp,Config5,RTL_R8(tp,Config5)|ASPM_en);RTL_W8(tp,Config2,RTL_R8(tp,Config2)|ClkReqEn);}else{
This shouldn't be needed because ASPM support is announced the
standard PCI way. Max a blacklist should be needed if there are
chip versions that announce ASPM support whilst in reality they
do not support it (or support is completely broken).
So can we also remove aspm_manageable since blacklist will be used?
Kai-Heng
On Fri, Aug 13, 2021 at 3:39 AM Heiner Kallweit [off-list ref] wrote:
quoted
On 12.08.2021 17:53, Kai-Heng Feng wrote:
quoted
The latest vendor driver enables ASPM for more recent r8168 NICs, do the
same here to match the behavior.
In addition, pci_disable_link_state() is only used for RTL8168D/8111D in
vendor driver, also match that.
Signed-off-by: Kai-Heng Feng <redacted>
---
v2:
- No change
drivers/net/ethernet/realtek/r8169_main.c | 34 +++++++++++++++++------
1 file changed, 26 insertions(+), 8 deletions(-)
@@ -2667,8 +2667,11 @@ static void rtl_pcie_state_l2l3_disable(struct rtl8169_private *tp)staticvoidrtl_hw_aspm_clkreq_enable(structrtl8169_private*tp,boolenable){+if(!tp->aspm_supported)+return;+/* Don't enable ASPM in the chip if OS can't control ASPM */-if(enable&&tp->aspm_manageable){+if(enable){RTL_W8(tp,Config5,RTL_R8(tp,Config5)|ASPM_en);RTL_W8(tp,Config2,RTL_R8(tp,Config2)|ClkReqEn);}else{
This shouldn't be needed because ASPM support is announced the
standard PCI way. Max a blacklist should be needed if there are
chip versions that announce ASPM support whilst in reality they
do not support it (or support is completely broken).
So can we also remove aspm_manageable since blacklist will be used?
That's independent. What I mean is replace the whitelist with auto-
detected ASPM support and blacklist just the ones that are where
ASPM is completely unusable.
Retrieving the info about ASPM support may need a smll PCI core
extension. We need something similar to pcie_aspm_enabled(),
just exposing link->aspm_support. link->aspm_enabled may change
at runtime (sysfs link attributes).
On Fri, Aug 13, 2021 at 2:49 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 12.08.2021 17:53, Kai-Heng Feng wrote:
quoted
r8169 NICs on some platforms have abysmal speed when ASPM is enabled.
Same issue can be observed with older vendor drivers.
The issue is however solved by the latest vendor driver. There's a new
mechanism, which disables r8169's internal ASPM when the NIC traffic has
more than 10 packets, and vice versa.
Realtek confirmed that all their PCIe LAN NICs, r8106, r8168 and r8125
As we have Realtek in this mail thread:
Is it still in active use? I always think it's just a dummy address...
At least mails to this address are not bounced, and this address still is
in MAINTAINERS. But right, I've never any reaction on mails to this
address. So it may make sense to remove it from MAINTAINERS.
Not sure what the process would be to do this.
quoted
Typically hw issues affect 1-3 chip versions only. The ASPM problems seem
to have been existing for at least 15 years now, in every chip version.
It seems that even the new RTL8125 chip generation still has broken ASPM.
Is there a bug report for that?
No. This was referring to your statement that also r8125 vendor driver
includes this "dynamic ASPM" workaround. They wouldn't have done this
if RTL8125 had proper ASPM support, or?
quoted
Why was this never fixed? ASPM not considered to be relevant? HW design
too broken?
IIUC, ASPM is extremely relevant to pass EU/US power consumption
regulation. So I really don't know why the situation under Linux is so
dire.
It's not something related to Linux, ASPM support in the Realtek chips
is simply broken. This needs to be fixed in HW.
The behavior we see may indicate that certain buffers in the chips are
too small to buffer traffic for full period of ASPM exit latency.
Kai-Heng
quoted
quoted
use dynamic ASPM under Windows. So implement the same mechanism here to
resolve the issue.
Signed-off-by: Kai-Heng Feng <redacted>
---
v2:
- Use delayed_work instead of timer_list to avoid interrupt context
- Use mutex to serialize packet counter read/write
- Wording change
drivers/net/ethernet/realtek/r8169_main.c | 45 +++++++++++++++++++++++
1 file changed, 45 insertions(+)
j
On Fri, Aug 13, 2021 at 3:39 AM Heiner Kallweit [off-list ref] wrote:
quoted
On 12.08.2021 17:53, Kai-Heng Feng wrote:
quoted
r8169 NICs on some platforms have abysmal speed when ASPM is enabled.
Same issue can be observed with older vendor drivers.
The issue is however solved by the latest vendor driver. There's a new
mechanism, which disables r8169's internal ASPM when the NIC traffic has
more than 10 packets, and vice versa.
Realtek confirmed that all their PCIe LAN NICs, r8106, r8168 and r8125
use dynamic ASPM under Windows. So implement the same mechanism here to
resolve the issue.
Realtek using something in their Windows drivers isn't really a proof of
quality.
I agree. So it'll be great if Realtek can work with us here.
quoted
Still my concerns haven't been addressed. If ASPM is enabled and
there's a congestion in the chip it may take up to a second until ASPM
gets disabled. In this second traffic very likely is heavily affected.
Who takes care in case of problem reports?
I think we'll know that once the patch is merged in downstream kernel.
quoted
This is a massive change for basically all chip versions. And experience
shows that in case of problem reports Realtek never cares, even though
they are listed as maintainers. All I see is that they copy more and more
code from r8169 into their own drivers. This seems to indicate that they
consider quality of their own drivers as not sufficient.
I wonder why they don't want to put their efforts to r8169...
Obviously they are doing a great job for rtw88 and r8152.
quoted
Still my proposal: Apply this downstream, and if there are no complaints
after a few months it may be considered for mainline.
Yes that's my plan. But I'd still like it to be reviewed before
putting it to the downstream kernel.
quoted
Last but not least the formal issues:
- no cover letter
Will write it up once it's tested dowstream.
quoted
- no net/net-next annotation
Does it mean put "net/net-next" in the subject line?
On Sat, Aug 14, 2021 at 7:34 PM Heiner Kallweit [off-list ref] wrote:
On 13.08.2021 11:54, Kai-Heng Feng wrote:
quoted
On Fri, Aug 13, 2021 at 2:49 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 12.08.2021 17:53, Kai-Heng Feng wrote:
quoted
r8169 NICs on some platforms have abysmal speed when ASPM is enabled.
Same issue can be observed with older vendor drivers.
The issue is however solved by the latest vendor driver. There's a new
mechanism, which disables r8169's internal ASPM when the NIC traffic has
more than 10 packets, and vice versa.
Realtek confirmed that all their PCIe LAN NICs, r8106, r8168 and r8125
As we have Realtek in this mail thread:
Is it still in active use? I always think it's just a dummy address...
At least mails to this address are not bounced, and this address still is
in MAINTAINERS. But right, I've never any reaction on mails to this
address. So it may make sense to remove it from MAINTAINERS.
Not sure what the process would be to do this.
quoted
quoted
Typically hw issues affect 1-3 chip versions only. The ASPM problems seem
to have been existing for at least 15 years now, in every chip version.
It seems that even the new RTL8125 chip generation still has broken ASPM.
Is there a bug report for that?
No. This was referring to your statement that also r8125 vendor driver
includes this "dynamic ASPM" workaround. They wouldn't have done this
if RTL8125 had proper ASPM support, or?
They call it "performance tuning".
quoted
quoted
Why was this never fixed? ASPM not considered to be relevant? HW design
too broken?
IIUC, ASPM is extremely relevant to pass EU/US power consumption
regulation. So I really don't know why the situation under Linux is so
dire.
It's not something related to Linux, ASPM support in the Realtek chips
is simply broken. This needs to be fixed in HW.
The behavior we see may indicate that certain buffers in the chips are
too small to buffer traffic for full period of ASPM exit latency.
The smaller buffers is part of the reason why they are dirt cheap and
makes them so pervasive...
So the dynamic ASPM is actually a good thing because it can deal with
this defect and saves power at the same time.
Kai-Heng
quoted
Kai-Heng
quoted
quoted
use dynamic ASPM under Windows. So implement the same mechanism here to
resolve the issue.
Signed-off-by: Kai-Heng Feng <redacted>
---
v2:
- Use delayed_work instead of timer_list to avoid interrupt context
- Use mutex to serialize packet counter read/write
- Wording change
drivers/net/ethernet/realtek/r8169_main.c | 45 +++++++++++++++++++++++
1 file changed, 45 insertions(+)