diff options
author | Yu Zhao <yu.zhao@intel.com> | 2009-05-18 01:51:32 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-05-18 06:25:54 -0400 |
commit | 302b4215daa0a704c843da40fd2529e5757a72da (patch) | |
tree | 1bc40108fceafd3fbc9faee38c971fa94d560b13 /drivers/pci/pci.h | |
parent | dd7264355a203c3456dbba04db471947d3b55e7e (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.h | 37 |
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 */ | ||
233 | struct 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 |
233 | extern int pci_iov_init(struct pci_dev *dev); | 240 | extern int pci_iov_init(struct pci_dev *dev); |
234 | extern void pci_iov_release(struct pci_dev *dev); | 241 | extern 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); |
237 | extern void pci_restore_iov_state(struct pci_dev *dev); | 244 | extern void pci_restore_iov_state(struct pci_dev *dev); |
238 | extern int pci_iov_bus_range(struct pci_bus *bus); | 245 | extern int pci_iov_bus_range(struct pci_bus *bus); |
246 | |||
247 | extern int pci_enable_ats(struct pci_dev *dev, int ps); | ||
248 | extern void pci_disable_ats(struct pci_dev *dev); | ||
249 | extern 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 | */ | ||
256 | static inline int pci_ats_enabled(struct pci_dev *dev) | ||
257 | { | ||
258 | return !!dev->ats; | ||
259 | } | ||
239 | #else | 260 | #else |
240 | static inline int pci_iov_init(struct pci_dev *dev) | 261 | static 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 | |||
282 | static inline int pci_enable_ats(struct pci_dev *dev, int ps) | ||
283 | { | ||
284 | return -ENODEV; | ||
285 | } | ||
286 | static inline void pci_disable_ats(struct pci_dev *dev) | ||
287 | { | ||
288 | } | ||
289 | static inline int pci_ats_queue_depth(struct pci_dev *dev) | ||
290 | { | ||
291 | return -ENODEV; | ||
292 | } | ||
293 | static 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 */ |