Commit Graph

14502 Commits

Author SHA1 Message Date
Thomas Monjalon
e0ae50c687 build: remove redundant _GNU_SOURCE definitions
The feature macro _GNU_SOURCE is defined globally,
but there was some remaining useless settings.

The internal definition in config/meson.build is kept,
all other internal definitions of _GNU_SOURCE are removed,
except in examples, which can be built as external applications.
Note: external applications do not inherit of _GNU_SOURCE.

Fixes: 5d7b673d5f ("mk: build with _GNU_SOURCE defined by default")
Fixes: 28188cee2a ("build: enable BSD features visibility for FreeBSD")
Fixes: e6cdc54cc0 ("net/mlx5: add socket server for external tools")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
2021-03-23 08:41:05 +01:00
Viacheslav Ovsiienko
4eefb20faa net/mlx5: fix Rx metadata leftovers
The Rx metadata might use the metadata register C0 to keep the
values. The same register C0 might be used by kernel for source
vport value handling, kernel uses upper half of the register,
leaving the lower half for application usage.

In the extended metadata mode 1 (dv_xmeta_en devarg is
assigned with value 1) the metadata width is 16 bits only,
the Rx datapath code fetched the entire 32-bit value of the
metadata register and presented one to application. The patch
provides data masking depending on the chosen metadata mode.

Fixes: 6c55b622a9 ("net/mlx5: set dynamic flow metadata in Rx queues")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-03-16 15:53:04 +01:00
Viacheslav Ovsiienko
10787aa2b9 compress/mlx5: support timestamp format
This patch adds support for the timestamp format settings for
the receive and send queues. If the firmware version x.30.1000
or above is installed and the NIC timestamps are configured
with the real-time format, the default zero values for newly
added fields cause the queue creation to fail.

The patch queries the timestamp formats supported by the hardware
and sets the configuration values in queue context accordingly.

Fixes: 8619fcd516 ("compress/mlx5: support queue pair operations")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-03-16 10:05:39 +01:00
Viacheslav Ovsiienko
dd25bd201d regex/mlx5: support timestamp format
This patch adds support for the timestamp format settings for
the receive and send queues. If the firmware version x.30.1000
or above is installed and the NIC timestamps are configured
with the real-time format, the default zero values for newly
added fields cause the queue creation to fail.

The patch queries the timestamp formats supported by the hardware
and sets the configuration values in queue context accordingly.

Fixes: 92f2c6a30f ("regex/mlx5: add send queue")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-03-16 10:05:38 +01:00
Viacheslav Ovsiienko
044423c4db vdpa/mlx5: support timestamp format
This patch adds support for the timestamp format settings for
the receive and send queues. If the firmware version x.30.1000
or above is installed and the NIC timestamps are configured
with the real-time format, the default zero values for newly
added fields cause the queue creation to fail.

The patch queries the timestamp formats supported by the hardware
and sets the configuration values in queue context accordingly.

Fixes: 95276abaaf ("vdpa/mlx5: introduce Mellanox vDPA driver")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-03-16 10:05:36 +01:00
Viacheslav Ovsiienko
d61381ad46 net/mlx5: support timestamp format
This patch adds support for the timestamp format settings for
the receive and send queues. If the firmware version x.30.1000
or above is installed and the NIC timestamps are configured
with the real-time format, the default zero values for newly
added fields cause the queue creation to fail.

The patch queries the timestamp formats supported by the hardware
and sets the configuration values in queue context accordingly.

Fixes: 86fc67fc93 ("net/mlx5: create advanced RxQ object via DevX")
Fixes: ae18a1ae96 ("net/mlx5: support Tx hairpin queues")
Fixes: 15c3807e86 ("common/mlx5: support DevX QP operations")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-03-16 10:05:34 +01:00
Viacheslav Ovsiienko
569ffbc981 common/mlx5: add timestamp format support to DevX
This patch handles the NIC-supported timestamp formats via DevX.
Two different timestamp formats can be provided potentially.
The free-running format provides opaque values captured from
the internal clock counter fed by some independent oscillator.
The free-running frequency is not pre-defined and should be
queried from the NIC. The real-time timestamps are expressed
in nanoseconds, captured from the dedicated UTC counter, that
can be adjusted on the fly and synchronized with some external
reference clock.

