opnsense-src/sys/dev/iavf
John Baldwin 0a515a8d36 pci: Don't cache the count of MSI/MSI-X messages before allocation
A device can in theory change the read-only fields in the MSI/MSI-X
control registers that indicate the maximum number of supported
registers in response to changing other device registers.  For
example, certain Intel networking VFs change the number of messages as
a result of changes in the PCI_IOV_ADD_VF callback.

To support this, always read the current value of the relevant control
register in the *_count and *_alloc methods.  Once messages have been
allocated, the control register value remains cached.

Reported by:	Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by:	Krzysztof Galazka <krzysztof.galazka@intel.com>, erj
Differential Revision:	https://reviews.freebsd.org/D48890

(cherry picked from commit 346020138a0fd20085ebc285f090df38d7d18527)
2025-04-29 10:24:32 -04:00
..
iavf_adminq.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_adminq.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_adminq_cmd.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_alloc.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_common.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_debug.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_devids.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_drv_info.h iflib drivers: Constify PCI ID LUTs 2023-08-17 20:34:23 +02:00
iavf_iflib.h iavf: remove compatibility code and address some warnings 2023-08-23 14:48:11 +02:00
iavf_lib.c pci: Don't cache the count of MSI/MSI-X messages before allocation 2025-04-29 10:24:32 -04:00
iavf_lib.h pci: Don't cache the count of MSI/MSI-X messages before allocation 2025-04-29 10:24:32 -04:00
iavf_opts.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_osdep.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_osdep.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_prototype.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_register.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_status.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_sysctls_common.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_sysctls_iflib.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_txrx_common.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_txrx_iflib.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_type.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_vc_common.c iavf: remove compatibility code and address some warnings 2023-08-23 14:48:11 +02:00
iavf_vc_common.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iavf_vc_iflib.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
if_iavf_iflib.c pci: Don't cache the count of MSI/MSI-X messages before allocation 2025-04-29 10:24:32 -04:00
virtchnl.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00