* [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