Depending on the version and configuration the hardware might
support either FR (free-running) or RT (real-time) timestamps,
per queue basis.

The commit provides the querying information about the supported
timestamp formats and provides the means to configure ones
at queue creation time.

Fixes: e2b4925ef7 ("net/mlx5: support Direct Rules E-Switch")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-03-16 10:05:32 +01:00
Thomas Monjalon
a8a15654ab net/mlx5: reduce log level of alignment message
Having to force an alignment does not impact the user,
so it should not be a warning.
The log level is reduced from warning to debug.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-03-15 14:30:58 +01:00
Thomas Monjalon
1b9e9826ad common/mlx5: remove extra line feed in log messages
The macro DRV_LOG already includes a terminating line feed character
defined in PMD_DRV_LOG_.
The extra line feeds added in some messages are removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-03-15 14:30:57 +01:00
Thomas Monjalon
87acdcc78d net/mlx5: enable debug logs dynamically
Most debug logs are using DRV_LOG(DEBUG,)
but some were using DEBUG().
The macro DEBUG is doing nothing if not compiled with
RTE_LIBRTE_MLX5_DEBUG.

As it is not used in the data path, the macro DEBUG
can be replaced with DRV_LOG.
Then all debug logs can be enabled at runtime with:
	--log-level pmd.net.mlx5:debug

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-03-15 14:30:55 +01:00
Thomas Monjalon
7bc56bd04c net/mlx4: enable debug logs dynamically
The macro DEBUG was doing nothing if not compiled with
RTE_LIBRTE_MLX4_DEBUG.

As it is not used in the data path, it can be always enabled at
compilation time. Then it can be enabled at runtime with:
	--log-level pmd.net.mlx4:debug

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-03-15 14:30:53 +01:00
Wenjun Wu
32667f5b48 net/ice: check some functions return
Fix unchecked return values reported by coverity.

Coverity issue: 349907
Fixes: 03a05924da ("net/ice: support device-specific DDP package loading")
Cc: stable@dpdk.org

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
2021-03-17 10:48:36 +01:00
Xueming Li
d654167641 ethdev: introduce representor type
To support more representor type, this patch introduces representor type
enum. The enum is subject to be extended to support new representor in
patches upcoming.

For each devarg structure, only one type supported.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2021-03-16 20:15:29 +01:00
Vijay Kumar Srivastava
7178fbdce1 common/sfc_efx: move function to get family
Move function to get efx family from net driver into common driver.

Signed-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-16 12:39:42 +01:00
Vijay Kumar Srivastava
dd461e811b net/sfc: skip driver probe for incompatible device class
Driver would be probed only for the net device class.

Signed-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-16 12:39:42 +01:00
Vijay Kumar Srivastava
1adaea57ca common/sfc_efx: support getting device class
Device class argument would be used to select compatible driver.
Driver probe would be skipped for incompatible device class.

Signed-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-16 12:39:41 +01:00
Vijay Kumar Srivastava
b8a896ab97 common/sfc_efx/base: support verifying virtio features
Add an API to verify virtio features supported by device.

Signed-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-16 12:39:41 +01:00
Vijay Kumar Srivastava
46d2b38ba9 common/sfc_efx/base: support getting virtio features
Add an API to get virtio features supported by device.

Signed-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-16 12:39:41 +01:00
Vijay Kumar Srivastava
ce05513b08 common/sfc_efx/base: add virtio build dependency
Add EFSYS_HAS_UINT64 build dependency on EFSYS_OPT_VIRTIO.
virtio features are represented as bitmask in 64-bit unsigned
integer.

Signed-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-16 12:39:41 +01:00
Vijay Srivastava
ec03ce6909 common/sfc_efx/base: support getting virtq doorbell offset
Add an API to query the virtqueue doorbell offset in the BAR for a VI.
For vDPA, the virtio net driver notifies the device directly by writing
doorbell. This API would be invoked from vDPA client driver.

Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-16 12:39:41 +01:00
Vijay Srivastava
4dda72dbde common/sfc_efx/base: add base virtio support for vDPA
In the vDPA mode, only data path is offloaded in the hardware and
control path still goes through the hypervisor and it configures
virtqueues via vDPA driver so new virtqueue APIs are required.

