Skip to contentSkip to conversation

arm64: enable ARCH_WANT_RELAX_ORDER for aarch64

PATCH In review Ding Tianhong 4 participants 8 messages Mar 13, 2017 – Apr 13, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: enable ARCH_WANT_RELAX_ORDER for aarch64

The ARCH_WANT_RELAX_ORDER will enable Relaxed Ordering (RO) which allows transactions that do not have any order of completion requirements to complete more efficiently compare to the Stricted Ordering (SO) for ixbge nic card. The system will see high write-to-memory performance when RO is enabled on the data transactions just like the SPARC did.

The aarch64 pcie controller could both support Relaxed Ordering (RO) and Stricted Ordering (SO), so enable ARCH_WANT_RELAX_ORDER for ixgbe nic card to get much more better performance, and didn't see any adverse effects.

Nic Card(Ixgbe) Disable RO | Enable RO
Performance(Per thread) 8.4Gb/s | 9.4Gb/s

Tested by Iperf on Hip06/Hip07 Soc Board.

---
 arch/arm64/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/Kconfig +1 -0
index 8c7c244..36249a3 100644
@@ -115,6 +115,7 @@ config ARM64
 	select SPARSE_IRQ
 	select SYSCTL_EXCEPTION_TRACE
 	select THREAD_INFO_IN_TASK
+	select ARCH_WANT_RELAX_ORDER
 	help
 	  ARM 64-bit (AArch64) Linux support.
 
Signature · 1 line
1.9.0
#1 lore raw
Quoted 4 lines · Ding Tianhong

The ARCH_WANT_RELAX_ORDER will enable Relaxed Ordering (RO) which allows transactions that do not have any order of completion requirements to complete more efficiently compare to the Stricted Ordering (SO) for ixbge nic card.

Which ixgbe NIC? As far as I can see we have an arch-level config option here which applies to one single driver, and doesn't even cover all the hardware supported by that driver (82598, for example, still has the #ifndef CONFIG_SPARC in the equivalent place). Looking at the history, I'd prefer to at least know what the "various issues with certain chipsets" were, and why they wouldn't affect ARM systems, before making any judgement about whether this could be considered universally safe for arm64.

Quoted 4 lines

The system will see high write-to-memory performance when RO is enabled on the data transactions just like the SPARC did.

The aarch64 pcie controller could both support Relaxed Ordering (RO)

What is "the AArch64 PCIe controller", exactly? Disregarding that talking of PCIe in terms of the CPU ISA makes little sense, I can barely name two ARMv8-based systems which nominally use the same PCIe IP, and the amount of various quirks and incompatibilities I'm aware of leaves me with the default assumption that any such unqualified blanket statement is probably wrong. I think we need some much more considered reasoning here.

Quoted 19 lines

and Stricted Ordering (SO), so enable ARCH_WANT_RELAX_ORDER for ixgbe nic card to get much more better performance, and didn't see any adverse effects.

Nic Card(Ixgbe) Disable RO | Enable RO
Performance(Per thread) 8.4Gb/s | 9.4Gb/s

Tested by Iperf on Hip06/Hip07 Soc Board.

---
 arch/arm64/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/Kconfig +0 -0
index 8c7c244..36249a3 100644

arch/arm64/Kconfig config ARM64 · line 118

Quoted 4 lines
arch/arm64/Kconfig +1 -0
@@ -115,6 +115,7 @@ config ARM64
 	select SPARSE_IRQ
 	select SYSCTL_EXCEPTION_TRACE
 	select THREAD_INFO_IN_TASK
+	select ARCH_WANT_RELAX_ORDER

I'd say the first order of business is to rename this config option to IXBGE_82599_WANT_RELAXED_ORDER so that it's not entirely misleading and ambiguous. At first glance it looks far more like something scary to do with memory barriers than a network driver option. Howcome this isn't just in drivers/net/intel/Kconfig as a "default y if SPARC" bool anyway?

Robin.

Quoted 3 lines
arch/arm64/Kconfig +0 -0
 	help
 	  ARM 64-bit (AArch64) Linux support.
 
#2 lore raw

Hi Robin?

Quoted 6 lines · Robin Murphy
Quoted 4 lines · Ding Tianhong

The ARCH_WANT_RELAX_ORDER will enable Relaxed Ordering (RO) which allows transactions that do not have any order of completion requirements to complete more efficiently compare to the Stricted Ordering (SO) for ixbge nic card.

Quoted 9 lines

