Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Remove no longer correct documentation regarding MSI vector assignment

The MSI vector reservation system described in Documentation/MSI-HOWTO.txt
was removed by Eric in 92db6d10bc1bc43330a4c540fa5b64c83d9d865f. Remove
the references to it in the documentation.

While we're here § 5.5.1 refers to x86 hardware requirements, so make that
clear.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Michael Ellerman and committed by
Greg Kroah-Hartman
4904e23b 346ca04d

+4 -65
+4 -65
Documentation/MSI-HOWTO.txt
··· 241 241 will fail enabling MSI-X on its hardware device when it calls the function 242 242 pci_enable_msix(). 243 243 244 - 5.3.2 Handling MSI-X allocation 245 - 246 - Determining the number of MSI-X vectors allocated to a function is 247 - dependent on the number of MSI capable devices and MSI-X capable 248 - devices populated in the system. The policy of allocating MSI-X 249 - vectors to a function is defined as the following: 250 - 251 - #of MSI-X vectors allocated to a function = (x - y)/z where 252 - 253 - x = The number of available PCI vector resources by the time 254 - the device driver calls pci_enable_msix(). The PCI vector 255 - resources is the sum of the number of unassigned vectors 256 - (new) and the number of released vectors when any MSI/MSI-X 257 - device driver switches its hardware device back to a legacy 258 - mode or is hot-removed. The number of unassigned vectors 259 - may exclude some vectors reserved, as defined in parameter 260 - NR_HP_RESERVED_VECTORS, for the case where the system is 261 - capable of supporting hot-add/hot-remove operations. Users 262 - may change the value defined in NR_HR_RESERVED_VECTORS to 263 - meet their specific needs. 264 - 265 - y = The number of MSI capable devices populated in the system. 266 - This policy ensures that each MSI capable device has its 267 - vector reserved to avoid the case where some MSI-X capable 268 - drivers may attempt to claim all available vector resources. 269 - 270 - z = The number of MSI-X capable devices populated in the system. 271 - This policy ensures that maximum (x - y) is distributed 272 - evenly among MSI-X capable devices. 273 - 274 - Note that the PCI subsystem scans y and z during a bus enumeration. 275 - When the PCI subsystem completes configuring MSI/MSI-X capability 276 - structure of a device as requested by its device driver, y/z is 277 - decremented accordingly. 278 - 279 - 5.3.3 Handling MSI-X shortages 280 - 281 - For the case where fewer MSI-X vectors are allocated to a function 282 - than requested, the function pci_enable_msix() will return the 283 - maximum number of MSI-X vectors available to the caller. A device 284 - driver may re-send its request with fewer or equal vectors indicated 285 - in the return. For example, if a device driver requests 5 vectors, but 286 - the number of available vectors is 3 vectors, a value of 3 will be 287 - returned as a result of pci_enable_msix() call. A function could be 288 - designed for its driver to use only 3 MSI-X table entries as 289 - different combinations as ABC--, A-B-C, A--CB, etc. Note that this 290 - patch does not support multiple entries with the same vector. Such 291 - attempt by a device driver to use 5 MSI-X table entries with 3 vectors 292 - as ABBCC, AABCC, BCCBA, etc will result as a failure by the function 293 - pci_enable_msix(). Below are the reasons why supporting multiple 294 - entries with the same vector is an undesirable solution. 295 - 296 - - The PCI subsystem cannot determine the entry that 297 - generated the message to mask/unmask MSI while handling 298 - software driver ISR. Attempting to walk through all MSI-X 299 - table entries (2048 max) to mask/unmask any match vector 300 - is an undesirable solution. 301 - 302 - - Walking through all MSI-X table entries (2048 max) to handle 303 - SMP affinity of any match vector is an undesirable solution. 304 - 305 - 5.3.4 API pci_enable_msix 244 + 5.3.2 API pci_enable_msix 306 245 307 246 int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec) 308 247 ··· 278 339 specified in second argument, or a result of no available vector, 279 340 or a result of failing to initialize MSI-X table entries. 280 341 281 - 5.3.5 API pci_disable_msix 342 + 5.3.3 API pci_disable_msix 282 343 283 344 void pci_disable_msix(struct pci_dev *dev) 284 345 ··· 288 349 on before calling this API. Failure to do so results in a BUG_ON() and 289 350 a device will be left with MSI-X enabled and leaks its vectors. 290 351 291 - 5.3.6 MSI-X mode vs. legacy mode diagram 352 + 5.3.4 MSI-X mode vs. legacy mode diagram 292 353 293 354 The below diagram shows the events which switch the interrupt 294 355 mode on the MSI-X capable device function between MSI-X mode and ··· 346 407 MSI/MSI-X support requires support from both system hardware and 347 408 individual hardware device functions. 348 409 349 - 5.5.1 System hardware support 410 + 5.5.1 Required x86 hardware support 350 411 351 412 Since the target of MSI address is the local APIC CPU, enabling 352 413 MSI/MSI-X support in the Linux kernel is dependent on whether existing