Implement virtio init/fini and virtqueue create/destroy APIs.

Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-16 12:39:41 +01:00
Somnath Kotur
71f5872dd1 net/bnxt: fix Rx and Tx timestamps
timesync adjust and write_time APIs needed to account for the Rx and Tx
timestamp counters as well. Fix it since it was not done earlier.

Fixes: b11cceb83a ("net/bnxt: support timesync")
Cc: stable@dpdk.org

Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-03-12 16:27:03 +01:00
Somnath Kotur
eac4fc71cd net/bnxt: fix xstats get
Fix to return count in xstats get op in all cases.
Driver was returning 0 if the 'xstats' parameter being passed to
xstats_get_op was NULL. This won't work on some applications that
rely on a valid count being passed even in this case so that it can
allocate memory accordingly followed by a reissue of the xstats_get_op
to get the actual stats populated by the driver.

Fixes: 063e59ddd2 ("net/bnxt: fix crash in xstats get")
Cc: stable@dpdk.org

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-03-12 16:24:53 +01:00
Lance Richardson
527b10089c net/bnxt: optimize Tx completion handling
Avoid copying mbuf pointers to separate array for bulk
mbuf free when handling transmit completions for vector
mode transmit.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 16:07:33 +01:00
Ajit Khaparde
87a8fa1287 net/bnxt: rename a member to avoid conflict
Address build issues with Clang and without glibc on ppc64le.
Vector can be a keyword and should not be used in code.
Renaming it to avoid conflict.

Reported-by: Piotr Kubaj <pkubaj@freebsd.org>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:13:49 +01:00
Kalesh AP
3740259eae net/bnxt: mute some failure logs
In the init path, driver ignores few of the HWRM command failures.
There is no need to log the error message in those cases.

Fixes: 3fb93bc7c3 ("net/bnxt: initialize parent PF information")
Fixes: 4e3f887bec ("net/bnxt: support HWRM port PHY qcaps")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:13:29 +01:00
Kalesh AP
b0764e7c20 net/bnxt: fix HWRM and FW incompatibility handling
Fix to return an error when the HWRM version that the driver
is compiled against is incompatible with the FW that is actually
running on the card. This is determined based on the req length
indicated by FW against the value supported in the HWRM.

Fixes: 804e746c7b ("net/bnxt: add hardware resource manager init code")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-03-12 07:13:28 +01:00
Kalesh AP
01406837bf net/bnxt: fix VF info allocation
1. Renamed bnxt_hwrm_alloc_vf_info()/bnxt_hwrm_free_vf_info to
   bnxt_alloc_vf_info()/bnxt_free_vf_info as it does not
   issue any HWRM command to fw.
2. Fix missing unlock when memory allocation fails.

Fixes: b7778e8a1c ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:13:28 +01:00
Kalesh AP
3972281f47 net/bnxt: fix device readiness check
Fix HWRM_VER_GET command to handle DEV_NOT_RDY state.

Driver should fail probe if the device is not ready.
Conversely, the HWRM_VER_GET poll after reset can safely
retry until the existing timeout is exceeded.

Fixes: 804e746c7b ("net/bnxt: add hardware resource manager init code")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:13:27 +01:00
Ajit Khaparde
4fb6ab3f86 net/bnxt: check flush status during ring free
When host SW issues a HWRM_RING_FREE for Tx/Rx/AGG ring in HW,
the FW flushes the BDs associated with the ring and performs other
cleanup in the HW. The host software should ideally check for an
indication from the FW indicating this step has been completed
successfully to avoid unexpected errors during cleanup.

The FW issues a HWRM_DONE response to the RING_FREE request on
the corresponding CQ ring. Poll the CQs during cleanup and
ensure the HWRM_FREE command is completed not just based on the
value of valid bit but also the HWRM_DONE response for the ring.

If the HWRM_DONE response is not seen, force the cleanup to
complete just based on the valid bit.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-03-12 07:13:27 +01:00
Lance Richardson
0f4d2afb09 net/bnxt: refactor mbuf pointer reset
Remove code for setting consumed mbuf pointers to NULL from the
vector receive functions as a minor performance optimization.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-03-12 07:13:27 +01:00
Lance Richardson
25fefa2b17 net/bnxt: fix Rx descriptor status
Fix a number of issues in the bnxt receive descriptor status
function, including:
   - Provide status of receive descriptor instead of completion
     descriptor.
   - Remove invalid comparison of raw ring index with masked ring
     index.
   - Correct misinterpretation of offset parameter as ring index.
   - Correct misuse of completion ring index for mbuf ring (the
     two rings have different sizes).