Which ixgbe NIC? As far as I can see we have an arch-level config option here which applies to one single driver, and doesn't even cover all the hardware supported by that driver (82598, for example, still has the #ifndef CONFIG_SPARC in the equivalent place). Looking at the history, I'd prefer to at least know what the "various issues with certain chipsets" were, and why they wouldn't affect ARM systems, before making any judgement about whether this could be considered universally safe for arm64.

Indeed, in fact if the chipsets didn't support RO mode or has some errata for RO mode, it may occur some issues, but it looks no such aarch64 chips, maybe I miss something.

There are several intel nic card could support enable relax order, so need another patch to rename the SPARC to ARCH_WANT_RELAX_ORDER, the universal name looks more better.

Quoted 5 lines
Quoted 4 lines

The system will see high write-to-memory performance when RO is enabled on the data transactions just like the SPARC did.

The aarch64 pcie controller could both support Relaxed Ordering (RO)

Quoted 8 lines

What is "the AArch64 PCIe controller", exactly? Disregarding that talking of PCIe in terms of the CPU ISA makes little sense, I can barely name two ARMv8-based systems which nominally use the same PCIe IP, and the amount of various quirks and incompatibilities I'm aware of leaves me with the default assumption that any such unqualified blanket statement is probably wrong. I think we need some much more considered reasoning here.

Agree, till now I could only test on hip06/hip07 board and get the better performance, maybe I could test on other aarch64 platform.

Quoted 14 lines
Quoted 14 lines

and Stricted Ordering (SO), so enable ARCH_WANT_RELAX_ORDER for ixgbe nic card to get much more better performance, and didn't see any adverse effects.

Nic Card(Ixgbe) Disable RO | Enable RO
Performance(Per thread) 8.4Gb/s | 9.4Gb/s

Tested by Iperf on Hip06/Hip07 Soc Board.

---
 arch/arm64/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Quoted 12 lines

arch/arm64/Kconfig config ARM64 · line 118

Quoted 9 lines
arch/arm64/Kconfig +1 -0
index 8c7c244..36249a3 100644
@@ -115,6 +115,7 @@ config ARM64
 	select SPARSE_IRQ
 	select SYSCTL_EXCEPTION_TRACE
 	select THREAD_INFO_IN_TASK
+	select ARCH_WANT_RELAX_ORDER

I'd say the first order of business is to rename this config option to IXBGE_82599_WANT_RELAXED_ORDER so that it's not entirely misleading and

not only for 82599, including 82598, 82576....

Quoted 3 lines

ambiguous. At first glance it looks far more like something scary to do with memory barriers than a network driver option. Howcome this isn't just in drivers/net/intel/Kconfig as a "default y if SPARC" bool anyway?

didn't see any essential differences, and I still need to get some Acked by arm maintainer.

Quoted 1 line

Yes, more memory barriers always affect the performance especially for some architecture not just like sparc, any optimization should be taken seriously especially for aarch64.

Thanks.
Ding

Quoted 9 lines

Robin.

arch/arm64/Kconfig config ARM64 · line 121

Quoted 3 lines
arch/arm64/Kconfig +0 -0
 	help
 	  ARM 64-bit (AArch64) Linux support.
 

.

#3 lore raw
Quoted 21 lines · Ding Tianhong
Quoted 13 lines · Robin Murphy

arch/arm64/Kconfig config ARM64 · line 118

Quoted 9 lines · Ding Tianhong
arch/arm64/Kconfig +1 -0
index 8c7c244..36249a3 100644
@@ -115,6 +115,7 @@ config ARM64
 	select SPARSE_IRQ
 	select SYSCTL_EXCEPTION_TRACE
 	select THREAD_INFO_IN_TASK
+	select ARCH_WANT_RELAX_ORDER

I'd say the first order of business is to rename this config option to IXBGE_82599_WANT_RELAXED_ORDER so that it's not entirely misleading and

not only for 82599, including 82598, 82576....

Quoted 3 lines

ambiguous. At first glance it looks far more like something scary to do with memory barriers than a network driver option. Howcome this isn't just in drivers/net/intel/Kconfig as a "default y if SPARC" bool anyway?

Quoted 7 lines

didn't see any essential differences, and I still need to get some Acked by arm maintainer.

Quoted 1 line

Yes, more memory barriers always affect the performance especially for some architecture not just like sparc, any optimization should be taken seriously especially for aarch64.

If this is a legitimate optimisation to apply (which nobody seems to be sure about), then I'd *much* rather it was handled entirely in the driver and predicated on CONFIG_ARM64. I can't select ARCH_WANT_RELAX_ORDER without some notion of what on Earth that means, and whether or not other drivers can also use that to infer some property about the arm64 ordering model.

Will

