sysfs-bus-pci 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. What: /sys/bus/pci/drivers/.../bind
  2. What: /sys/devices/pciX/.../bind
  3. Date: December 2003
  4. Contact: [email protected]
  5. Description:
  6. Writing a device location to this file will cause
  7. the driver to attempt to bind to the device found at
  8. this location. This is useful for overriding default
  9. bindings. The format for the location is: DDDD:BB:DD.F.
  10. That is Domain:Bus:Device.Function and is the same as
  11. found in /sys/bus/pci/devices/. For example::
  12. # echo 0000:00:19.0 > /sys/bus/pci/drivers/foo/bind
  13. (Note: kernels before 2.6.28 may require echo -n).
  14. What: /sys/bus/pci/drivers/.../unbind
  15. What: /sys/devices/pciX/.../unbind
  16. Date: December 2003
  17. Contact: [email protected]
  18. Description:
  19. Writing a device location to this file will cause the
  20. driver to attempt to unbind from the device found at
  21. this location. This may be useful when overriding default
  22. bindings. The format for the location is: DDDD:BB:DD.F.
  23. That is Domain:Bus:Device.Function and is the same as
  24. found in /sys/bus/pci/devices/. For example::
  25. # echo 0000:00:19.0 > /sys/bus/pci/drivers/foo/unbind
  26. (Note: kernels before 2.6.28 may require echo -n).
  27. What: /sys/bus/pci/drivers/.../new_id
  28. What: /sys/devices/pciX/.../new_id
  29. Date: December 2003
  30. Contact: [email protected]
  31. Description:
  32. Writing a device ID to this file will attempt to
  33. dynamically add a new device ID to a PCI device driver.
  34. This may allow the driver to support more hardware than
  35. was included in the driver's static device ID support
  36. table at compile time. The format for the device ID is:
  37. VVVV DDDD SVVV SDDD CCCC MMMM PPPP. That is Vendor ID,
  38. Device ID, Subsystem Vendor ID, Subsystem Device ID,
  39. Class, Class Mask, and Private Driver Data. The Vendor ID
  40. and Device ID fields are required, the rest are optional.
  41. Upon successfully adding an ID, the driver will probe
  42. for the device and attempt to bind to it. For example::
  43. # echo "8086 10f5" > /sys/bus/pci/drivers/foo/new_id
  44. What: /sys/bus/pci/drivers/.../remove_id
  45. What: /sys/devices/pciX/.../remove_id
  46. Date: February 2009
  47. Contact: Chris Wright <[email protected]>
  48. Description:
  49. Writing a device ID to this file will remove an ID
  50. that was dynamically added via the new_id sysfs entry.
  51. The format for the device ID is:
  52. VVVV DDDD SVVV SDDD CCCC MMMM. That is Vendor ID, Device
  53. ID, Subsystem Vendor ID, Subsystem Device ID, Class,
  54. and Class Mask. The Vendor ID and Device ID fields are
  55. required, the rest are optional. After successfully
  56. removing an ID, the driver will no longer support the
  57. device. This is useful to ensure auto probing won't
  58. match the driver to the device. For example::
  59. # echo "8086 10f5" > /sys/bus/pci/drivers/foo/remove_id
  60. What: /sys/bus/pci/rescan
  61. Date: January 2009
  62. Contact: Linux PCI developers <[email protected]>
  63. Description:
  64. Writing a non-zero value to this attribute will
  65. force a rescan of all PCI buses in the system, and
  66. re-discover previously removed devices.
  67. What: /sys/bus/pci/devices/.../msi_bus
  68. Date: September 2014
  69. Contact: Linux PCI developers <[email protected]>
  70. Description:
  71. Writing a zero value to this attribute disallows MSI and
  72. MSI-X for any future drivers of the device. If the device
  73. is a bridge, MSI and MSI-X will be disallowed for future
  74. drivers of all child devices under the bridge. Drivers
  75. must be reloaded for the new setting to take effect.
  76. What: /sys/bus/pci/devices/.../msi_irqs/
  77. Date: September, 2011
  78. Contact: Neil Horman <[email protected]>
  79. Description:
  80. The /sys/devices/.../msi_irqs directory contains a variable set
  81. of files, with each file being named after a corresponding msi
  82. irq vector allocated to that device.
  83. What: /sys/bus/pci/devices/.../msi_irqs/<N>
  84. Date: September 2011
  85. Contact: Neil Horman <[email protected]>
  86. Description:
  87. This attribute indicates the mode that the irq vector named by
  88. the file is in (msi vs. msix)
  89. What: /sys/bus/pci/devices/.../irq
  90. Date: August 2021
  91. Contact: Linux PCI developers <[email protected]>
  92. Description:
  93. If a driver has enabled MSI (not MSI-X), "irq" contains the
  94. IRQ of the first MSI vector. Otherwise "irq" contains the
  95. IRQ of the legacy INTx interrupt.
  96. "irq" being set to 0 indicates that the device isn't
  97. capable of generating legacy INTx interrupts.
  98. What: /sys/bus/pci/devices/.../remove
  99. Date: January 2009
  100. Contact: Linux PCI developers <[email protected]>
  101. Description:
  102. Writing a non-zero value to this attribute will
  103. hot-remove the PCI device and any of its children.
  104. What: /sys/bus/pci/devices/.../pci_bus/.../rescan
  105. Date: May 2011
  106. Contact: Linux PCI developers <[email protected]>
  107. Description:
  108. Writing a non-zero value to this attribute will
  109. force a rescan of the bus and all child buses,
  110. and re-discover devices removed earlier from this
  111. part of the device tree.
  112. What: /sys/bus/pci/devices/.../rescan
  113. Date: January 2009
  114. Contact: Linux PCI developers <[email protected]>
  115. Description:
  116. Writing a non-zero value to this attribute will
  117. force a rescan of the device's parent bus and all
  118. child buses, and re-discover devices removed earlier
  119. from this part of the device tree.
  120. What: /sys/bus/pci/devices/.../reset_method
  121. Date: August 2021
  122. Contact: Amey Narkhede <[email protected]>
  123. Description:
  124. Some devices allow an individual function to be reset
  125. without affecting other functions in the same slot.
  126. For devices that have this support, a file named
  127. reset_method is present in sysfs. Reading this file
  128. gives names of the supported and enabled reset methods and
  129. their ordering. Writing a space-separated list of names of
  130. reset methods sets the reset methods and ordering to be
  131. used when resetting the device. Writing an empty string
  132. disables the ability to reset the device. Writing
  133. "default" enables all supported reset methods in the
  134. default ordering.
  135. What: /sys/bus/pci/devices/.../reset
  136. Date: July 2009
  137. Contact: Michael S. Tsirkin <[email protected]>
  138. Description:
  139. Some devices allow an individual function to be reset
  140. without affecting other functions in the same device.
  141. For devices that have this support, a file named reset
  142. will be present in sysfs. Writing 1 to this file
  143. will perform reset.
  144. What: /sys/bus/pci/devices/.../vpd
  145. Date: February 2008
  146. Contact: Ben Hutchings <[email protected]>
  147. Description:
  148. A file named vpd in a device directory will be a
  149. binary file containing the Vital Product Data for the
  150. device. It should follow the VPD format defined in
  151. PCI Specification 2.1 or 2.2, but users should consider
  152. that some devices may have incorrectly formatted data.
  153. If the underlying VPD has a writable section then the
  154. corresponding section of this file will be writable.
  155. What: /sys/bus/pci/devices/.../virtfn<N>
  156. Date: March 2009
  157. Contact: Yu Zhao <[email protected]>
  158. Description:
  159. This symbolic link appears when hardware supports the SR-IOV
  160. capability and the Physical Function driver has enabled it.
  161. The symbolic link points to the PCI device sysfs entry of the
  162. Virtual Function whose index is N (0...MaxVFs-1).
  163. What: /sys/bus/pci/devices/.../dep_link
  164. Date: March 2009
  165. Contact: Yu Zhao <[email protected]>
  166. Description:
  167. This symbolic link appears when hardware supports the SR-IOV
  168. capability and the Physical Function driver has enabled it,
  169. and this device has vendor specific dependencies with others.
  170. The symbolic link points to the PCI device sysfs entry of
  171. Physical Function this device depends on.
  172. What: /sys/bus/pci/devices/.../physfn
  173. Date: March 2009
  174. Contact: Yu Zhao <[email protected]>
  175. Description:
  176. This symbolic link appears when a device is a Virtual Function.
  177. The symbolic link points to the PCI device sysfs entry of the
  178. Physical Function this device associates with.
  179. What: /sys/bus/pci/devices/.../modalias
  180. Date: May 2005
  181. Contact: Greg Kroah-Hartman <[email protected]>
  182. Description:
  183. This attribute indicates the PCI ID of the device object.
  184. That is in the format:
  185. pci:vXXXXXXXXdXXXXXXXXsvXXXXXXXXsdXXXXXXXXbcXXscXXiXX,
  186. where:
  187. - vXXXXXXXX contains the vendor ID;
  188. - dXXXXXXXX contains the device ID;
  189. - svXXXXXXXX contains the sub-vendor ID;
  190. - sdXXXXXXXX contains the subsystem device ID;
  191. - bcXX contains the device class;
  192. - scXX contains the device subclass;
  193. - iXX contains the device class programming interface.
  194. What: /sys/bus/pci/slots/.../module
  195. Date: June 2009
  196. Contact: [email protected]
  197. Description:
  198. This symbolic link points to the PCI hotplug controller driver
  199. module that manages the hotplug slot.
  200. What: /sys/bus/pci/devices/.../label
  201. Date: July 2010
  202. Contact: Narendra K <[email protected]>, [email protected]
  203. Description:
  204. Reading this attribute will provide the firmware
  205. given name (SMBIOS type 41 string or ACPI _DSM string) of
  206. the PCI device. The attribute will be created only
  207. if the firmware has given a name to the PCI device.
  208. ACPI _DSM string name will be given priority if the
  209. system firmware provides SMBIOS type 41 string also.
  210. Users:
  211. Userspace applications interested in knowing the
  212. firmware assigned name of the PCI device.
  213. What: /sys/bus/pci/devices/.../index
  214. Date: July 2010
  215. Contact: Narendra K <[email protected]>, [email protected]
  216. Description:
  217. Reading this attribute will provide the firmware given instance
  218. number of the PCI device. Depending on the platform this can
  219. be for example the SMBIOS type 41 device type instance or the
  220. user-defined ID (UID) on s390. The attribute will be created
  221. only if the firmware has given an instance number to the PCI
  222. device and that number is guaranteed to uniquely identify the
  223. device in the system.
  224. Users:
  225. Userspace applications interested in knowing the
  226. firmware assigned device type instance of the PCI
  227. device that can help in understanding the firmware
  228. intended order of the PCI device.
  229. What: /sys/bus/pci/devices/.../acpi_index
  230. Date: July 2010
  231. Contact: Narendra K <[email protected]>, [email protected]
  232. Description:
  233. Reading this attribute will provide the firmware
  234. given instance (ACPI _DSM instance number) of the PCI device.
  235. The attribute will be created only if the firmware has given
  236. an instance number to the PCI device. ACPI _DSM instance number
  237. will be given priority if the system firmware provides SMBIOS
  238. type 41 device type instance also.
  239. Users:
  240. Userspace applications interested in knowing the
  241. firmware assigned instance number of the PCI
  242. device that can help in understanding the firmware
  243. intended order of the PCI device.
  244. What: /sys/bus/pci/devices/.../d3cold_allowed
  245. Date: July 2012
  246. Contact: Huang Ying <[email protected]>
  247. Description:
  248. d3cold_allowed is bit to control whether the corresponding PCI
  249. device can be put into D3Cold state. If it is cleared, the
  250. device will never be put into D3Cold state. If it is set, the
  251. device may be put into D3Cold state if other requirements are
  252. satisfied too. Reading this attribute will show the current
  253. value of d3cold_allowed bit. Writing this attribute will set
  254. the value of d3cold_allowed bit.
  255. What: /sys/bus/pci/devices/.../sriov_totalvfs
  256. Date: November 2012
  257. Contact: Donald Dutile <[email protected]>
  258. Description:
  259. This file appears when a physical PCIe device supports SR-IOV.
  260. Userspace applications can read this file to determine the
  261. maximum number of Virtual Functions (VFs) a PCIe physical
  262. function (PF) can support. Typically, this is the value reported
  263. in the PF's SR-IOV extended capability structure's TotalVFs
  264. element. Drivers have the ability at probe time to reduce the
  265. value read from this file via the pci_sriov_set_totalvfs()
  266. function.
  267. What: /sys/bus/pci/devices/.../sriov_numvfs
  268. Date: November 2012
  269. Contact: Donald Dutile <[email protected]>
  270. Description:
  271. This file appears when a physical PCIe device supports SR-IOV.
  272. Userspace applications can read and write to this file to
  273. determine and control the enablement or disablement of Virtual
  274. Functions (VFs) on the physical function (PF). A read of this
  275. file will return the number of VFs that are enabled on this PF.
  276. A number written to this file will enable the specified
  277. number of VFs. A userspace application would typically read the
  278. file and check that the value is zero, and then write the number
  279. of VFs that should be enabled on the PF; the value written
  280. should be less than or equal to the value in the sriov_totalvfs
  281. file. A userspace application wanting to disable the VFs would
  282. write a zero to this file. The core ensures that valid values
  283. are written to this file, and returns errors when values are not
  284. valid. For example, writing a 2 to this file when sriov_numvfs
  285. is not 0 and not 2 already will return an error. Writing a 10
  286. when the value of sriov_totalvfs is 8 will return an error.
  287. What: /sys/bus/pci/devices/.../driver_override
  288. Date: April 2014
  289. Contact: Alex Williamson <[email protected]>
  290. Description:
  291. This file allows the driver for a device to be specified which
  292. will override standard static and dynamic ID matching. When
  293. specified, only a driver with a name matching the value written
  294. to driver_override will have an opportunity to bind to the
  295. device. The override is specified by writing a string to the
  296. driver_override file (echo pci-stub > driver_override) and
  297. may be cleared with an empty string (echo > driver_override).
  298. This returns the device to standard matching rules binding.
  299. Writing to driver_override does not automatically unbind the
  300. device from its current driver or make any attempt to
  301. automatically load the specified driver. If no driver with a
  302. matching name is currently loaded in the kernel, the device
  303. will not bind to any driver. This also allows devices to
  304. opt-out of driver binding using a driver_override name such as
  305. "none". Only a single driver may be specified in the override,
  306. there is no support for parsing delimiters.
  307. What: /sys/bus/pci/devices/.../numa_node
  308. Date: Oct 2014
  309. Contact: Prarit Bhargava <[email protected]>
  310. Description:
  311. This file contains the NUMA node to which the PCI device is
  312. attached, or -1 if the node is unknown. The initial value
  313. comes from an ACPI _PXM method or a similar firmware
  314. source. If that is missing or incorrect, this file can be
  315. written to override the node. In that case, please report
  316. a firmware bug to the system vendor. Writing to this file
  317. taints the kernel with TAINT_FIRMWARE_WORKAROUND, which
  318. reduces the supportability of your system.
  319. What: /sys/bus/pci/devices/.../revision
  320. Date: November 2016
  321. Contact: Emil Velikov <[email protected]>
  322. Description:
  323. This file contains the revision field of the PCI device.
  324. The value comes from device config space. The file is read only.
  325. What: /sys/bus/pci/devices/.../sriov_drivers_autoprobe
  326. Date: April 2017
  327. Contact: Bodong Wang<[email protected]>
  328. Description:
  329. This file is associated with the PF of a device that
  330. supports SR-IOV. It determines whether newly-enabled VFs
  331. are immediately bound to a driver. It initially contains
  332. 1, which means the kernel automatically binds VFs to a
  333. compatible driver immediately after they are enabled. If
  334. an application writes 0 to the file before enabling VFs,
  335. the kernel will not bind VFs to a driver.
  336. A typical use case is to write 0 to this file, then enable
  337. VFs, then assign the newly-created VFs to virtual machines.
  338. Note that changing this file does not affect already-
  339. enabled VFs. In this scenario, the user must first disable
  340. the VFs, write 0 to sriov_drivers_autoprobe, then re-enable
  341. the VFs.
  342. This is similar to /sys/bus/pci/drivers_autoprobe, but
  343. affects only the VFs associated with a specific PF.
  344. What: /sys/bus/pci/devices/.../p2pmem/size
  345. Date: November 2017
  346. Contact: Logan Gunthorpe <[email protected]>
  347. Description:
  348. If the device has any Peer-to-Peer memory registered, this
  349. file contains the total amount of memory that the device
  350. provides (in decimal).
  351. What: /sys/bus/pci/devices/.../p2pmem/available
  352. Date: November 2017
  353. Contact: Logan Gunthorpe <[email protected]>
  354. Description:
  355. If the device has any Peer-to-Peer memory registered, this
  356. file contains the amount of memory that has not been
  357. allocated (in decimal).
  358. What: /sys/bus/pci/devices/.../p2pmem/published
  359. Date: November 2017
  360. Contact: Logan Gunthorpe <[email protected]>
  361. Description:
  362. If the device has any Peer-to-Peer memory registered, this
  363. file contains a '1' if the memory has been published for
  364. use outside the driver that owns the device.
  365. What: /sys/bus/pci/devices/.../link/clkpm
  366. /sys/bus/pci/devices/.../link/l0s_aspm
  367. /sys/bus/pci/devices/.../link/l1_aspm
  368. /sys/bus/pci/devices/.../link/l1_1_aspm
  369. /sys/bus/pci/devices/.../link/l1_2_aspm
  370. /sys/bus/pci/devices/.../link/l1_1_pcipm
  371. /sys/bus/pci/devices/.../link/l1_2_pcipm
  372. Date: October 2019
  373. Contact: Heiner Kallweit <[email protected]>
  374. Description: If ASPM is supported for an endpoint, these files can be
  375. used to disable or enable the individual power management
  376. states. Write y/1/on to enable, n/0/off to disable.
  377. What: /sys/bus/pci/devices/.../power_state
  378. Date: November 2020
  379. Contact: Linux PCI developers <[email protected]>
  380. Description:
  381. This file contains the current PCI power state of the device.
  382. The value comes from the PCI kernel device state and can be one
  383. of: "unknown", "error", "D0", D1", "D2", "D3hot", "D3cold".
  384. The file is read only.
  385. What: /sys/bus/pci/devices/.../sriov_vf_total_msix
  386. Date: January 2021
  387. Contact: Leon Romanovsky <[email protected]>
  388. Description:
  389. This file is associated with a SR-IOV physical function (PF).
  390. It contains the total number of MSI-X vectors available for
  391. assignment to all virtual functions (VFs) associated with PF.
  392. The value will be zero if the device doesn't support this
  393. functionality. For supported devices, the value will be
  394. constant and won't be changed after MSI-X vectors assignment.
  395. What: /sys/bus/pci/devices/.../sriov_vf_msix_count
  396. Date: January 2021
  397. Contact: Leon Romanovsky <[email protected]>
  398. Description:
  399. This file is associated with a SR-IOV virtual function (VF).
  400. It allows configuration of the number of MSI-X vectors for
  401. the VF. This allows devices that have a global pool of MSI-X
  402. vectors to optimally divide them between VFs based on VF usage.
  403. The values accepted are:
  404. * > 0 - this number will be reported as the Table Size in the
  405. VF's MSI-X capability
  406. * < 0 - not valid
  407. * = 0 - will reset to the device default value
  408. The file is writable if the PF is bound to a driver that
  409. implements ->sriov_set_msix_vec_count().
  410. What: /sys/bus/pci/devices/.../resourceN_resize
  411. Date: September 2022
  412. Contact: Alex Williamson <[email protected]>
  413. Description:
  414. These files provide an interface to PCIe Resizable BAR support.
  415. A file is created for each BAR resource (N) supported by the
  416. PCIe Resizable BAR extended capability of the device. Reading
  417. each file exposes the bitmap of available resource sizes:
  418. # cat resource1_resize
  419. 00000000000001c0
  420. The bitmap represents supported resource sizes for the BAR,
  421. where bit0 = 1MB, bit1 = 2MB, bit2 = 4MB, etc. In the above
  422. example the device supports 64MB, 128MB, and 256MB BAR sizes.
  423. When writing the file, the user provides the bit position of
  424. the desired resource size, for example:
  425. # echo 7 > resource1_resize
  426. This indicates to set the size value corresponding to bit 7,
  427. 128MB. The resulting size is 2 ^ (bit# + 20). This definition
  428. matches the PCIe specification of this capability.
  429. In order to make use of resource resizing, all PCI drivers must
  430. be unbound from the device and peer devices under the same
  431. parent bridge may need to be soft removed. In the case of
  432. VGA devices, writing a resize value will remove low level
  433. console drivers from the device. Raw users of pci-sysfs
  434. resourceN attributes must be terminated prior to resizing.
  435. Success of the resizing operation is not guaranteed.