Fixes: 0fe613bb87 ("net/bnxt: support Rx descriptor status")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:12:30 +01:00
Kalesh AP
53f98141ee net/bnxt: fix PTP support for Thor
On Thor, Rx timestamp is present in the Rx completion record.
Only 32 bits of the timestamp is present in the completion.
The driver needs to periodically poll the current 48 bit
free running timer using the HWRM_PORT_TS_QUERY command.
It can combine the upper 16 bits from the HWRM response
with the lower 32 bits in the Rx completion to produce
the 48 bit timestamp for the Rx packet.

This patch adds an alarm thread to periodically poll the current 48 bit
free running timer using the HWRM_PORT_TS_QUERY command.
This avoids issuing the hwrm command from the Rx handler.
This patch also handles the timer roll over condition.

Fixes: 6cbd89f9f3 ("net/bnxt: support PTP for Thor")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:00:23 +01:00
Kalesh AP
6a4f7139cb net/bnxt: fix FW readiness check during recovery
Moved fw readiness check to a new routine bnxt_check_fw_ready().

During error recovery, driver needs to wait for fw readiness.
For that, it uses bnxt_hwrm_ver_get() function now and that
function does parsing of the VER_GET response as well.

Added a new lightweight function bnxt_hwrm_poll_ver_get() for polling
the firmware readiness which issues VER_GET and checks for success
without processing the command response.

Fixes: df6cd7c1f7 ("net/bnxt: handle reset notify async event from FW")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-03-12 07:00:23 +01:00
Kalesh AP
94131e4ab7 net/bnxt: fix firmware fatal error handling
During some fatal firmware error conditions, the PCI config space
register 0x2e which normally contains the subsystem ID will become
0xffff. This register will revert back to the normal value after
the chip has completed core reset. If we detect this condition,
we can poll this config register immediately for the value to revert.
Because we use config read cycles to poll this register, there is no
possibility of Master Abort if we happen to read it during core reset.
This speeds up recovery significantly as we don't have to wait for the
conservative min_time before polling to see if the firmware has come
out of reset. As soon as this register changes value we can proceed
to re-initialize the device.

Fixes: df6cd7c1f7 ("net/bnxt: handle reset notify async event from FW")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:00:22 +01:00
Kalesh AP
705e0f32f6 net/bnxt: handle echo request async message
This is a new async message that the firmware can send to check if it
can communicate with the driver. This is an added error detection
scheme that firmware can use if it suspects errors in the PCIe
interface. When the driver receives this async message, it will reply
back echoing some data in the async message. If the firmware is not
getting the reply with the proper data after some retries, error
recovery will kick in.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:00:22 +01:00
Kalesh AP
a7dda7e0a0 net/bnxt: log port id in async events
1. Used port id in async event logs.
2. Added a debug log in bnxt_hwrm_func_driver_unregister().

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:00:22 +01:00
Ajit Khaparde
40a643b04e net/bnxt: update to new version of backing store
Update HWRM headers to version 1.10.2.15
which  updates the backing store API for additional TQM rings.
Add support for 9th TQM ring using latest firmware interface.
Also make sure that we set only necessary bits in the enables
field in backing store request.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-03-12 07:00:21 +01:00
Kalesh AP
8ea894a743 net/bnxt: update HWRM structures
Brought in the latest hsi_struct_def_dpdk.h.
HWRM API is now updated to version 1.10.2.15.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:00:21 +01:00
Venkat Duvvuru
c23190303e net/bnxt: fix queues per VNIC
Update queues per VNIC in single queue mode.
bp->rx_num_qs_per_vnic is not initialized in the single queue mode.
As a result of this when an interface is reconfigured to single
queue mode from an existing multiqueue mode, bp->rx_num_qs_per_vnic
is not updated to the value of 1. Hence, the driver will try to
access more than one queue resulting in a crash.

This patch fixes it by initializing bp->rx_num_qs_per_vnic in the
single queue mode as well.