#4 lore raw
In reply to Ding Tianhong
Quoted 19 lines · Ding Tianhong

Hi Robin?

Quoted 6 lines · Robin Murphy
Quoted 4 lines · Ding Tianhong

The ARCH_WANT_RELAX_ORDER will enable Relaxed Ordering (RO) which allows transactions that do not have any order of completion requirements to complete more efficiently compare to the Stricted Ordering (SO) for ixbge nic card.

Quoted 9 lines

Which ixgbe NIC? As far as I can see we have an arch-level config option here which applies to one single driver, and doesn't even cover all the hardware supported by that driver (82598, for example, still has the #ifndef CONFIG_SPARC in the equivalent place). Looking at the history, I'd prefer to at least know what the "various issues with certain chipsets" were, and why they wouldn't affect ARM systems, before making any judgement about whether this could be considered universally safe for arm64.

Quoted 5 lines

Indeed, in fact if the chipsets didn't support RO mode or has some errata for RO mode, it may occur some issues, but it looks no such aarch64 chips, maybe I miss something.

There are several intel nic card could support enable relax order, so need another patch to rename the SPARC to ARCH_WANT_RELAX_ORDER, the universal name looks more better.

I'm sure I'm not alone in disagreeing outright that it looks better, because ARCH_ is hardly the appropriate namespace for a driver option unrelated to an architecture port's interaction with core kernel code; plus it's further confounded by a name which both doesn't imply any relationship with said driver, and does overlap with the kind of CPU memory model terminology which *is* the purview of architecture ports.

As an equivalent example, consider how equally misleading it would be from the ARM maintainer perspective if CONFIG_IOMMU_IO_PGTABLE_LPAE was just called CONFIG_ARCH_WANT_LPAE and implemented in this manner.

Having looked into it, I see that "Relaxed Order" does actually turn out to be a specific PCIe term, but even in that context it doesn't apply at the arch level - that's going to be a matter for particular endpoints and particular host controllers and all the quirks in between.

Quoted 44 lines
Quoted 5 lines
Quoted 4 lines

The system will see high write-to-memory performance when RO is enabled on the data transactions just like the SPARC did.

The aarch64 pcie controller could both support Relaxed Ordering (RO)

Quoted 8 lines

What is "the AArch64 PCIe controller", exactly? Disregarding that talking of PCIe in terms of the CPU ISA makes little sense, I can barely name two ARMv8-based systems which nominally use the same PCIe IP, and the amount of various quirks and incompatibilities I'm aware of leaves me with the default assumption that any such unqualified blanket statement is probably wrong. I think we need some much more considered reasoning here.

Agree, till now I could only test on hip06/hip07 board and get the better performance, maybe I could test on other aarch64 platform.

Quoted 14 lines
Quoted 14 lines

and Stricted Ordering (SO), so enable ARCH_WANT_RELAX_ORDER for ixgbe nic card to get much more better performance, and didn't see any adverse effects.

Nic Card(Ixgbe) Disable RO | Enable RO
Performance(Per thread) 8.4Gb/s | 9.4Gb/s

Tested by Iperf on Hip06/Hip07 Soc Board.

---
 arch/arm64/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Quoted 12 lines

arch/arm64/Kconfig config ARM64 · line 118

Quoted 9 lines
arch/arm64/Kconfig +1 -0
index 8c7c244..36249a3 100644
@@ -115,6 +115,7 @@ config ARM64
 	select SPARSE_IRQ
 	select SYSCTL_EXCEPTION_TRACE
 	select THREAD_INFO_IN_TASK
+	select ARCH_WANT_RELAX_ORDER

I'd say the first order of business is to rename this config option to IXBGE_82599_WANT_RELAXED_ORDER so that it's not entirely misleading and

Quoted 1 line

not only for 82599, including 82598, 82576....

So why does ixgbe_start_hw_82598() still have the original #ifndef CONFIG_SPARC from 887012e80aea?

It was pretty clear from the outset that this is one of those patches for making a particular card go faster in a particular system based on what's available in the test lab - there's nothing inherently wrong with that, but if it were presented merely in those terms there would probably be a lot less to object to.

Quoted 5 lines
Quoted 3 lines

ambiguous. At first glance it looks far more like something scary to do with memory barriers than a network driver option. Howcome this isn't just in drivers/net/intel/Kconfig as a "default y if SPARC" bool anyway?

didn't see any essential differences, and I still need to get some Acked by arm maintainer.

