Some compilers generate warnings for duplicate symbols for the
set of filter lists current defined in ixgbe_ethdev.h.
This commits moves the definition and declaration to the source
file that actually uses them and provides a function to
initialize the values akin to its flush function.
Signed-off-by: David Harton <dharton@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Radu Nicolau <radu.nicolau@intel.com>
VFs rely on config BAR for getting the MAC address, although a
random one is created a valid address is not found.
A PF port has a fixed MAC which is currently acquired using the NSPU
interface. Some NFP firmwares require the MAC being writing back
to the config BAR for doing proper MAC filtering.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
These capabilities are enabled in current NFP firmwares by
default, but it could be they are not with NFP firmwares to come.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Link speed is not advertised in old firmwares. However, it is safe
to remove the check because reading NFP_NET_CFG_STS returns 0 in
those cases.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
For i40e NIC bond_ethdev_8023ad_flow_verify fails when action queue
index indicates unavailable queue before slaves configuration.
This fix verifies flow settings for queue 0, which is always available,
and checks if slaves max queue number capacity meets requirements.
Fixes: 112891cd27 ("net/bonding: add dedicated HW queues for LACP control")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Previously, for PF statistics we use VSI register for packet count
but use port's register for packet bytes, that cause inconsistent
situation of PF statistics when some VF is active, since it will
cover VF's packet bytes but not packet count.
The patch will take port register for PF packet count back, but still
exclude main vsi's discard packet count.
Just like previous fix, its still not perfect, (since RX packet number
is over counted when there is VF discard packet) but seems it make the
overall better.
Fixes: 9aace75fc8 ("i40e: fix statistics")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Mellanox NICs has a limitation on the number of mbuf segments a multi
segment mbuf can have. The max number depends on the Tx offloads
requested.
The current code not enforce such limitation, which might cause
malformed work requests to be written to the device.
This commit adds verification for the number of mbuf segments posted
to the device. In case of overflow the packet will not be sent.
In addition update the nic documentation with the limitation.
Considering device limitation is 63 data segments in a work request, the
maximum number of segment in mbuf was calculated taking TSO as the worst
case:
max_nb_segs = 63 - (control_segment + ethernet segment +
TSO headers inline + inline segment +
extra inline to align to cacheline)
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
The current Tx error counter counts, according to its description,
the total number of packets not sent when TX ring full. It is reported
to application as part of oerrors field.
The drop due to full ring is not the statistic that should be set on
oerrors field. Such number can be counted by the application using the
return value of the Tx burst function.
The number that should be set there is the number of packets the device
could not transmit in any way, even when it has resources.
Therefore, replace this counter to count the total number of failed
transmitted packets.
Fixes: 87011737b7 ("mlx5: add software counters")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
vPMD Tx function assumes that after the scatter of the
multi-segment packets the next packet will be a single segment packet.
This is not current as the function can return due to lack of resources
without sending all of the multi-segment mbufs sequence.
Fixes: 6cb559d67b ("net/mlx5: add vectorized Rx/Tx burst for x86")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Tx descriptor for TSO embeds packet header to be replicated. If Tx
inline is enabled, there could be additional packet data inlined with
4B inline header ahead. And between the header and additional inlined
packet data, there may be padding to make the inline part aligned to
MLX5_WQE_DWORD_SIZE. In calculating the total size of inlined data,
the size of inline header and padding is missing.
Fixes: 3f13f8c23a ("net/mlx5: support hardware TSO")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
The i40e maintains a single MAC filter table for both
unicast and multicast addresses. The i40e_validate_mac_addr
function was preventing multicast addresses from being added
to the table via i40evf_add_mac_addr. Fixed the issue by
adjusting the check in i40evf_add_mac_addr.
Fixes: 4861cde461 ("i40e: new poll mode driver")
Fixes: 97ac72aa71 ("i40e: support setting VF MAC address")
Cc: stable@dpdk.org
Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
The previous stats code returned only the current TX sub
device stats.
This enhancement extends it to return the sum of all sub
devices stats with history of removed sub-devices.
Dedicated stats accumulator saves the stat history of all
sub device remove events.
Each failsafe sub device contains the last stats asked by
the user and updates the accumulator in removal time.
I would like to implement ultimate snapshot on removal time.
The stats_get API needs to be changed to return error in the
case it is too late to retrieve statistics.
By this way, failsafe can get stats snapshot in removal interrupt
callback for each PMD which can give stats after removal event.
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Extend the LSC event handling to support the device removal as well.
The mlx5 event handling has been made capable of receiving and
signaling several event types at once.
This support includes next:
1. Removal event detection according to the user configuration.
2. Calling to all registered mlx5 removal callbacks.
3. Capabilities extension to include removal interrupt handling.
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Link status is sometimes inconsistent during a LSC event.
When it occurs, the PMD refrains from immediately notifying
the application; instead, an alarm is scheduled to check
link status later and notify the application once it has settled.
In the previous code the alarm callback calls to the interrupt
handler for link status recheck and may cause to unnecessary
interrupt events check.
This patch separates the link status update and the interrupt event
handler to avoid the unnecessary check and arranges the interrupt
handler for more interrupt supports in the future.
Comment was added in the new function to explain the inconsistent
link status reason.
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Updated vmxnet3_mac_addr_set() to store the newly set MAC address.
Modified vmxnet3_write_mac() so the h/w is updated in an endian
neutral manner.
Fixes: 139f39a978 ("vmxnet3: support setting MAC address")
Cc: stable@dpdk.org
Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Shrikrishna Khare <skhare@vmware.com>
vmxnet3 Rx processing should replenish ring buffers after new buffers
are available to prevent the interface from getting stuck in a state
that no new work is processed.
Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Shrikrishna Khare <skhare@vmware.com>
The testpmd was doing old BSD lint style casts of rte_memcpy
to (void). This is unnecessary.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
mirror rule_type can be a bit OR result of multiple mirror type of
a rule.
Fixes: 7ba29a76b1 ("ethdev: rename and extend the mirror type")
Cc: stable@dpdk.org
Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Since interrupt handler is the only function relying on it, merging them
simplifies the code as there is no need for an API to return collected
events.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Link status is sometimes inconsistent during a LSC event. When it occurs,
the PMD refrains from immediately notifying the application; instead, an
alarm is scheduled to check link status later and notify the application
once it has settled.
The problem is that subsequent link status checks are only performed if
additional LSC events occur in the meantime, which is not always the case.
Worse, since support for removal events was added, rescheduled link status
checks may consume them as well without notifying the application. With the
right timing, a link loss occurring just before a device removal event may
hide it from the application.
Fixes: 6dd7b7056d ("net/mlx4: support device removal event")
Fixes: 2d449f7c52 ("net/mlx4: fix assertion failure on link update")
Cc: stable@dpdk.org
Reported-by: Matan Azrad <matan@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
When LSC or RMV events are received by the PMD but are not requested by the
application, a misleading debugging message implying the PMD does not
support them is shown.
Fixes: 6dd7b7056d ("net/mlx4: support device removal event")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
NFP PMD implement now PF and VF drivers. Although the driver
functionality is the same by now, except for initialization, it
will change with future PF additions.
A new feature is required for describing the firmware upload
capability coming with the NFP PF now, so the PF file will be
updated soon in another patch.
SRIOV is not supported by the PF yet, and it is wrong to include it
as a VF driver feature, so none of the files have such a feature.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
NFP PMD has now support for both, PF and VFs. This patch updates
the guide and give some information about implications.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Reviewed-by: John McNamara <john.mcnamara@intel.com>
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>
PMD has to configure the hardware port: link up when port started and
link down when port stopped. This is not required for VFs but it is
for PF ports.
A minor refactoring in PMD stop and close functions is done because the
Link down needs to happen just when device is stopped.
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>
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>
NFP can support several physical ports per PF device. Depending on
firmware info, one or more eth_dev objects will need to be created.
This patch adds the call to create just one eth_dev by now with future
commits supporting the multiport option. Once the eth_dev has been
created, probe function invokes pmd initialization with the new eth_dev.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
nfp_net_init is where a dpdk port related to a eth_dev is initialized.
NFP VF vNICs use VF PCI BARs as they come after SRIOV is enabled. But for
NFP PF vNIC just a subset of PF PCI BARs are used.
This patch adds support for mapping the right PCI BAR subsets for the PF
vNIC. It uses the NSPU API functions introduced previously for configuring
NFP expansion bars.
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>
Configuring the NFP PMD for using the PF requires access through the
NSPU interface for device configuration. This patch adds a specific probe
function for the PF which uses the NSPU interface. Just basic NSPU access
is done by now reading the NSPU ABI version.
NSPU ABI version needs to be greater than 0.19.
No ethernet port is created yet.
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>