Fixes: 36024b2e7f ("net/bnxt: allow dynamic creation of VNIC")
Cc: stable@dpdk.org

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:00:21 +01:00
Kalesh AP
46413898cf net/bnxt: remove extra blank line
Removed an unnecessary extra blank line.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-03-12 07:00:20 +01:00
Kalesh AP
fc886d04bc net/bnxt: fix VNIC configuration
PMD should not set any flags to receive RoCE traffic while
configuring the vnic. Since the PMD does not support RoCE
some of the flags and code is unused. Clean it up.

Fixes: b7778e8a1c ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:00:20 +01:00
Kalesh AP
a7bc5e04be net/bnxt: remove unused macro
remove HWRM_SEQ_ID_INVALID macro.

Fixes: 804e746c7b ("net/bnxt: add hardware resource manager init code")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-12 07:00:20 +01:00
Andrew Rybchenko
98d26ef7b8 net/sfc: update copyright year
Bump copyright year to 2021.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-12 15:57:16 +01:00
Andrew Rybchenko
672386c1e9 common/sfc_efx: update copyright year
Bump copyright year to 2021.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-12 15:57:16 +01:00
Ciara Loftus
055a393626 net/af_xdp: prefer busy polling
This commit introduces support for preferred busy polling
to the AF_XDP PMD. This feature aims to improve single-core
performance for AF_XDP sockets under heavy load.

A new vdev arg is introduced called 'busy_budget' whose default
value is 64. busy_budget is the value supplied to the kernel
with the SO_BUSY_POLL_BUDGET socket option and represents the
busy-polling NAPI budget. To set the budget to a different value
eg. 256:

--vdev=net_af_xdp0,iface=eth0,busy_budget=256

Preferred busy polling is enabled by default provided a kernel with
version >= v5.11 is in use. To disable it, set the budget to zero.

The following settings are also strongly recommended to be used in
conjunction with this feature:

echo 2 | sudo tee /sys/class/net/eth0/napi_defer_hard_irqs
echo 200000 | sudo tee /sys/class/net/eth0/gro_flush_timeout

.. where eth0 is the interface being used by the PMD.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-03-10 18:49:32 +01:00
Ciara Loftus
63e8989fe5 net/af_xdp: use recvfrom instead of poll syscall
poll() is more expensive and requires more tuning
when used with the upcoming busy polling functionality.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-03-10 18:49:32 +01:00
Ciara Loftus
d96394ea26 net/af_xdp: allow bigger batch sizes
Prior to this commit, the maximum batch sizes for zero-copy and
copy-mode rx and copy-mode tx were set to 32. Apart from zero-copy tx,
the user could never rx/tx any more than 32 packets at a time and
without inspecting the code the user wouldn't be aware of this.

This commit removes these upper limits placed on the user and instead
sets an internal batch size equal to the default ring size (2048).
Batches larger than this are still processed, however they are split
into smaller batches similar to how it's done in other drivers. This is
necessary because some arrays used during rx/tx need to be sized at
compile-time.

Allowing a larger batch size allows for fewer batches and thus larger
bulk operations, fewer ring accesses and fewer syscalls which should
yield improved performance.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-03-10 18:49:32 +01:00
Thomas Monjalon
41e026c1b3 bus/pci: fix Windows kernel driver categories
In Windows probing, the value RTE_PCI_KDRV_NONE was used
instead of RTE_PCI_KDRV_UNKNOWN.
This value covers the mlx case where the kernel driver is in place,
offering a bifurcated mode to the userspace driver.
When the kernel driver is listed as unknown,
there is no special treatment in DPDK probing, contrary to UIO modes.

The value RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used
instead of having a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO.
While adding the new value RTE_PCI_KDRV_NET_UIO
(at the end for ABI compatibility),
the enum of kernel driver categories is annotated.

Fixes: b762221ac2 ("bus/pci: support Windows with bifurcated drivers")
Fixes: c76ec01b45 ("bus/pci: support netuio on Windows")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
2021-03-19 16:23:16 +01:00
Khoa To
6857cb6358 bus/pci: support allow/block lists on Windows
EAL -a and -b options are used to specify which PCI devices are
explicitly allowed or blocked during PCI bus scan.  This evaluation
is missing in the Windows implementation of rte_pci_scan.

This patch provides this missing functionality, so that apps can specify
which devices to ignore during PCI bus scan.

Signed-off-by: Khoa To <khot@microsoft.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-03-16 22:27:25 +01:00