net: fix PCI class id
Use RTE_PCI_DEVICE macro to set all fields rather than explicitly setting them individually in the code. This shortens the code while helping to future-proof against future changes to the rte_pci_id structure. Fixes: 701c8d80c820 ("pci: support class id probing") Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
This commit is contained in:
parent
2c78ec4a7a
commit
1d1bc87026
@ -5807,22 +5807,16 @@ error:
|
||||
|
||||
static const struct rte_pci_id mlx4_pci_id_map[] = {
|
||||
{
|
||||
.vendor_id = PCI_VENDOR_ID_MELLANOX,
|
||||
.device_id = PCI_DEVICE_ID_MELLANOX_CONNECTX3,
|
||||
.subsystem_vendor_id = PCI_ANY_ID,
|
||||
.subsystem_device_id = PCI_ANY_ID
|
||||
RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
|
||||
PCI_DEVICE_ID_MELLANOX_CONNECTX3)
|
||||
},
|
||||
{
|
||||
.vendor_id = PCI_VENDOR_ID_MELLANOX,
|
||||
.device_id = PCI_DEVICE_ID_MELLANOX_CONNECTX3PRO,
|
||||
.subsystem_vendor_id = PCI_ANY_ID,
|
||||
.subsystem_device_id = PCI_ANY_ID
|
||||
RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
|
||||
PCI_DEVICE_ID_MELLANOX_CONNECTX3PRO)
|
||||
},
|
||||
{
|
||||
.vendor_id = PCI_VENDOR_ID_MELLANOX,
|
||||
.device_id = PCI_DEVICE_ID_MELLANOX_CONNECTX3VF,
|
||||
.subsystem_vendor_id = PCI_ANY_ID,
|
||||
.subsystem_device_id = PCI_ANY_ID
|
||||
RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
|
||||
PCI_DEVICE_ID_MELLANOX_CONNECTX3VF)
|
||||
},
|
||||
{
|
||||
.vendor_id = 0
|
||||
|
@ -610,28 +610,20 @@ error:
|
||||
|
||||
static const struct rte_pci_id mlx5_pci_id_map[] = {
|
||||
{
|
||||
.vendor_id = PCI_VENDOR_ID_MELLANOX,
|
||||
.device_id = PCI_DEVICE_ID_MELLANOX_CONNECTX4,
|
||||
.subsystem_vendor_id = PCI_ANY_ID,
|
||||
.subsystem_device_id = PCI_ANY_ID
|
||||
RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
|
||||
PCI_DEVICE_ID_MELLANOX_CONNECTX4)
|
||||
},
|
||||
{
|
||||
.vendor_id = PCI_VENDOR_ID_MELLANOX,
|
||||
.device_id = PCI_DEVICE_ID_MELLANOX_CONNECTX4VF,
|
||||
.subsystem_vendor_id = PCI_ANY_ID,
|
||||
.subsystem_device_id = PCI_ANY_ID
|
||||
RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
|
||||
PCI_DEVICE_ID_MELLANOX_CONNECTX4VF)
|
||||
},
|
||||
{
|
||||
.vendor_id = PCI_VENDOR_ID_MELLANOX,
|
||||
.device_id = PCI_DEVICE_ID_MELLANOX_CONNECTX4LX,
|
||||
.subsystem_vendor_id = PCI_ANY_ID,
|
||||
.subsystem_device_id = PCI_ANY_ID
|
||||
RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
|
||||
PCI_DEVICE_ID_MELLANOX_CONNECTX4LX)
|
||||
},
|
||||
{
|
||||
.vendor_id = PCI_VENDOR_ID_MELLANOX,
|
||||
.device_id = PCI_DEVICE_ID_MELLANOX_CONNECTX4LXVF,
|
||||
.subsystem_vendor_id = PCI_ANY_ID,
|
||||
.subsystem_device_id = PCI_ANY_ID
|
||||
RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
|
||||
PCI_DEVICE_ID_MELLANOX_CONNECTX4LXVF)
|
||||
},
|
||||
{
|
||||
.vendor_id = 0
|
||||
|
@ -2446,16 +2446,12 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
|
||||
|
||||
static struct rte_pci_id pci_id_nfp_net_map[] = {
|
||||
{
|
||||
.vendor_id = PCI_VENDOR_ID_NETRONOME,
|
||||
.device_id = PCI_DEVICE_ID_NFP6000_PF_NIC,
|
||||
.subsystem_vendor_id = PCI_ANY_ID,
|
||||
.subsystem_device_id = PCI_ANY_ID,
|
||||
RTE_PCI_DEVICE(PCI_VENDOR_ID_NETRONOME,
|
||||
PCI_DEVICE_ID_NFP6000_PF_NIC)
|
||||
},
|
||||
{
|
||||
.vendor_id = PCI_VENDOR_ID_NETRONOME,
|
||||
.device_id = PCI_DEVICE_ID_NFP6000_VF_NIC,
|
||||
.subsystem_vendor_id = PCI_ANY_ID,
|
||||
.subsystem_device_id = PCI_ANY_ID,
|
||||
RTE_PCI_DEVICE(PCI_VENDOR_ID_NETRONOME,
|
||||
PCI_DEVICE_ID_NFP6000_VF_NIC)
|
||||
},
|
||||
{
|
||||
.vendor_id = 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user