netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] net: ixgbe: disable relaxed ordering at runtime
@ 2017-05-02  9:59 Gabriele Paoloni
  2017-05-02  9:59 ` [RFC PATCH 1/2] net: revert commit 1a8b6d76dc5b Gabriele Paoloni
  2017-05-02  9:59 ` [RFC PATCH 2/2] net: ixgbe: disable RO depending on the root port flags Gabriele Paoloni
  0 siblings, 2 replies; 3+ messages in thread
From: Gabriele Paoloni @ 2017-05-02  9:59 UTC (permalink / raw)
  To: davem, alexander.duyck
  Cc: mark.rutland, gabriele.paoloni, asit.k.mallick, catalin.marinas,
	will.deacon, linuxarm, ashok.raj, helgaas, ganeshgr,
	dingtianhong, jeffrey.t.kirsher, leedom, leedom,
	patrick.j.cramer, arjun, werner, linux-arm-kernel, amira, netdev,
	David.Laight, robin.murphy, davem

From: gabriele paoloni <gabriele.paoloni@huawei.com>

This patchset is based on Casey's patchset:
https://www.spinics.net/lists/arm-kernel/msg578927.html

It is a proposal to convert the ixgbe driver to disable RO at runtime
depending on the root port flags.

TODO: Casey's patchset above add quirks to disable RO only for Intel
E5-26xx and AMD ARM A1100, whereas currently the Intel ixgbe driver
disable RO by default. Therefore there may be some other host quirks
to be added in drivers/pci/quirks....

gabriele paoloni (2):
  net: revert commit 1a8b6d76dc5b
  net: ixgbe: disable RO depending on the root port flags

 arch/Kconfig                                    |  3 ---
 arch/sparc/Kconfig                              |  1 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 35 ++++++++++++++-----------
 3 files changed, 20 insertions(+), 19 deletions(-)

-- 
2.7.4

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

* [RFC PATCH 1/2] net: revert commit 1a8b6d76dc5b
  2017-05-02  9:59 [RFC PATCH 0/2] net: ixgbe: disable relaxed ordering at runtime Gabriele Paoloni
@ 2017-05-02  9:59 ` Gabriele Paoloni
  2017-05-02  9:59 ` [RFC PATCH 2/2] net: ixgbe: disable RO depending on the root port flags Gabriele Paoloni
  1 sibling, 0 replies; 3+ messages in thread
From: Gabriele Paoloni @ 2017-05-02  9:59 UTC (permalink / raw)
  To: davem, alexander.duyck
  Cc: gabriele.paoloni, helgaas, leedom, leedom, linuxarm, werner,
	ganeshgr, arjun, asit.k.mallick, patrick.j.cramer, ashok.raj,
	dingtianhong, mark.rutland, amira, catalin.marinas, will.deacon,
	David.Laight, jeffrey.t.kirsher, netdev, robin.murphy, davem,
	linux-arm-kernel

From: gabriele paoloni <gabriele.paoloni@huawei.com>

commit 1a8b6d76dc5b was introducing relaxed ordering as global
symbol. This does not make sense as relaxed ordering support
depends on the PCIe EP and on the Root Complex (therefore it is
not related to the CPU architecture)

Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
---
 arch/Kconfig                                    | 3 ---
 arch/sparc/Kconfig                              | 1 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 2 +-
 3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index c4d6833..c0b118d 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -851,7 +851,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"
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index ed96869..3f47142 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -43,7 +43,6 @@ config SPARC
 	select ARCH_HAS_SG_CHAIN
 	select CPU_NO_EFFICIENT_FFS
 	select LOCKDEP_SMALL if LOCKDEP
-	select ARCH_WANT_RELAX_ORDER
 
 config SPARC32
 	def_bool !64BIT
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
index c38d50c..094e1d6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
@@ -350,7 +350,7 @@ s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw)
 	}
 	IXGBE_WRITE_FLUSH(hw);
 
