During initialization, mac address is read from configuration bar. This is
the default option when using VFs.
This patch adds support for reading the mac address using the NSPU
interface when PMD works with the PF.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Adding a new NSPU command for being able to read and write the ethernet
port table from/to the NFP. This will allow the PMD to put the Link up
or down when a port is started or stopped. Until now, this was performed
by the firmware independently of PMD functionality.
The ethernet port table has also some other useful information that will
be used in further commits.
Usually NSPU is used at device probe time and that is sequential code
execution. However, reading and writing the NFP eth table can be done at
different times and from different cores, and it implies it could happen
a concurrent access. A spinlock is added to the global nspu object for
protecting the NFP and avoiding the concurrent access.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
NFP vNICs use a subset of PCI device BARs. vNIC rx/tx bars point to
NFP hardware queues unit. Unlike vNIC config bar, the NFP address is
always the same so the NFP expansion bar configuration always uses
the same hardcoded physical address.
This patch adds a NSPU API function for getting vNIC rx/tx bars
mapped through a expansion bar using that specific physical address.
The PMD will use the PCI bar offset returned for mapping the vNIC
rx/tx bars.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
NFP vNICs use a subset of PCI device BARs. vNIC config bar depends on
firmware symbol defining how to map it through a NFP expansion bar.
This patch adds a NSPU API function for getting a vNIC config bar
mapped through a expansion bar giving a firmware symbol. The PMD will
use the PCI bar offset returned for accessing the vNIC bar.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
PMD will use this function for uploading the firmware. First, a
symbol resolution is done for finding out if there is a firmware
already there. If not, a NFP reset is called before using NSPU
fw upload code.
PMD PF probe function is now using this logic.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Firmware has symbols helping to configure things like number of
PF ports, vNIC BARs addresses inside NFP memories, or ethernet
link state. Different firmware apps have different things to map
and likely different internal NFP addresses to use.
Host drivers can use the NSPU interface for getting symbol data
regarding different hardware configurations. Once the driver has
the information about a specific object, a mapping is required
configuring an NFP expansion bar creating a device PCI bar window.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Using NSPU interface for fw upload. Firmware file needs to be
installed in specific path inside system firmware directory.
NSPU buffer is used for writing the firmware before sending the
command.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
NSPU interface declares a buffer controlled by the NFP NSP service
processor. It is possible to send commands to the NSP using the NSPU
and this buffer for data related to the command. A command can imply
buffer read, buffer write, both or none.
Initial command for resetting the firmware is added as well which
does not require the buffer at all.
Commands will allow firmware upload, symbol resolution and ethernet
link configuration. Future commands will allow specific offloads like
flow offloads and eBPF offload.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Working with the PF requires access to the NFP for basic configuration.
NSP is the NFP Service Processor helping with hardware and firmware
configuration. NSPU is the NSP user space interface for working with the
NSP.
Configuration through NSPU allows to create PCI BAR windows for accessing
different NFP hardware units, including the BAR window for the NSPU
interface access itself. NFP expansion bar registers are used for creating
those PCI BAR windows. NSPU uses a specific expansion bar which is
reprogrammed for accessing/doing different things.
Other expansion bars will be configured later for configuring the PF vNIC
bars, a subset of PF PCI BARs.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>