Skip to content

Commit 60db3a4

Browse files
Sinan KayaBjorn Helgaas
authored andcommitted
PCI: Enable PCIe Extended Tags if supported
Every PCIe device can generate 5-bit transaction Tags, which allow up to 32 concurrent requests. Some devices can generate 8-bit Extended Tags, which allow up to 256 concurrent requests. Per the ECN mentioned below, all PCIe Receivers are expected to support Extended Tags, so devices are allowed (but not required) to enable them by default. If a device supports Extended Tags but does not enable them by default, enable them. This allows the device to have up to 256 outstanding transactions at a time, which may improve performance. [bhelgaas: changelog, check for PCIe device] Link: https://pcisig.com/sites/default/files/specification_documents/ECN_Extended_Tag_Enable_Default_05Sept2008_final.pdf Signed-off-by: Sinan Kaya <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent cdcb33f commit 60db3a4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/pci/probe.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,12 +1661,30 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
16611661
*/
16621662
}
16631663

1664+
static void pci_configure_extended_tags(struct pci_dev *dev)
1665+
{
1666+
u32 dev_cap;
1667+
int ret;
1668+
1669+
if (!pci_is_pcie(dev))
1670+
return;
1671+
1672+
ret = pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &dev_cap);
1673+
if (ret)
1674+
return;
1675+
1676+
if (dev_cap & PCI_EXP_DEVCAP_EXT_TAG)
1677+
pcie_capability_set_word(dev, PCI_EXP_DEVCTL,
1678+
PCI_EXP_DEVCTL_EXT_TAG);
1679+
}
1680+
16641681
static void pci_configure_device(struct pci_dev *dev)
16651682
{
16661683
struct hotplug_params hpp;
16671684
int ret;
16681685

16691686
pci_configure_mps(dev);
1687+
pci_configure_extended_tags(dev);
16701688

16711689
memset(&hpp, 0, sizeof(hpp));
16721690
ret = pci_get_hp_params(dev, &hpp);

0 commit comments

Comments
 (0)