aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.h
diff options
context:
space:
mode:
authorYu Zhao <yu.zhao@intel.com>2009-05-18 01:51:32 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-05-18 06:25:54 -0400
commit302b4215daa0a704c843da40fd2529e5757a72da (patch)
tree1bc40108fceafd3fbc9faee38c971fa94d560b13 /drivers/pci/pci.h
parentdd7264355a203c3456dbba04db471947d3b55e7e (diff)
PCI: support the ATS capability
The PCIe ATS capability makes the Endpoint be able to request the DMA address translation from the IOMMU and cache the translation in the device side, thus alleviate IOMMU pressure and improve the hardware performance in the I/O virtualization environment. Signed-off-by: Yu Zhao <yu.zhao@intel.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r--drivers/pci/pci.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index d03f6b99f292..3c2ec64f78e9 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -229,6 +229,13 @@ struct pci_sriov {
229 u8 __iomem *mstate; /* VF Migration State Array */ 229 u8 __iomem *mstate; /* VF Migration State Array */
230}; 230};
231 231
232/* Address Translation Service */
233struct pci_ats {
234 int pos; /* capability position */
235 int stu; /* Smallest Translation Unit */
236 int qdep; /* Invalidate Queue Depth */
237};
238
232#ifdef CONFIG_PCI_IOV 239#ifdef CONFIG_PCI_IOV
233extern int pci_iov_init(struct pci_dev *dev); 240extern int pci_iov_init(struct pci_dev *dev);
234extern void pci_iov_release(struct pci_dev *dev); 241extern void pci_iov_release(struct pci_dev *dev);
@@ -236,6 +243,20 @@ extern int pci_iov_resource_bar(struct pci_dev *dev, int resno,
236 enum pci_bar_type *type); 243 enum pci_bar_type *type);
237extern void pci_restore_iov_state(struct pci_dev *dev); 244extern void pci_restore_iov_state(struct pci_dev *dev);
238extern int pci_iov_bus_range(struct pci_bus *bus); 245extern int pci_iov_bus_range(struct pci_bus *bus);
246
247extern int pci_enable_ats(struct pci_dev *dev, int ps);
248extern void pci_disable_ats(struct pci_dev *dev);
249extern int pci_ats_queue_depth(struct pci_dev *dev);
250/**
251 * pci_ats_enabled - query the ATS status
252 * @dev: the PCI device
253 *
254 * Returns 1 if ATS capability is enabled, or 0 if not.
255 */
256static inline int pci_ats_enabled(struct pci_dev *dev)
257{
258 return !!dev->ats;
259}
239#else 260#else
240static inline int pci_iov_init(struct pci_dev *dev) 261static inline int pci_iov_init(struct pci_dev *dev)
241{ 262{
@@ -257,6 +278,22 @@ static inline int pci_iov_bus_range(struct pci_bus *bus)
257{ 278{
258 return 0; 279 return 0;
259} 280}
281
282static inline int pci_enable_ats(struct pci_dev *dev, int ps)
283{
284 return -ENODEV;
285}
286static inline void pci_disable_ats(struct pci_dev *dev)
287{
288}
289static inline int pci_ats_queue_depth(struct pci_dev *dev)
290{
291 return -ENODEV;
292}
293static inline int pci_ats_enabled(struct pci_dev *dev)
294{
295 return 0;
296}
260#endif /* CONFIG_PCI_IOV */ 297#endif /* CONFIG_PCI_IOV */
261 298
262#endif /* DRIVERS_PCI_H */ 299#endif /* DRIVERS_PCI_H */