git: 7b9dbfc95e09 - main - fixup! mlx5/linuxkpi: Add MLX5_PCI_DEV_IS_VF to mlx5_core_pci_table
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 16 Sep 2026 14:12:54 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=7b9dbfc95e09c9174178f41404f02bbb76399421
commit 7b9dbfc95e09c9174178f41404f02bbb76399421
Author: Ariel Ehrenberg <aehrenberg@nvidia.com>
AuthorDate: 2026-07-28 10:38:58 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-09-16 14:12:07 +0000
fixup! mlx5/linuxkpi: Add MLX5_PCI_DEV_IS_VF to mlx5_core_pci_table
Use designated initializers for .class and .class_mask in PCI_VDEVICE(),
and set .driver_data explicitly on the VF entries, rather than relying on
positional initializers.
Sponsored by: NVidia networking
MFC after: 1 month
---
sys/compat/linuxkpi/common/include/linux/pci.h | 3 ++-
sys/dev/mlx5/mlx5_core/mlx5_main.c | 16 ++++++++--------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h
index 4cdc68412adb..3bf8fec7f587 100644
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -98,7 +98,8 @@ MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \
#define PCI_VDEVICE(_vendor, _device) \
.vendor = PCI_VENDOR_ID_##_vendor, .device = (_device), \
- .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0
+ .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, \
+ .class = 0, .class_mask = 0
#define PCI_DEVICE(_vendor, _device) \
.vendor = (_vendor), .device = (_device), \
.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c
index 0b4c4d49ff7d..749fa262351b 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_main.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c
@@ -2112,19 +2112,19 @@ static void shutdown_one(struct pci_dev *pdev)
*/
static const struct pci_device_id mlx5_core_pci_table[] = {
{ PCI_VDEVICE(MELLANOX, 4113) }, /* Connect-IB */
- { PCI_VDEVICE(MELLANOX, 4114), MLX5_PCI_DEV_IS_VF}, /* Connect-IB VF */
+ { PCI_VDEVICE(MELLANOX, 4114), .driver_data = MLX5_PCI_DEV_IS_VF}, /* Connect-IB VF */
{ PCI_VDEVICE(MELLANOX, 4115) }, /* ConnectX-4 */
- { PCI_VDEVICE(MELLANOX, 4116), MLX5_PCI_DEV_IS_VF}, /* ConnectX-4 VF */
+ { PCI_VDEVICE(MELLANOX, 4116), .driver_data = MLX5_PCI_DEV_IS_VF}, /* ConnectX-4 VF */
{ PCI_VDEVICE(MELLANOX, 4117) }, /* ConnectX-4LX */
- { PCI_VDEVICE(MELLANOX, 4118), MLX5_PCI_DEV_IS_VF}, /* ConnectX-4LX VF */
+ { PCI_VDEVICE(MELLANOX, 4118), .driver_data = MLX5_PCI_DEV_IS_VF}, /* ConnectX-4LX VF */
{ PCI_VDEVICE(MELLANOX, 4119) }, /* ConnectX-5, PCIe 3.0 */
- { PCI_VDEVICE(MELLANOX, 4120), MLX5_PCI_DEV_IS_VF}, /* ConnectX-5 VF */
+ { PCI_VDEVICE(MELLANOX, 4120), .driver_data = MLX5_PCI_DEV_IS_VF}, /* ConnectX-5 VF */
{ PCI_VDEVICE(MELLANOX, 4121) }, /* ConnectX-5 Ex */
- { PCI_VDEVICE(MELLANOX, 4122), MLX5_PCI_DEV_IS_VF}, /* ConnectX-5 Ex VF */
+ { PCI_VDEVICE(MELLANOX, 4122), .driver_data = MLX5_PCI_DEV_IS_VF}, /* ConnectX-5 Ex VF */
{ PCI_VDEVICE(MELLANOX, 4123) }, /* ConnectX-6 */
- { PCI_VDEVICE(MELLANOX, 4124), MLX5_PCI_DEV_IS_VF}, /* ConnectX-6 VF */
+ { PCI_VDEVICE(MELLANOX, 4124), .driver_data = MLX5_PCI_DEV_IS_VF}, /* ConnectX-6 VF */
{ PCI_VDEVICE(MELLANOX, 4125) }, /* ConnectX-6 Dx */
- { PCI_VDEVICE(MELLANOX, 4126), MLX5_PCI_DEV_IS_VF}, /* ConnectX Family mlx5Gen Virtual Function */
+ { PCI_VDEVICE(MELLANOX, 4126), .driver_data = MLX5_PCI_DEV_IS_VF}, /* ConnectX Family mlx5Gen Virtual Function */
{ PCI_VDEVICE(MELLANOX, 4127) }, /* ConnectX-6 LX */
{ PCI_VDEVICE(MELLANOX, 4128) },
{ PCI_VDEVICE(MELLANOX, 4129) }, /* ConnectX-7 */
@@ -2144,7 +2144,7 @@ static const struct pci_device_id mlx5_core_pci_table[] = {
{ PCI_VDEVICE(MELLANOX, 4143) },
{ PCI_VDEVICE(MELLANOX, 4144) },
{ PCI_VDEVICE(MELLANOX, 0xa2d2) }, /* BlueField integrated ConnectX-5 network controller */
- { PCI_VDEVICE(MELLANOX, 0xa2d3), MLX5_PCI_DEV_IS_VF }, /* BlueField integrated ConnectX-5 network controller VF */
+ { PCI_VDEVICE(MELLANOX, 0xa2d3), .driver_data = MLX5_PCI_DEV_IS_VF }, /* BlueField integrated ConnectX-5 network controller VF */
{ PCI_VDEVICE(MELLANOX, 0xa2d6) }, /* BlueField-2 integrated ConnectX-6 Dx network controller */
{ PCI_VDEVICE(MELLANOX, 0xa2dc) }, /* BlueField-3 integrated ConnectX-7 network controller */
{ PCI_VDEVICE(MELLANOX, 0xa2df) }, /* BlueField-4 Family integrated network controller */