The big difference is that had people done the sensible thing by adding, say, CONFIG_IXGBE_ALLOW_RELAXED_ORDER to drivers/net/intel/... and sending a self-contained patch through the net tree, architecture maintainers wouldn't even need to be aware, let alone ack anything. Then in future if someone sends another patch against the net tree changing "y if (SPARC || ARM64)" back to "y if SPARC" because it happens to break on their system, the resulting discussion and resolution can happen on netdev, and architecture maintainers who aren't necessarily familiar with particular ixgbe/PCIe hardware details *still* don't need to care.

Robin.

#5 lore raw
Quoted 113 lines · Robin Murphy
Quoted 19 lines · Ding Tianhong

Hi Robin?

Quoted 6 lines · Robin Murphy
Quoted 4 lines · Ding Tianhong

The ARCH_WANT_RELAX_ORDER will enable Relaxed Ordering (RO) which allows transactions that do not have any order of completion requirements to complete more efficiently compare to the Stricted Ordering (SO) for ixbge nic card.

Quoted 9 lines

Which ixgbe NIC? As far as I can see we have an arch-level config option here which applies to one single driver, and doesn't even cover all the hardware supported by that driver (82598, for example, still has the #ifndef CONFIG_SPARC in the equivalent place). Looking at the history, I'd prefer to at least know what the "various issues with certain chipsets" were, and why they wouldn't affect ARM systems, before making any judgement about whether this could be considered universally safe for arm64.

Quoted 5 lines

Indeed, in fact if the chipsets didn't support RO mode or has some errata for RO mode, it may occur some issues, but it looks no such aarch64 chips, maybe I miss something.

There are several intel nic card could support enable relax order, so need another patch to rename the SPARC to ARCH_WANT_RELAX_ORDER, the universal name looks more better.

I'm sure I'm not alone in disagreeing outright that it looks better, because ARCH_ is hardly the appropriate namespace for a driver option unrelated to an architecture port's interaction with core kernel code; plus it's further confounded by a name which both doesn't imply any relationship with said driver, and does overlap with the kind of CPU memory model terminology which *is* the purview of architecture ports.

As an equivalent example, consider how equally misleading it would be from the ARM maintainer perspective if CONFIG_IOMMU_IO_PGTABLE_LPAE was just called CONFIG_ARCH_WANT_LPAE and implemented in this manner.

Having looked into it, I see that "Relaxed Order" does actually turn out to be a specific PCIe term, but even in that context it doesn't apply at the arch level - that's going to be a matter for particular endpoints and particular host controllers and all the quirks in between.

Quoted 44 lines
Quoted 5 lines
Quoted 4 lines

The system will see high write-to-memory performance when RO is enabled on the data transactions just like the SPARC did.

The aarch64 pcie controller could both support Relaxed Ordering (RO)

Quoted 8 lines

What is "the AArch64 PCIe controller", exactly? Disregarding that talking of PCIe in terms of the CPU ISA makes little sense, I can barely name two ARMv8-based systems which nominally use the same PCIe IP, and the amount of various quirks and incompatibilities I'm aware of leaves me with the default assumption that any such unqualified blanket statement is probably wrong. I think we need some much more considered reasoning here.

Agree, till now I could only test on hip06/hip07 board and get the better performance, maybe I could test on other aarch64 platform.

Quoted 14 lines
Quoted 14 lines

and Stricted Ordering (SO), so enable ARCH_WANT_RELAX_ORDER for ixgbe nic card to get much more better performance, and didn't see any adverse effects.

Nic Card(Ixgbe) Disable RO | Enable RO
Performance(Per thread) 8.4Gb/s | 9.4Gb/s

Tested by Iperf on Hip06/Hip07 Soc Board.

---
 arch/arm64/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Quoted 12 lines

arch/arm64/Kconfig config ARM64 · line 118

Quoted 9 lines
arch/arm64/Kconfig +1 -0
index 8c7c244..36249a3 100644
@@ -115,6 +115,7 @@ config ARM64
 	select SPARSE_IRQ
 	select SYSCTL_EXCEPTION_TRACE
 	select THREAD_INFO_IN_TASK
+	select ARCH_WANT_RELAX_ORDER

I'd say the first order of business is to rename this config option to IXBGE_82599_WANT_RELAXED_ORDER so that it's not entirely misleading and

Quoted 1 line

not only for 82599, including 82598, 82576....

So why does ixgbe_start_hw_82598() still have the original #ifndef CONFIG_SPARC from 887012e80aea?

It was pretty clear from the outset that this is one of those patches for making a particular card go faster in a particular system based on what's available in the test lab - there's nothing inherently wrong with that, but if it were presented merely in those terms there would probably be a lot less to object to.

Quoted 5 lines
Quoted 3 lines