-#ifndef CONFIG_ARCH_WANT_RELAX_ORDER
+#ifndef CONFIG_SPARC
 	/* Disable relaxed ordering */
 	for (i = 0; i < hw->mac.max_tx_queues; i++) {
 		u32 regval;
-- 
2.7.4

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

* [RFC PATCH 2/2] net: ixgbe: disable RO depending on the root port flags
  2017-05-02  9:59 [RFC PATCH 0/2] net: ixgbe: disable relaxed ordering at runtime Gabriele Paoloni
  2017-05-02  9:59 ` [RFC PATCH 1/2] net: revert commit 1a8b6d76dc5b Gabriele Paoloni
@ 2017-05-02  9:59 ` Gabriele Paoloni
  1 sibling, 0 replies; 3+ messages in thread
From: Gabriele Paoloni @ 2017-05-02  9:59 UTC (permalink / raw)
  To: davem, alexander.duyck
  Cc: gabriele.paoloni, helgaas, leedom, leedom, linuxarm, werner,
	ganeshgr, arjun, asit.k.mallick, patrick.j.cramer, ashok.raj,
	dingtianhong, mark.rutland, amira, catalin.marinas, will.deacon,
	David.Laight, jeffrey.t.kirsher, netdev, robin.murphy, davem,
	linux-arm-kernel

From: gabriele paoloni <gabriele.paoloni@huawei.com>

Intel ixgbe drivers currently disable relaxed ordering at
compilation time depending on the host architecture. This is wrong
as RO support depends either on the root complex implementation
and/or on the EP itself and/or both.

This patch checks at runtime the root port flag
PCI_DEV_FLAGS_NO_RELAXED_ORDERING to be set in order to disable RO.

Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 35 ++++++++++++++-----------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
index 094e1d6..597cb7b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
@@ -342,6 +342,8 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw)
 s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw)
 {
 	u32 i;
+	struct pci_dev *root;
+	struct ixgbe_adapter *adapter;
 
 	/* Clear the rate limiters */
 	for (i = 0; i < hw->mac.max_tx_queues; i++) {
@@ -350,25 +352,28 @@ s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw)
 	}
 	IXGBE_WRITE_FLUSH(hw);
 
-#ifndef CONFIG_SPARC
-	/* Disable relaxed ordering */
-	for (i = 0; i < hw->mac.max_tx_queues; i++) {
-		u32 regval;
+	adapter = container_of(hw, struct ixgbe_adapter, hw);
+	root = pci_find_pcie_root_port(adapter->pdev);
 
-		regval = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i));
-		regval &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN;
-		IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), regval);
-	}
+	if (root && (root->dev_flags & PCI_DEV_FLAGS_NO_RELAXED_ORDERING)) {
+		/* Disable relaxed ordering */
+		for (i = 0; i < hw->mac.max_tx_queues; i++) {
+			u32 regval;
 
-	for (i = 0; i < hw->mac.max_rx_queues; i++) {
-		u32 regval;
+			regval = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i));
+			regval &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN;
+			IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), regval);
+		}
+
+		for (i = 0; i < hw->mac.max_rx_queues; i++) {
+			u32 regval;
 
-		regval = IXGBE_READ_REG(hw, IXGBE_DCA_RXCTRL(i));
-		regval &= ~(IXGBE_DCA_RXCTRL_DATA_WRO_EN |
-			    IXGBE_DCA_RXCTRL_HEAD_WRO_EN);
-		IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval);
+			regval = IXGBE_READ_REG(hw, IXGBE_DCA_RXCTRL(i));
+			regval &= ~(IXGBE_DCA_RXCTRL_DATA_WRO_EN |
+					IXGBE_DCA_RXCTRL_HEAD_WRO_EN);
+			IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval);
+		}
 	}
-#endif
 	return 0;
 }
 
-- 
2.7.4

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

end of thread, other threads:[~2017-05-02 10:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-02  9:59 [RFC PATCH 0/2] net: ixgbe: disable relaxed ordering at runtime Gabriele Paoloni
2017-05-02  9:59 ` [RFC PATCH 1/2] net: revert commit 1a8b6d76dc5b Gabriele Paoloni
2017-05-02  9:59 ` [RFC PATCH 2/2] net: ixgbe: disable RO depending on the root port flags Gabriele Paoloni

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).