Some devices have problems with Transaction Layer Packets with the Relaxed
Ordering Attribute set. This patch set adds a new PCIe Device Flag,
PCI_DEV_FLAGS_NO_RELAXED_ORDERING, a set of PCI Quirks to catch some known
devices with Relaxed Ordering issues, and a use of this new flag by the
cxgb4 driver to avoid using Relaxed Ordering with problematic Root Complex
Ports.
It's been years since I've submitted kernel.org patches, I appolgise for the
almost certain submission errors.
v2: Alexander point out that the v1 was only a part of the whole solution,
some platform which has some issues could use the new flag to indicate
that it is not safe to enable relaxed ordering attribute, then we need
to clear the relaxed ordering enable bits in the PCI configuration when
initializing the device. So add a new second patch to modify the PCI
initialization code to clear the relaxed ordering enable bit in the
event that the root complex doesn't want relaxed ordering enabled.
The third patch was base on the v1's second patch and only be changed
to query the relaxed ordering enable bit in the PCI configuration space
to allow the Chelsio NIC to send TLPs with the relaxed ordering attributes
set.
This version didn't plan to drop the defines for Intel Drivers to use the
new checking way to enable relaxed ordering because it is not the hardest
part of the moment, we could fix it in next patchset when this patches
reach the goal.
v3: Redesigned the logic for pci_configure_relaxed_ordering when configuration,
If a PCIe device didn't enable the relaxed ordering attribute default,
we should not do anything in the PCIe configuration, otherwise we
should check if any of the devices above us do not support relaxed
ordering by the PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag, then base on
the result if we get a return that indicate that the relaxed ordering
is not supported we should update our device to disable relaxed ordering
in configuration space. If the device above us doesn't exist or isn't
the PCIe device, we shouldn't do anything and skip updating relaxed ordering
because we are probably running in a guest.
v4: Rename the functions pcie_get_relaxed_ordering and pcie_disable_relaxed_ordering
according John's suggestion, and modify the description, use the true/false
as the return value.
We shouldn't enable relaxed ordering attribute by the setting in the root
complex configuration space for PCIe device, so fix it for cxgb4.
Fix some format issues.
v5: Removed the unnecessary code for some function which only return the bool
value, and add the check for VF device.
Make this patch set base on 4.12-rc5.
v6: Fix the logic error in the need to enable the relaxed ordering attribute for cxgb4.
v7: The cxgb4 drivers will enable the PCIe Capability Device Control[Relaxed
Ordering Enable] in PCI Probe() routine, this will break our current
solution for some platform which has problematic when enable the relaxed
ordering attribute. According to the latest recommendations, remove the
enable_pcie_relaxed_ordering(), although it could not cover the Peer-to-Peer
scene, but we agree to leave this problem until we really trigger it.
Make this patch set base on 4.12 release version.
v8: Modify the change log for first 2 patches to make it more reasonable, and
add the Acked-by from Alex and Ashok.
Add a new patch to enable the Relaxed Ordering Attribute for cxgb4vf driver.
Make this patch set base on 4.13-rc2.
Casey Leedom (3):
PCI: Add new PCIe Fabric End Node flag,
PCI_DEV_FLAGS_NO_RELAXED_ORDERING
net/cxgb4: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag
net/cxgb4vf: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag
Ding Tianhong (1):
PCI: Disable PCIe Relaxed Ordering if unsupported
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 +
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 23 +++++++++----
drivers/net/ethernet/chelsio/cxgb4/sge.c | 5 +--
drivers/net/ethernet/chelsio/cxgb4vf/adapter.h | 1 +
.../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 18 ++++++++++
drivers/net/ethernet/chelsio/cxgb4vf/sge.c | 3 ++
drivers/pci/pci.c | 29 +++++++++++++++++
drivers/pci/probe.c | 37 +++++++++++++++++++++
drivers/pci/quirks.c | 38 ++++++++++++++++++++++
include/linux/pci.h | 4 +++
10 files changed, 151 insertions(+), 8 deletions(-)
--
1.8.3.1
From: Casey Leedom <redacted>
cxgb4vf Ethernet driver now queries PCIe configuration space to
determine if it can send TLPs to it with the Relaxed Ordering
Attribute set, just like the pf did.
Signed-off-by: Casey Leedom <redacted>
Signed-off-by: Ding Tianhong <redacted>
Reviewed-by: Casey Leedom <redacted>
---
drivers/net/ethernet/chelsio/cxgb4vf/adapter.h | 1 +
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 18 ++++++++++++++++++
drivers/net/ethernet/chelsio/cxgb4vf/sge.c | 3 +++
3 files changed, 22 insertions(+)
@@ -2888,6 +2888,24 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,*/adapter->name=pci_name(pdev);adapter->msg_enable=DFLT_MSG_ENABLE;++/* If possible, we use PCIe Relaxed Ordering Attribute to deliver+*IngressPacketDatatoFreeListBuffersinordertoallowfor+*chipsetperformanceoptimizationsbetweentheRootComplexand+*MemoryControllers.(MessagestotheassociatedIngressQueue+*notifyingnewPacketPlacementintheFreeListsBufferswillbe+*sendwithouttheRelaxedOrderingAttributethusguaranteeingthat+*allprecedingPCIeTransactionLayerPacketswillbeprocessed+*first.)ButsomeRootComplexeshavevariousissueswithUpstream+*TransactionLayerPacketswiththeRelaxedOrderingAttributeset.+*ThePCIedeviceswhichundertheRootComplexeswillbeclearedthe+*RelaxedOrderingbitintheconfigurationspace,Sowecheckour+*PCIeconfigurationspacetoseeifit'sflaggedwithadviceagainst+*usingRelaxedOrdering.+*/+if(!pcie_relaxed_ordering_supported(pdev))+adapter->flags|=ROOT_NO_RELAXED_ORDERING;+err=adap_init0(adapter);if(err)gotoerr_unmap_bar;
@@ -2300,6 +2301,8 @@ int t4vf_sge_alloc_rxq(struct adapter *adapter, struct sge_rspq *rspq,cpu_to_be32(FW_IQ_CMD_FL0HOSTFCMODE_V(SGE_HOSTFCMODE_NONE)|FW_IQ_CMD_FL0PACKEN_F|+FW_IQ_CMD_FL0FETCHRO_V(relaxed)|+FW_IQ_CMD_FL0DATARO_V(relaxed)|FW_IQ_CMD_FL0PADEN_F);/* In T6, for egress queue type FL there is internal overhead
From: Casey Leedom <redacted>
cxgb4 Ethernet driver now queries PCIe configuration space to determine
if it can send TLPs to it with the Relaxed Ordering Attribute set.
Remove the enable_pcie_relaxed_ordering() to avoid enable PCIe Capability
Device Control[Relaxed Ordering Enable] at probe routine, to make sure
the driver will not send the Relaxed Ordering TLPs to the Root Complex which
could not deal the Relaxed Ordering TLPs.
Signed-off-by: Casey Leedom <redacted>
Signed-off-by: Ding Tianhong <redacted>
Reviewed-by: Casey Leedom <redacted>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 +
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 23 +++++++++++++++++------
drivers/net/ethernet/chelsio/cxgb4/sge.c | 5 +++--
3 files changed, 21 insertions(+), 8 deletions(-)
@@ -4947,6 +4941,23 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)adapter->msg_enable=DFLT_MSG_ENABLE;memset(adapter->chan_map,0xff,sizeof(adapter->chan_map));+/* If possible, we use PCIe Relaxed Ordering Attribute to deliver+*IngressPacketDatatoFreeListBuffersinordertoallowfor+*chipsetperformanceoptimizationsbetweentheRootComplexand+*MemoryControllers.(MessagestotheassociatedIngressQueue+*notifyingnewPacketPlacementintheFreeListsBufferswillbe+*sendwithouttheRelaxedOrderingAttributethusguaranteeingthat+*allprecedingPCIeTransactionLayerPacketswillbeprocessed+*first.)ButsomeRootComplexeshavevariousissueswithUpstream+*TransactionLayerPacketswiththeRelaxedOrderingAttributeset.+*ThePCIedeviceswhichundertheRootComplexeswillbeclearedthe+*RelaxedOrderingbitintheconfigurationspace,Sowecheckour+*PCIeconfigurationspacetoseeifit'sflaggedwithadviceagainst+*usingRelaxedOrdering.+*/+if(!pcie_relaxed_ordering_supported(pdev))+adapter->flags|=ROOT_NO_RELAXED_ORDERING;+spin_lock_init(&adapter->stats_lock);spin_lock_init(&adapter->tid_release_lock);spin_lock_init(&adapter->win0_lock);
@@ -2719,6 +2719,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,structfw_iq_cmdc;structsge*s=&adap->sge;structport_info*pi=netdev_priv(dev);+intrelaxed=!(adap->flags&ROOT_NO_RELAXED_ORDERING);/* Size needs to be multiple of 16, including status entry. */iq->size=roundup(iq->size,16);
From: Casey Leedom <redacted>
The patch adds a new flag PCI_DEV_FLAGS_NO_RELAXED_ORDERING to indicate that
Relaxed Ordering (RO) attribute should not be used for Transaction Layer
Packets (TLP) targetted towards these affected root complexes. Current list
of affected parts include Intel E5-26xx root complex which suffers from
flow control credits that result in performance issues. On these affected
parts RO can still be used for peer-2-peer traffic. AMD A1100 ARM ("SEATTLE")
Root complexes don't obey PCIe 3.0 ordering rules, hence could lead to
data-corruption.
Signed-off-by: Casey Leedom <redacted>
Signed-off-by: Ding Tianhong <redacted>
Acked-by: Ashok Raj <redacted>
---
drivers/pci/quirks.c | 38 ++++++++++++++++++++++++++++++++++++++
include/linux/pci.h | 2 ++
2 files changed, 40 insertions(+)
@@ -188,6 +188,8 @@ enum pci_dev_flags {*thedirect_completeoptimization.*/PCI_DEV_FLAGS_NEEDS_RESUME=(__forcepci_dev_flags_t)(1<<11),+/* Don't use Relaxed Ordering for TLPs directed at this device */+PCI_DEV_FLAGS_NO_RELAXED_ORDERING=(__forcepci_dev_flags_t)(1<<12),};enumpci_irq_reroute_variant{
When bit4 is set in the PCIe Device Control register, it indicates
whether the device is permitted to use relaxed ordering.
On some platforms using relaxed ordering can have performance issues or
due to erratum can cause data-corruption. In such cases devices must avoid
using relaxed ordering.
This patch checks if there is any node in the hierarchy that indicates that
using relaxed ordering is not safe. In such cases the patch turns off the
relaxed ordering by clearing the eapability for this device. And if the
device is probably running in a guest machine, we should do nothing.
Signed-off-by: Ding Tianhong <redacted>
Acked-by: Alexander Duyck <redacted>
Acked-by: Ashok Raj <redacted>
---
drivers/pci/pci.c | 29 +++++++++++++++++++++++++++++
drivers/pci/probe.c | 37 +++++++++++++++++++++++++++++++++++++
include/linux/pci.h | 2 ++
3 files changed, 68 insertions(+)
@@ -4854,6 +4854,35 @@ int pcie_set_mps(struct pci_dev *dev, int mps)EXPORT_SYMBOL(pcie_set_mps);/**+*pcie_clear_relaxed_ordering-clearPCIExpressrelaxedorderingbit+*@dev:PCIdevicetoquery+*+*Ifpossibleclearrelaxedordering+*/+intpcie_clear_relaxed_ordering(structpci_dev*dev)+{+returnpcie_capability_clear_word(dev,PCI_EXP_DEVCTL,+PCI_EXP_DEVCTL_RELAX_EN);+}+EXPORT_SYMBOL(pcie_clear_relaxed_ordering);++/**+*pcie_relaxed_ordering_supported-ProbeforPCIerelexedorderingsupport+*@dev:PCIdevicetoquery+*+*Returnstrueifthedevicesupportrelaxedorderingattribute.+*/+boolpcie_relaxed_ordering_supported(structpci_dev*dev)+{+u16v;++pcie_capability_read_word(dev,PCI_EXP_DEVCTL,&v);++return!!(v&PCI_EXP_DEVCTL_RELAX_EN);+}+EXPORT_SYMBOL(pcie_relaxed_ordering_supported);++/***pcie_get_minimum_link-determineminimumlinksettingsofaPCIdevice*@dev:PCIdevicetoquery*@speed:storageforminimumspeed
@@ -1762,6 +1762,42 @@ static void pci_configure_extended_tags(struct pci_dev *dev)PCI_EXP_DEVCTL_EXT_TAG);}+/**+*pci_dev_should_disable_relaxed_ordering-checkifthePCIdevice+*shoulddisabletherelaxedorderingattribute.+*@dev:PCIdevice+*+*ReturntrueifanyofthePCIdevicesaboveusdonotsupport+*relaxedordering.+*/+staticboolpci_dev_should_disable_relaxed_ordering(structpci_dev*dev)+{+while(dev){+if(dev->dev_flags&PCI_DEV_FLAGS_NO_RELAXED_ORDERING)+returntrue;++dev=dev->bus->self;+}++returnfalse;+}++staticvoidpci_configure_relaxed_ordering(structpci_dev*dev)+{+/* We should not alter the relaxed ordering bit for the VF */+if(dev->is_virtfn)+return;++/* If the releaxed ordering enable bit is not set, do nothing. */+if(!pcie_relaxed_ordering_supported(dev))+return;++if(pci_dev_should_disable_relaxed_ordering(dev)){+pcie_clear_relaxed_ordering(dev);+dev_info(&dev->dev,"Disable Relaxed Ordering\n");+}+}+staticvoidpci_configure_device(structpci_dev*dev){structhotplug_paramshpp;
| From: Ding Tianhong [off-list ref]
| Sent: Thursday, August 3, 2017 6:44 AM
|
| diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
| index 6967c6b..1e1cdbe 100644
| --- a/drivers/pci/quirks.c
| +++ b/drivers/pci/quirks.c
| @@ -4016,6 +4016,44 @@ static void quirk_tw686x_class(struct pci_dev *pdev)
| quirk_tw686x_class);
|
| /*
| + * Some devices have problems with Transaction Layer Packets with the Relaxed
| + * Ordering Attribute set. Such devices should mark themselves and other
| + * Device Drivers should check before sending TLPs with RO set.
| + */
| +static void quirk_relaxedordering_disable(struct pci_dev *dev)
| +{
| + dev->dev_flags |= PCI_DEV_FLAGS_NO_RELAXED_ORDERING;
| +}
| +
| +/*
| + * Intel E5-26xx Root Complex has a Flow Control Credit issue which can
| + * cause performance problems with Upstream Transaction Layer Packets with
| + * Relaxed Ordering set.
| + */
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f02, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f04, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f08, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| + ...
It looks like this is missing the set of Root Complex IDs that were noted in
the document to which Patrick Cramer sent us a reference:
https://software.intel.com/sites/default/files/managed/9e/bc/64-ia-32-architectures-optimization-manual.pdf
In section 3.9.1 we have:
3.9.1 Optimizing PCIe Performance for Accesses Toward Coherent Memory
and Toward MMIO Regions (P2P)
In order to maximize performance for PCIe devices in the processors
listed in Table 3-6 below, the soft- ware should determine whether the
accesses are toward coherent memory (system memory) or toward MMIO
regions (P2P access to other devices). If the access is toward MMIO
region, then software can command HW to set the RO bit in the TLP
header, as this would allow hardware to achieve maximum throughput for
these types of accesses. For accesses toward coherent memory, software
can command HW to clear the RO bit in the TLP header (no RO), as this
would allow hardware to achieve maximum throughput for these types of
accesses.
Table 3-6. Intel Processor CPU RP Device IDs for Processors Optimizing
PCIe Performance
Processor CPU RP Device IDs
Intel Xeon processors based on 6F01H-6F0EH
Broadwell microarchitecture
Intel Xeon processors based on 2F01H-2F0EH
Haswell microarchitecture
The PCI Device IDs you have there are the first ones that I guessed at
having the performance problem with Relaxed Ordering. We now apparently
have a complete list from Intel.
I don't want to phrase this as a "NAK" because you've gone around the
mulberry bush a bunch of times already. So maybe just go with what you've
got in version 8 of your patch and then do a follow on patch to complete the
table?
Casey
| From: Ding Tianhong [off-list ref]
| Sent: Thursday, August 3, 2017 6:44 AM
|
| diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
| index 6967c6b..1e1cdbe 100644
| --- a/drivers/pci/quirks.c
| +++ b/drivers/pci/quirks.c
| @@ -4016,6 +4016,44 @@ static void quirk_tw686x_class(struct pci_dev *pdev)
| quirk_tw686x_class);
|
| /*
| + * Some devices have problems with Transaction Layer Packets with the Relaxed
| + * Ordering Attribute set. Such devices should mark themselves and other
| + * Device Drivers should check before sending TLPs with RO set.
| + */
| +static void quirk_relaxedordering_disable(struct pci_dev *dev)
| +{
| + dev->dev_flags |= PCI_DEV_FLAGS_NO_RELAXED_ORDERING;
| +}
| +
| +/*
| + * Intel E5-26xx Root Complex has a Flow Control Credit issue which can
| + * cause performance problems with Upstream Transaction Layer Packets with
| + * Relaxed Ordering set.
| + */
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f02, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f04, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f08, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| + ...
It looks like this is missing the set of Root Complex IDs that were noted in
the document to which Patrick Cramer sent us a reference:
https://software.intel.com/sites/default/files/managed/9e/bc/64-ia-32-architectures-optimization-manual.pdf
In section 3.9.1 we have:
3.9.1 Optimizing PCIe Performance for Accesses Toward Coherent Memory
and Toward MMIO Regions (P2P)
In order to maximize performance for PCIe devices in the processors
listed in Table 3-6 below, the soft- ware should determine whether the
accesses are toward coherent memory (system memory) or toward MMIO
regions (P2P access to other devices). If the access is toward MMIO
region, then software can command HW to set the RO bit in the TLP
header, as this would allow hardware to achieve maximum throughput for
these types of accesses. For accesses toward coherent memory, software
can command HW to clear the RO bit in the TLP header (no RO), as this
would allow hardware to achieve maximum throughput for these types of
accesses.
Table 3-6. Intel Processor CPU RP Device IDs for Processors Optimizing
PCIe Performance
Processor CPU RP Device IDs
Intel Xeon processors based on 6F01H-6F0EH
Broadwell microarchitecture
Intel Xeon processors based on 2F01H-2F0EH
Haswell microarchitecture
The PCI Device IDs you have there are the first ones that I guessed at
having the performance problem with Relaxed Ordering. We now apparently
have a complete list from Intel.
I don't want to phrase this as a "NAK" because you've gone around the
mulberry bush a bunch of times already. So maybe just go with what you've
got in version 8 of your patch and then do a follow on patch to complete the
table?
Casey
| From: Ding Tianhong [off-list ref]
| Sent: Thursday, August 3, 2017 6:44 AM
|
| diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
| index 6967c6b..1e1cdbe 100644
| --- a/drivers/pci/quirks.c
| +++ b/drivers/pci/quirks.c
| @@ -4016,6 +4016,44 @@ static void quirk_tw686x_class(struct pci_dev *pdev)
| quirk_tw686x_class);
|
| /*
| + * Some devices have problems with Transaction Layer Packets with the Relaxed
| + * Ordering Attribute set. Such devices should mark themselves and other
| + * Device Drivers should check before sending TLPs with RO set.
| + */
| +static void quirk_relaxedordering_disable(struct pci_dev *dev)
| +{
| + dev->dev_flags |= PCI_DEV_FLAGS_NO_RELAXED_ORDERING;
| +}
| +
| +/*
| + * Intel E5-26xx Root Complex has a Flow Control Credit issue which can
| + * cause performance problems with Upstream Transaction Layer Packets with
| + * Relaxed Ordering set.
| + */
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f02, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f04, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f08, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| + ...
It looks like this is missing the set of Root Complex IDs that were noted in
the document to which Patrick Cramer sent us a reference:
https://software.intel.com/sites/default/files/managed/9e/bc/64-ia-32-architectures-optimization-manual.pdf
In section 3.9.1 we have:
3.9.1 Optimizing PCIe Performance for Accesses Toward Coherent Memory
and Toward MMIO Regions (P2P)
In order to maximize performance for PCIe devices in the processors
listed in Table 3-6 below, the soft- ware should determine whether the
accesses are toward coherent memory (system memory) or toward MMIO
regions (P2P access to other devices). If the access is toward MMIO
region, then software can command HW to set the RO bit in the TLP
header, as this would allow hardware to achieve maximum throughput for
these types of accesses. For accesses toward coherent memory, software
can command HW to clear the RO bit in the TLP header (no RO), as this
would allow hardware to achieve maximum throughput for these types of
accesses.
Table 3-6. Intel Processor CPU RP Device IDs for Processors Optimizing
PCIe Performance
Processor CPU RP Device IDs
Intel Xeon processors based on 6F01H-6F0EH
Broadwell microarchitecture
Intel Xeon processors based on 2F01H-2F0EH
Haswell microarchitecture
The PCI Device IDs you have there are the first ones that I guessed at
having the performance problem with Relaxed Ordering. We now apparently
have a complete list from Intel.
I don't want to phrase this as a "NAK" because you've gone around the
mulberry bush a bunch of times already. So maybe just go with what you've
got in version 8 of your patch and then do a follow on patch to complete the
table?
Casey:
Thanks for the good catch, I found that the Ashok has notice this 3 month before, I am so sorry to
miss it, it was really a long discussion for this problem, but don't worry, It is not a big work to fix it,
I will send the v9 version. :)
Ding
| From: Ding Tianhong [off-list ref]
| Sent: Thursday, August 3, 2017 6:44 AM
|
| diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
| index 6967c6b..1e1cdbe 100644
| --- a/drivers/pci/quirks.c
| +++ b/drivers/pci/quirks.c
| @@ -4016,6 +4016,44 @@ static void quirk_tw686x_class(struct pci_dev *pdev)
| quirk_tw686x_class);
|
| /*
| + * Some devices have problems with Transaction Layer Packets with the Relaxed
| + * Ordering Attribute set. Such devices should mark themselves and other
| + * Device Drivers should check before sending TLPs with RO set.
| + */
| +static void quirk_relaxedordering_disable(struct pci_dev *dev)
| +{
| + dev->dev_flags |= PCI_DEV_FLAGS_NO_RELAXED_ORDERING;
| +}
| +
| +/*
| + * Intel E5-26xx Root Complex has a Flow Control Credit issue which can
| + * cause performance problems with Upstream Transaction Layer Packets with
| + * Relaxed Ordering set.
| + */
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f02, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f04, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, 0x6f08, PCI_CLASS_NOT_DEFINED, 8,
| + quirk_relaxedordering_disable);
| + ...
It looks like this is missing the set of Root Complex IDs that were noted in
the document to which Patrick Cramer sent us a reference:
https://software.intel.com/sites/default/files/managed/9e/bc/64-ia-32-architectures-optimization-manual.pdf
In section 3.9.1 we have:
3.9.1 Optimizing PCIe Performance for Accesses Toward Coherent Memory
and Toward MMIO Regions (P2P)
In order to maximize performance for PCIe devices in the processors
listed in Table 3-6 below, the soft- ware should determine whether the
accesses are toward coherent memory (system memory) or toward MMIO
regions (P2P access to other devices). If the access is toward MMIO
region, then software can command HW to set the RO bit in the TLP
header, as this would allow hardware to achieve maximum throughput for
these types of accesses. For accesses toward coherent memory, software
can command HW to clear the RO bit in the TLP header (no RO), as this
would allow hardware to achieve maximum throughput for these types of
accesses.
Table 3-6. Intel Processor CPU RP Device IDs for Processors Optimizing
PCIe Performance
Processor CPU RP Device IDs
Intel Xeon processors based on 6F01H-6F0EH
Broadwell microarchitecture
Intel Xeon processors based on 2F01H-2F0EH
Haswell microarchitecture
The PCI Device IDs you have there are the first ones that I guessed at
having the performance problem with Relaxed Ordering. We now apparently
have a complete list from Intel.
I don't want to phrase this as a "NAK" because you've gone around the
mulberry bush a bunch of times already. So maybe just go with what you've
got in version 8 of your patch and then do a follow on patch to complete the
table?
Casey:
Thanks for the good catch, I found that the Ashok has notice this 3 month before, I am so sorry to
miss it, it was really a long discussion for this problem, but don't worry, It is not a big work to fix it,
I will send the v9 version. :)
Ding