ambiguous. At first glance it looks far more like something scary to do with memory barriers than a network driver option. Howcome this isn't just in drivers/net/intel/Kconfig as a "default y if SPARC" bool anyway?

didn't see any essential differences, and I still need to get some Acked by arm maintainer.

The big difference is that had people done the sensible thing by adding, say, CONFIG_IXGBE_ALLOW_RELAXED_ORDER to drivers/net/intel/... and sending a self-contained patch through the net tree, architecture maintainers wouldn't even need to be aware, let alone ack anything. Then in future if someone sends another patch against the net tree changing "y if (SPARC || ARM64)" back to "y if SPARC" because it happens to break on their system, the resulting discussion and resolution can happen on netdev, and architecture maintainers who aren't necessarily familiar with particular ixgbe/PCIe hardware details *still* don't need to care.

Quoted 2 lines

Robin.

Ok, after a period of thinking and verification, I believe it is not only affect for hisilicon, and will try to find a better way to fix this according to your opinions, thanks.

Ding

Quoted 2 lines

.

#6 lore raw
In reply to Robin Murphy

Hi Robin and all

Quoted 57 lines

-----Original Message-----
From: linux-kernel-owner at vger.kernel.org [mailto:linux-kernel- owner at vger.kernel.org] On Behalf Of Robin Murphy
Sent: 20 March 2017 14:00
To: Dingtianhong; Catalin Marinas; Will Deacon; linux-arm- kernel at lists.infradead.org; linux-kernel at vger.kernel.org
Cc: alexander.duyck at gmail.com; maowenan
Subject: Re: [PATCH] arm64: enable ARCH_WANT_RELAX_ORDER for aarch64

Quoted 5 lines · Ding Tianhong

Hi Robin?

Quoted 2 lines · Robin Murphy
Quoted 1 line · Ding Tianhong

The ARCH_WANT_RELAX_ORDER will enable Relaxed Ordering (RO) which

allows

Quoted 1 line
Quoted 1 line
Quoted 1 line

transactions that do not have any order of completion requirements

to

Quoted 1 line
Quoted 1 line
Quoted 1 line

complete more efficiently compare to the Stricted Ordering (SO) for

ixbge

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

nic card.

Which ixgbe NIC? As far as I can see we have an arch-level config

option

Quoted 1 line
Quoted 1 line

here which applies to one single driver, and doesn't even cover all

the

Quoted 2 lines
Quoted 2 lines

