net/nfp: support PF multiport
authorAlejandro Lucero <alejandro.lucero@netronome.com>
Fri, 1 Sep 2017 14:12:15 +0000 (15:12 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:48 +0000 (02:49 +0200)
commitc4171b520b3fc84913aa5c22490167f5c47a2d80
treef893b1ab0c1188d3d996c8f1ee68cac6a74a255d
parenta75b4086aaaf06a36b19a185adaf516dde43d47d
net/nfp: support PF multiport

A NFP PF PCI device can have several physical ports, up to 8. Because
DPDK core creates one eth_dev per PCI device, nfp pf probe function
is used. Number of PF ports is obtained from firmware symbol using
NSPU API. Inside PF probe function an eth_dev per port is created and
nfp_net_init invoked for each port.

There are some limitations regarding multiport: rx interrupts and
device hotplug are not supported.

Interrupts are handled with the VFIO or UIO drivers help. Those
drivers just know about PCI devices, so it is not possible, without
changing how DPDK handles interrupts, manage interrupts assigned to
different PF ports.

About hotplug, the problem is this functionality is based on a PCI
device, and although device plugin is possible, which would add as
many ports as supported by firmware, unplug is based on device name
linked to a eth_dev, and device name has a suffix now (_portX, with X
being the port index) which DPDK core is not aware of. While rx
interrupts with multiport could be likely solved with some layer of
indirection, hotplug would require changes to DPDK core.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
drivers/net/nfp/nfp_net.c
drivers/net/nfp/nfp_net_ctrl.h
drivers/net/nfp/nfp_net_pmd.h