On Thu, May 5, 2011 at 1:33 PM, Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> wrote: > Add support to allow drivers to enable/disable ID-based ordering. Where > supported, ID-based ordering can significantly improve the latency of > individual requests by preventing them from queueing up behind unrelated > traffic. > > Signed-off-by: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> > --- > drivers/pci/pci.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++ > include/linux/pci.h | 13 +++++++++++ > include/linux/pci_regs.h | 2 + > 3 files changed, 69 insertions(+), 0 deletions(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index 44d1c7c..44bf8f0 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -1834,6 +1834,60 @@ void pci_enable_ari(struct pci_dev *dev) > bridge->ari_enabled = 1; > } > > +/** > + * pci_enable_ido - enable ID-based ordering on a device > + * @dev: the PCI device > + * @type: which types of IDO to enable > + * > + * Enable ID-based ordering on @dev. @type can contain the bits > + * %PCI_EXP_IDO_REQUEST and/or %PCI_EXP_IDO_COMPLETION to indicate > + * which types of transactions are allowed to be re-ordered. > + */ > +void pci_enable_ido(struct pci_dev *dev, unsigned long type) > +{ > + int pos; > + u16 ctrl; > + > + if (!pci_is_pcie(dev)) > + return; > + > + pos = pci_pcie_cap(dev); > + if (!pos) > + return; Do we gain something by testing !pci_is_pcie() before testing pci_pcie_cap()? The current pci_is_pcie() implementation is merely: static inline bool pci_is_pcie(struct pci_dev *dev) { return !!pci_pcie_cap(dev); } so we could just drop the pci_is_pcie() test. But maybe there's some abstraction or other benefit to keeping it. Bjorn -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html