hardware supported by that driver (82598, for example, still has the #ifndef CONFIG_SPARC in the equivalent place). Looking at the

history,

Quoted 2 lines
Quoted 2 lines

I'd prefer to at least know what the "various issues with certain chipsets" were, and why they wouldn't affect ARM systems, before

making

Quoted 1 line
Quoted 1 line

any judgement about whether this could be considered universally

safe

Quoted 4 lines
Quoted 2 lines

for arm64.

Indeed, in fact if the chipsets didn't support RO mode or has some

errata for RO mode, it may

Quoted 1 line

occur some issues, but it looks no such aarch64 chips, maybe I miss

something.

Quoted 2 lines

There are several intel nic card could support enable relax order, so

need another patch to rename the SPARC

Quoted 1 line

to ARCH_WANT_RELAX_ORDER, the universal name looks more better.

I'm sure I'm not alone in disagreeing outright that it looks better, because ARCH_ is hardly the appropriate namespace for a driver option unrelated to an architecture port's interaction with core kernel code; plus it's further confounded by a name which both doesn't imply any relationship with said driver, and does overlap with the kind of CPU memory model terminology which *is* the purview of architecture ports.

As an equivalent example, consider how equally misleading it would be from the ARM maintainer perspective if CONFIG_IOMMU_IO_PGTABLE_LPAE was just called CONFIG_ARCH_WANT_LPAE and implemented in this manner.

Quoted 6 lines

Having looked into it, I see that "Relaxed Order" does actually turn out
to be a specific PCIe term, but even in that context it doesn't apply at
the arch level - that's going to be a matter for particular endpoints and particular host controllers and all the quirks in between.

I fully agree on this and to be honest I don't understand how <<commit 1a8b6d76dc5b "net:add one common config ARCH_WANT_RELAX_ORDER to support relax ordering">> has landed into mainline...

Quoted 76 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

The system will see high write-to-memory performance when RO is enabled on the data transactions just like the SPARC did.

The aarch64 pcie controller could both support Relaxed Ordering

(RO)

Quoted 3 lines
Quoted 3 lines

What is "the AArch64 PCIe controller", exactly? Disregarding that talking of PCIe in terms of the CPU ISA makes little sense, I can

barely

Quoted 1 line
Quoted 1 line

name two ARMv8-based systems which nominally use the same PCIe IP,

and

Quoted 1 line
Quoted 1 line

the amount of various quirks and incompatibilities I'm aware of

leaves

Quoted 2 lines
Quoted 2 lines

me with the default assumption that any such unqualified blanket statement is probably wrong. I think we need some much more

considered

Quoted 4 lines
Quoted 2 lines

reasoning here.

Agree, till now I could only test on hip06/hip07 board and get the

better performance,

Quoted 3 lines

maybe I could test on other aarch64 platform.

Quoted 1 line
Quoted 1 line

and Stricted Ordering (SO), so enable ARCH_WANT_RELAX_ORDER for

ixgbe

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

nic card to get much more better performance, and didn't see any adverse effects.

Nic Card(Ixgbe) Disable RO | Enable RO
Performance(Per thread) 8.4Gb/s | 9.4Gb/s

Tested by Iperf on Hip06/Hip07 Soc Board.

---
 arch/arm64/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines
Quoted 11 lines

arch/arm64/Kconfig config ARM64 · line 118

Quoted 9 lines
arch/arm64/Kconfig +1 -0
index 8c7c244..36249a3 100644
@@ -115,6 +115,7 @@ config ARM64
 	select SPARSE_IRQ
 	select SYSCTL_EXCEPTION_TRACE
 	select THREAD_INFO_IN_TASK
+	select ARCH_WANT_RELAX_ORDER

I'd say the first order of business is to rename this config option

to

Quoted 1 line
Quoted 1 line

IXBGE_82599_WANT_RELAXED_ORDER so that it's not entirely misleading

and

Quoted 2 lines

not only for 82599, including 82598, 82576....

So why does ixgbe_start_hw_82598() still have the original #ifndef CONFIG_SPARC from 887012e80aea?

It was pretty clear from the outset that this is one of those patches for making a particular card go faster in a particular system based on what's available in the test lab - there's nothing inherently wrong with
that, but if it were presented merely in those terms there would probably be a lot less to object to.

Quoted 1 line
Quoted 1 line

ambiguous. At first glance it looks far more like something scary to

do

Quoted 1 line
Quoted 1 line

with memory barriers than a network driver option. Howcome this

isn't

Quoted 1 line
Quoted 1 line

just in drivers/net/intel/Kconfig as a "default y if SPARC" bool

anyway?

Quoted 2 lines

didn't see any essential differences, and I still need to get some

Acked by arm maintainer.

Quoted 12 lines

The big difference is that had people done the sensible thing by adding,
say, CONFIG_IXGBE_ALLOW_RELAXED_ORDER to drivers/net/intel/... and sending a self-contained patch through the net tree, architecture maintainers wouldn't even need to be aware, let alone ack anything. Then
in future if someone sends another patch against the net tree changing "y if (SPARC || ARM64)" back to "y if SPARC" because it happens to break
on their system, the resulting discussion and resolution can happen on netdev, and architecture maintainers who aren't necessarily familiar with particular ixgbe/PCIe hardware details *still* don't need to care.

Standard PCIe drivers uses bit 4 of the Device Control Register to enable/disable relaxed ordering: here it is not clear what Intel means by relaxed ordering and in which context (at least not to me) and why it should be disabled by default.

Quoted 1 line

From my perspective I would try to propose the following patch as RFC

and see what the Intel maintainer comes up with and if any other ARM64 host vendor would oppose to it.
The RFC below reverts commit 1a8b6d76dc5b and enable relaxed ordering on SPARC and ARM64 machines...

What do you think?

arch/Kconfig +0 -3
index cd211a1..e03d354 100644
@@ -844,7 +844,4 @@ config STRICT_MODULE_RWX
 	  and non-text memory will be made non-executable. This provides
 	  protection against certain security exploits (e.g. writing to text)
 
-config ARCH_WANT_RELAX_ORDER
-	bool
-
 source "kernel/gcov/Kconfig"
arch/sparc/Kconfig +0 -1
index 68ac5c7..cf4034c 100644
@@ -44,7 +44,6 @@ config SPARC
 	select CPU_NO_EFFICIENT_FFS
 	select HAVE_ARCH_HARDENED_USERCOPY
 	select PROVE_LOCKING_SMALL if PROVE_LOCKING
-	select ARCH_WANT_RELAX_ORDER
 
 config SPARC32
 	def_bool !64BIT
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +2 -1
index c38d50c..d55dcac 100644
@@ -350,7 +350,8 @@ s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw)
 	}
 	IXGBE_WRITE_FLUSH(hw);
 
