net/nfp: improve PF probing logic
authorHeinrich Kuhn <heinrich.kuhn@netronome.com>
Wed, 9 Jun 2021 14:08:13 +0000 (16:08 +0200)
committerAndrew Rybchenko <Andrew.Rybchenko@oktetlabs.ru>
Fri, 2 Jul 2021 17:03:03 +0000 (19:03 +0200)
commit82caefd8d76508e4728a70b89aacb9b81710adb0
tree1aab48edc18c5c1ca720b5e97122e166b9271ebf
parent634b73104482df418eb3696f2d340c4f184e953a
net/nfp: improve PF probing logic

When using rte_eth_dev_pci_generic_probe() during probing a
rte_eth_dev will be created with the name field corresponding to the PCI
address of the device. NFP4000/6000 devices only have a single PF (but
potentially multiple physical ports). This means that in a simple two
port example the rte_eth_devices[] array will be populated with two
devices: 0000:02:00.0 and 0000:02:00.0_port1. This is inconsistent and
not ideal. It will also cause issues when a secondary process tries to
attach to these ports.

This patch removes the use of rte_eth_dev_pci_generic_probe() and
allocates eth_dev's for each physical port during PF initialization,
giving them more consistent names.

Fixes: 5e15e799d697 ("net/nfp: create separate entity for PF device")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
drivers/net/nfp/nfp_net.c
drivers/net/nfp/nfp_net_pmd.h