-#ifndef CONFIG_ARCH_WANT_RELAX_ORDER
+#if !defined(CONFIG_SPARC) && !defined(CONFIG_ARM64)
+
 	/* Disable relaxed ordering */
 	for (i = 0; i < hw->mac.max_tx_queues; i++) {
 		u32 regval;
Quoted 2 lines

Robin.

#7 lore raw
Quoted 165 lines · Gabriele Paoloni

Hi Robin and all

Quoted 57 lines

-----Original Message-----
From: linux-kernel-owner at vger.kernel.org [mailto:linux-kernel- owner at vger.kernel.org] On Behalf Of Robin Murphy
Sent: 20 March 2017 14:00
To: Dingtianhong; Catalin Marinas; Will Deacon; linux-arm- kernel at lists.infradead.org; linux-kernel at vger.kernel.org
Cc: alexander.duyck at gmail.com; maowenan
Subject: Re: [PATCH] arm64: enable ARCH_WANT_RELAX_ORDER for aarch64

Quoted 5 lines · Ding Tianhong

Hi Robin?

Quoted 2 lines · Robin Murphy
Quoted 1 line · Ding Tianhong

The ARCH_WANT_RELAX_ORDER will enable Relaxed Ordering (RO) which

allows

Quoted 1 line
Quoted 1 line
Quoted 1 line

transactions that do not have any order of completion requirements

to

Quoted 1 line
Quoted 1 line
Quoted 1 line

complete more efficiently compare to the Stricted Ordering (SO) for

ixbge

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

nic card.

Which ixgbe NIC? As far as I can see we have an arch-level config

option

Quoted 1 line
Quoted 1 line

here which applies to one single driver, and doesn't even cover all

the

Quoted 2 lines
Quoted 2 lines

hardware supported by that driver (82598, for example, still has the #ifndef CONFIG_SPARC in the equivalent place). Looking at the

history,

Quoted 2 lines
Quoted 2 lines

I'd prefer to at least know what the "various issues with certain chipsets" were, and why they wouldn't affect ARM systems, before

making

Quoted 1 line
Quoted 1 line

any judgement about whether this could be considered universally

safe

Quoted 4 lines
Quoted 2 lines

for arm64.

Indeed, in fact if the chipsets didn't support RO mode or has some

errata for RO mode, it may

Quoted 1 line

occur some issues, but it looks no such aarch64 chips, maybe I miss

something.

Quoted 2 lines

There are several intel nic card could support enable relax order, so

need another patch to rename the SPARC

Quoted 1 line

to ARCH_WANT_RELAX_ORDER, the universal name looks more better.

I'm sure I'm not alone in disagreeing outright that it looks better, because ARCH_ is hardly the appropriate namespace for a driver option unrelated to an architecture port's interaction with core kernel code; plus it's further confounded by a name which both doesn't imply any relationship with said driver, and does overlap with the kind of CPU memory model terminology which *is* the purview of architecture ports.

As an equivalent example, consider how equally misleading it would be from the ARM maintainer perspective if CONFIG_IOMMU_IO_PGTABLE_LPAE was just called CONFIG_ARCH_WANT_LPAE and implemented in this manner.

Quoted 6 lines

Having looked into it, I see that "Relaxed Order" does actually turn out
to be a specific PCIe term, but even in that context it doesn't apply at
the arch level - that's going to be a matter for particular endpoints and particular host controllers and all the quirks in between.

I fully agree on this and to be honest I don't understand how <<commit 1a8b6d76dc5b "net:add one common config ARCH_WANT_RELAX_ORDER to support relax ordering">> has landed into mainline...

Quoted 76 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

The system will see high write-to-memory performance when RO is enabled on the data transactions just like the SPARC did.

The aarch64 pcie controller could both support Relaxed Ordering

(RO)

Quoted 3 lines
Quoted 3 lines

What is "the AArch64 PCIe controller", exactly? Disregarding that talking of PCIe in terms of the CPU ISA makes little sense, I can

barely

Quoted 1 line
Quoted 1 line

name two ARMv8-based systems which nominally use the same PCIe IP,

and

Quoted 1 line
Quoted 1 line

the amount of various quirks and incompatibilities I'm aware of

leaves

Quoted 2 lines
Quoted 2 lines

me with the default assumption that any such unqualified blanket statement is probably wrong. I think we need some much more

considered

Quoted 4 lines
Quoted 2 lines

reasoning here.

Agree, till now I could only test on hip06/hip07 board and get the

better performance,

Quoted 3 lines

maybe I could test on other aarch64 platform.

Quoted 1 line
Quoted 1 line

and Stricted Ordering (SO), so enable ARCH_WANT_RELAX_ORDER for

ixgbe

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

nic card to get much more better performance, and didn't see any adverse effects.

Nic Card(Ixgbe) Disable RO | Enable RO
Performance(Per thread) 8.4Gb/s | 9.4Gb/s

Tested by Iperf on Hip06/Hip07 Soc Board.

---
 arch/arm64/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines
Quoted 11 lines

arch/arm64/Kconfig config ARM64 · line 118

Quoted 9 lines
arch/arm64/Kconfig +1 -0
index 8c7c244..36249a3 100644
@@ -115,6 +115,7 @@ config ARM64
 	select SPARSE_IRQ
 	select SYSCTL_EXCEPTION_TRACE
 	select THREAD_INFO_IN_TASK
+	select ARCH_WANT_RELAX_ORDER

I'd say the first order of business is to rename this config option

to

Quoted 1 line
Quoted 1 line

IXBGE_82599_WANT_RELAXED_ORDER so that it's not entirely misleading

and

Quoted 2 lines

not only for 82599, including 82598, 82576....

So why does ixgbe_start_hw_82598() still have the original #ifndef CONFIG_SPARC from 887012e80aea?

It was pretty clear from the outset that this is one of those patches for making a particular card go faster in a particular system based on what's available in the test lab - there's nothing inherently wrong with
that, but if it were presented merely in those terms there would probably be a lot less to object to.

Quoted 1 line
Quoted 1 line

ambiguous. At first glance it looks far more like something scary to

do

Quoted 1 line
Quoted 1 line

with memory barriers than a network driver option. Howcome this

isn't

Quoted 1 line
Quoted 1 line

just in drivers/net/intel/Kconfig as a "default y if SPARC" bool

anyway?

Quoted 2 lines

didn't see any essential differences, and I still need to get some

Acked by arm maintainer.

Quoted 12 lines

The big difference is that had people done the sensible thing by adding,
say, CONFIG_IXGBE_ALLOW_RELAXED_ORDER to drivers/net/intel/... and sending a self-contained patch through the net tree, architecture maintainers wouldn't even need to be aware, let alone ack anything. Then
in future if someone sends another patch against the net tree changing "y if (SPARC || ARM64)" back to "y if SPARC" because it happens to break
on their system, the resulting discussion and resolution can happen on netdev, and architecture maintainers who aren't necessarily familiar with particular ixgbe/PCIe hardware details *still* don't need to care.

Standard PCIe drivers uses bit 4 of the Device Control Register to enable/disable relaxed ordering: here it is not clear what Intel means by relaxed ordering and in which context (at least not to me) and why it should be disabled by default.

Quoted 8 lines

From my perspective I would try to propose the following patch as RFC and see what the Intel maintainer comes up with and if any other ARM64 host vendor would oppose to it.
The RFC below reverts commit 1a8b6d76dc5b and enable relaxed ordering on SPARC and ARM64 machines...

What do you think?

Hi Gab:

Till now I didn't get any useful feedback from the latest version patches, it is really hard to unify everyone's opinion, I will follow your solution and send a new version patch, thanks.

Ding

Quoted 43 lines
arch/Kconfig +0 -3
index cd211a1..e03d354 100644
@@ -844,7 +844,4 @@ config STRICT_MODULE_RWX
 	  and non-text memory will be made non-executable. This provides
 	  protection against certain security exploits (e.g. writing to text)
 
-config ARCH_WANT_RELAX_ORDER
-	bool
-
 source "kernel/gcov/Kconfig"
arch/sparc/Kconfig +0 -1
index 68ac5c7..cf4034c 100644
@@ -44,7 +44,6 @@ config SPARC
 	select CPU_NO_EFFICIENT_FFS
 	select HAVE_ARCH_HARDENED_USERCOPY
 	select PROVE_LOCKING_SMALL if PROVE_LOCKING
-	select ARCH_WANT_RELAX_ORDER
 
 config SPARC32
 	def_bool !64BIT
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +2 -1
index c38d50c..d55dcac 100644
@@ -350,7 +350,8 @@ s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw)
 	}
 	IXGBE_WRITE_FLUSH(hw);
 
-#ifndef CONFIG_ARCH_WANT_RELAX_ORDER
+#if !defined(CONFIG_SPARC) && !defined(CONFIG_ARM64)
+
 	/* Disable relaxed ordering */
 	for (i = 0; i < hw->mac.max_tx_queues; i++) {
 		u32 regval;
Quoted 4 lines

Robin.