dpdk.git
5 years agonet/avf: fix unused variables and label
Bruce Richardson [Wed, 19 Sep 2018 10:04:15 +0000 (11:04 +0100)]
net/avf: fix unused variables and label

Compiling with all warnings turned on causes errors about unused variables
and an unused label. Remove these to allow building without having to
disable those warnings.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Fixes: 3fd7a3719c66 ("net/avf: enable ops for MTU setting")
Fixes: d6bde6b5eae9 ("net/avf: enable Rx interrupt")
Fixes: 22b123a36d07 ("net/avf: initialize PMD")
Fixes: 319c421f3890 ("net/avf: enable SSE Rx Tx")
Fixes: a2b29a7733ef ("net/avf: enable basic Rx Tx")
Fixes: 1060591eada5 ("net/avf: enable bulk allocate Rx")

CC: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agonet/igb: support dev reset
Gaetan Rivet [Tue, 18 Sep 2018 08:56:38 +0000 (10:56 +0200)]
net/igb: support dev reset

Add support for passive device reset on IGB ports.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/fm10k: add imissed stats
Julien Meunier [Mon, 10 Sep 2018 15:50:35 +0000 (18:50 +0300)]
net/fm10k: add imissed stats

Add support of imissed and q_errors statistics, reported by PCIE_QPRDC
register (see datasheet, section 11.27.2.60), which exposes the number
of receive packets dropped for a queue.

Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
5 years agonet/ixgbe: fix missing Tx multi-segs capability
Didier Pallard [Wed, 19 Sep 2018 15:04:09 +0000 (17:04 +0200)]
net/ixgbe: fix missing Tx multi-segs capability

In former API, ETH_TXQ_FLAGS_NOMULTSEGS was merely a hint indicating
that application will never send multisegmented packets, allowing
pmd to choose different tx methods accordingly.
In new API, DEV_TX_OFFLOAD_MULTI_SEGS became an offload capability
that is advertised by pmds, some of them do not advertise it and
expect to never receive fragmented packets (octeontx, axgbe)
So an ethdev that supports multisegmented packets should properly
advertise it.

Problem was spotted and tested on e1000, should be also present in
ixgbe_vf representor.

Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports")
Cc: stable@dpdk.org
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agonet/i40e: fix missing Tx multi-segs capability
Didier Pallard [Wed, 19 Sep 2018 15:04:08 +0000 (17:04 +0200)]
net/i40e: fix missing Tx multi-segs capability

In former API, ETH_TXQ_FLAGS_NOMULTSEGS was merely a hint indicating
that application will never send multisegmented packets, allowing
pmd to choose different tx methods accordingly.
In new API, DEV_TX_OFFLOAD_MULTI_SEGS became an offload capability
that is advertised by pmds, some of them do not advertise it and
expect to never receive fragmented packets (octeontx, axgbe)
So an ethdev that supports multisegmented packets should properly
advertise it.

Problem was spotted and tested on e1000, should be also present in
i40e_vf representor.

Fixes: e0cb96204b71 ("net/i40e: add support for representor ports")
Cc: stable@dpdk.org
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agonet/fm10k: fix missing Tx multi-segs capability
Didier Pallard [Wed, 19 Sep 2018 15:04:07 +0000 (17:04 +0200)]
net/fm10k: fix missing Tx multi-segs capability

In former API, ETH_TXQ_FLAGS_NOMULTSEGS was merely a hint indicating
that application will never send multisegmented packets, allowing
pmd to choose different tx methods accordingly.
In new API, DEV_TX_OFFLOAD_MULTI_SEGS became an offload capability
that is advertised by pmds, some of them do not advertise it and
expect to never receive fragmented packets (octeontx, axgbe)
So an ethdev that supports multisegmented packets should properly
advertise it.

Problem was spotted and tested on e1000, should be also present in
fm10k.

Fixes: 30f3ce999e6a ("net/fm10k: convert to new Tx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agonet/e1000: fix missing Tx multi-segs capability
Didier Pallard [Wed, 19 Sep 2018 15:04:06 +0000 (17:04 +0200)]
net/e1000: fix missing Tx multi-segs capability

In former API, ETH_TXQ_FLAGS_NOMULTSEGS was merely a hint indicating
that application will never send multisegmented packets, allowing
pmd to choose different tx methods accordingly.
In new API, DEV_TX_OFFLOAD_MULTI_SEGS became an offload capability
that is advertised by pmds, some of them do not advertise it and
expect to never receive fragmented packets (octeontx, axgbe)
So an ethdev that supports multisegmented packets should properly
advertise it.

Fixes: e5c05e6590ea ("net/e1000: convert to new Tx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agonet/i40e: update Rx offload
Beilei Xing [Fri, 21 Sep 2018 08:25:29 +0000 (16:25 +0800)]
net/i40e: update Rx offload

HW supports Rx scatter offload, this patch updates
Rx scatter offload for PF.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agonet/sfc: fix a Tx queue double release possibility
Igor Romanov [Fri, 14 Sep 2018 07:31:36 +0000 (08:31 +0100)]
net/sfc: fix a Tx queue double release possibility

There are two function that call sfc_tx_qfini():
sfc_tx_fini_queues() and sfc_tx_queue_release(). But only
sfc_tx_queue_release() sets tx_queues pointer of the device data to NULL.
It may lead to the scenario in which a queue is destroyed by
sfc_tx_fini_queues() and after the queue is attempted to be destroyed again
by sfc_tx_queue_release().

Move NULL assignment to sfc_tx_qfini().

Fixes: b1b7ad933b39 ("net/sfc: set up and release Tx queues")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: fix an Rx queue double release possibility
Igor Romanov [Fri, 14 Sep 2018 07:31:35 +0000 (08:31 +0100)]
net/sfc: fix an Rx queue double release possibility

There are two function that call sfc_rx_qfini():
sfc_rx_fini_queues() and sfc_rx_queue_release(). But only
sfc_rx_queue_release() sets rx_queues pointer of the device data to NULL.
It may lead to the scenario in which a queue is destroyed by
sfc_rx_fini_queues() and after the queue is attempted to be destroyed again
by sfc_rx_queue_release().

Move NULL assignment to sfc_rx_qfini().

Fixes: ce35b05c635e ("net/sfc: implement Rx queue setup release operations")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add helper API to make Geneve filter spec
Vijay Srivastava [Mon, 10 Sep 2018 09:33:36 +0000 (10:33 +0100)]
net/sfc/base: add helper API to make Geneve filter spec

Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix MAC Tx stats for less or equal to 64 bytes
Andy Moreton [Mon, 10 Sep 2018 09:33:35 +0000 (10:33 +0100)]
net/sfc/base: fix MAC Tx stats for less or equal to 64 bytes

This statistic should include 64byte and smaller frames.
Fix EF10 calculation to match Siena code.

Fixes: 8c7c723dfe7c ("net/sfc/base: import MAC statistics")
Cc: stable@dpdk.org
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: modify phy caps to indicate FEC request
Richard Houldsworth [Mon, 10 Sep 2018 09:33:34 +0000 (10:33 +0100)]
net/sfc/base: modify phy caps to indicate FEC request

The capability bits to request FEC modes are implicitly valid
when the corresponding FEC mode is a supported capability.
Drivers expect that it is only valid to advertise those
capabilities explicitly marked as supported. The capabilities
reported by firmware is modified with the implicit capabilities
to present the explicit model to drivers.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: improve handling of legacy RSS hash flags
Ivan Malov [Mon, 10 Sep 2018 09:33:33 +0000 (10:33 +0100)]
net/sfc/base: improve handling of legacy RSS hash flags

Client drivers may use either legacy flags, for example,
EFX_RX_HASH_TCPIPV4, or generalised flags, for example,
EFX_RX_HASH(IPV4_TCP, 4TUPLE), to configure RSS hash.
The libefx is able to recognise what scheme is used.

Legacy flags may be consumed directly by a chip-specific handler to
configure the NIC, that is, on EF10, these flags can be used to fill
in legacy RSS mode field in MCDI request. Generalised flags can also
be directly used in EF10-specific handler as they are fully compatible
with additional fields of the same MCDI request.

Legacy flags undergo conversion to generalised flags before they
are consumed by a chip-specific handler. This conversion is used to
make sure that chip-specific handlers expect only generalised flags
in the input for the sake of clarity of the code.

Depending on firmware capabilities, a chip-specififc handler either
supplies the input to the NIC directly, for example,
EFX_RX_HASH(IPV4_TCP, 4TUPLE) flag will enable 4 bits in
RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE field on EF10, or takes
the opportunity to translate the input to enable bits which don't map
to the generic flag, like setting
RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN on EF10 when the firmware
claims no support for additional modes.

However, this approach has introduced a severe problem which can be
reproduced with ultra-low-latency firmware variant. In order to enable
IP hash, EF10-specific handler requires the user to request 2-tuple
hash for IP-other, TCP and UDP traffic classes, unconditionally.
In example, IPv4 hash can be enabled using the following input:
EFX_RX_HASH(IPV4_TCP, 2TUPLE) | EFX_RX_HASH(IPV4_UDP, 2TUPLE) |
EFX_RX_HASH(IPV4, 2TUPLE).
At the same time, on ultra-low-latency firmware, the common code will
never report support for any UDP tuple to the client driver. That is,
in the same example, the driver will use EFX_RX_HASH(IPV4_TCP, 2TUPLE) |
EFX_RX_HASH(IPV4, 2TUPLE). This input will not be recognised by
EF10-specific handler, and RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN
bit will not be set in the MCDI request.

In order to solve the problem, the patch removes conversion code
from chip-specific handlers and adds appropriate code to convert
EFX_RX_HASH() flags to their legacy counterparts to the common scale
mode set function. If the firmware does not support additional modes,
the function will convert generalised flags to legacy flags correctly
without any demand for UDP flags and pass the result to a chip-specific
handler.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: simplify the code to parse RSS hash type
Ivan Malov [Mon, 10 Sep 2018 09:33:32 +0000 (10:33 +0100)]
net/sfc/base: simplify the code to parse RSS hash type

RSS mode bits can be accessed a lot easier in the hash
type value provided that the variable type is uint32_t.
The macro helper can be removed to enhance readability.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: check buffer size for hash flags
Ivan Malov [Mon, 10 Sep 2018 09:33:31 +0000 (10:33 +0100)]
net/sfc/base: check buffer size for hash flags

The efx_rx_scale_hash_flags_get interface is unsafe, as it does not
have an argument for the size of the output buffer used to return
the flags. While the only caller currently supplies a sufficiently
large buffer, this should be checked at runtime to avoid writing
past the end of the buffer.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: use simpler code to check hash algorithm type
Ivan Malov [Mon, 10 Sep 2018 09:33:30 +0000 (10:33 +0100)]
net/sfc/base: use simpler code to check hash algorithm type

The API which is used to list supported hash flags verifies
hash algorithm choice before writing the output. This check
is based on a switch() statement which has only two options
and no distinctive actions to be conducted for each of them.
Use simpler code instead of switch() to improve readability.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add support to get active FEC type
Vijay Srivastava [Mon, 10 Sep 2018 09:33:29 +0000 (10:33 +0100)]
net/sfc/base: add support to get active FEC type

Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix a typo in unicast filter insertion comment
Ivan Malov [Mon, 10 Sep 2018 09:33:28 +0000 (10:33 +0100)]
net/sfc/base: fix a typo in unicast filter insertion comment

Fixes: e7cd430c864f ("net/sfc/base: import SFN7xxx family support")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix name of the argument to store RSS flags
Ivan Malov [Mon, 10 Sep 2018 09:33:27 +0000 (10:33 +0100)]
net/sfc/base: fix name of the argument to store RSS flags

The function used to retrieve supported RSS flags has an
argument which should be named properly to indicate
that it's a pointer.

Fixes: 613cbe75ae99 ("net/sfc/base: add a new means to control RSS hash")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: prevent access to the NIC config before probe
Mark Spender [Mon, 10 Sep 2018 09:33:26 +0000 (10:33 +0100)]
net/sfc/base: prevent access to the NIC config before probe

NIC config is initialized during NIC probe.

Fixes: 19b64c6ac35f ("net/sfc/base: import libefx base")
Cc: stable@dpdk.org
Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix ID retrieval in v3 licensing
Andy Moreton [Mon, 10 Sep 2018 09:33:25 +0000 (10:33 +0100)]
net/sfc/base: fix ID retrieval in v3 licensing

Fixes: 05fce2ce8451 ("net/sfc/base: import libefx licensing")
Fixes: f67e4719147d ("net/sfc/base: fix coding style")
Cc: stable@dpdk.org
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add API to inform libefx of hardware removal
Andy Moreton [Mon, 10 Sep 2018 09:33:24 +0000 (10:33 +0100)]
net/sfc/base: add API to inform libefx of hardware removal

The efx_nic_hw_unavailable() checks ensure that if the NIC hardware
has failed or has been physically removed then libefx will stop
further attempts to access the hardware.

Add an interface for libefx clients to force unavailability, so the
hardware is treated as dead or removed even if still physically present.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add routine to check for hardware presence
Andy Moreton [Mon, 10 Sep 2018 09:33:23 +0000 (10:33 +0100)]
net/sfc/base: add routine to check for hardware presence

Add efx_nic_hw_unavailable() routine to check for hardware presence
before continuing with NIC operations.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix out of bounds read when dereferencing sdup
Gautam Dawar [Mon, 10 Sep 2018 09:33:22 +0000 (10:33 +0100)]
net/sfc/base: fix out of bounds read when dereferencing sdup

Introduce and use macro to make sure that MCDI buffers allocated
on stack are rounded up properly.

Fixes: 6f619653b9b1 ("net/sfc/base: import MCDI implementation")
Fixes: f7dc06bf35f2 ("net/sfc/base: import 5xxx/6xxx family support")
Fixes: e7cd430c864f ("net/sfc/base: import SFN7xxx family support")
Fixes: 1dae25112a54 ("net/sfc/base: import built-in selftest")
Fixes: 0a7864349106 ("net/sfc/base: import PHY statistics")
Fixes: 8c7c723dfe7c ("net/sfc/base: import MAC statistics")
Fixes: 5935cd8c47d3 ("net/sfc/base: import RSS support")
Fixes: 9ee64bd404fc ("net/sfc/base: import loopback control")
Fixes: dfb3b1ce15f6 ("net/sfc/base: import monitors access via MCDI")
Fixes: d96a34d165b1 ("net/sfc/base: import NVRAM support")
Fixes: 05fce2ce8451 ("net/sfc/base: import libefx licensing")
Fixes: ba6afee9a81e ("net/sfc/base: add advanced function to extract FW version")
Fixes: c7815c1d1f20 ("net/sfc/base: use proper MCDI command for encap filters")
Fixes: 17551f6dffcc ("net/sfc/base: add API to control UDP tunnel ports")
Fixes: eff9b666eae5 ("net/sfc/base: move RxDP config get to EF10 NIC code")
Fixes: 4aab7f07a645 ("net/sfc/base: refactor EF10 get datapath capabilities")
Fixes: 480a13044b8b ("net/sfc/base: support FW subvariant choice")
Fixes: 6f60cc4a78b6 ("net/sfc/base: support equal stride super-buffer Rx mode")
Fixes: 9a733758c046 ("net/sfc/base: support MARK and FLAG actions in filters")
Cc: stable@dpdk.org
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add information if TSO workaround is required
Mark Spender [Mon, 10 Sep 2018 09:33:21 +0000 (10:33 +0100)]
net/sfc/base: add information if TSO workaround is required

In SF bug 61297 it's been confirmed that the hardware does not always
calculate the TCP checksum correctly with TSO sends.

The value of the Total Length field (IPv4) or Payload Length field
(IPv6) is the critical factor. We're sufficiently confident that if
these fields are zero then the checksum will be calculated correctly.

The information may be used by the drivers to check if the workaround is
required when FATSOv2 is implemented.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: avoid usage of too big arrays on stack
Martin Harvey [Mon, 10 Sep 2018 09:33:20 +0000 (10:33 +0100)]
net/sfc/base: avoid usage of too big arrays on stack

Found by PreFAST static analysis.

Fixes: 1dae25112a54 ("net/sfc/base: import built-in selftest")
Fixes: d96a34d165b1 ("net/sfc/base: import NVRAM support")
Cc: stable@dpdk.org
Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: generalise EF10 NVRAM buffer interface
Richard Houldsworth [Mon, 10 Sep 2018 09:33:19 +0000 (10:33 +0100)]
net/sfc/base: generalise EF10 NVRAM buffer interface

The SFN driver's PartitionControl WMI object requires an API to parse
and filter partition data in TLV format, particularly for the Dynamic
Config partition. The ef10_nvram_buffer functions provide this
functionality but are tied to use with license partition only.
Modify functions so they are applicable to all TLV partitions and add
functions to support in-place tag modification.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add accessor for default port mode
Richard Houldsworth [Mon, 10 Sep 2018 09:33:18 +0000 (10:33 +0100)]
net/sfc/base: add accessor for default port mode

Extend efx_mcdi_get_port_modes() to optionally pass on the default
port mode field. This provides a more direct way of handling the case
where the dynamic config does not specify the port mode than the
alternative of a lookup table indexed by MCFW subtype.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add buffer editing functions to boot config
Richard Houldsworth [Mon, 10 Sep 2018 09:33:17 +0000 (10:33 +0100)]
net/sfc/base: add buffer editing functions to boot config

Functions to process the DHCP option list format used by the expansion
ROM config buffers, to support extracting and updating of individual
options.
The initial use case is the driver presenting the global and per-PF
options as separate items, with the driver implementing the
synchronization of global options across the configuration buffers
for all PFs.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add API to retrieve sensor limits
Martin Harvey [Mon, 10 Sep 2018 09:33:16 +0000 (10:33 +0100)]
net/sfc/base: add API to retrieve sensor limits

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: check size of memory to read sensors data to
Martin Harvey [Mon, 10 Sep 2018 09:33:15 +0000 (10:33 +0100)]
net/sfc/base: check size of memory to read sensors data to

Size of provided memory should be consistent with specified size.

Fixes: dfb3b1ce15f6 ("net/sfc/base: import monitors access via MCDI")
Cc: stable@dpdk.org
Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add generated description of sensors
Martin Harvey [Mon, 10 Sep 2018 09:33:14 +0000 (10:33 +0100)]
net/sfc/base: add generated description of sensors

Description of sensors is generated from firmware sources.

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: remove probes when a Tx queue is too full
Mark Spender [Mon, 10 Sep 2018 09:33:13 +0000 (10:33 +0100)]
net/sfc/base: remove probes when a Tx queue is too full

No need for probe messages when a TxQ is too full for a post to be done.

Existing drivers check if there is room in the queue before posting
descriptors, even though efx_tx_qdesc_post() does the check itself.

The new SFN Windows driver doesn't perform the check before calling
efx_tx_qdesc_post(), but that means these probes can get frequently
printed out. It's normal driver behaviour so there's no need to print
an error.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: refactor monitors support
Martin Harvey [Mon, 10 Sep 2018 09:33:12 +0000 (10:33 +0100)]
net/sfc/base: refactor monitors support

Remove obsolete monitor types since Falcon SFN4000 series adapters
no longer supported by libefx.
Rename MCDI monitors to be consistent with YML.
The code may be simplified and generalized since only MCDI monitors
remain.

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add check for TUNNEL module in NIC reset API
Vijay Srivastava [Mon, 10 Sep 2018 09:33:11 +0000 (10:33 +0100)]
net/sfc/base: add check for TUNNEL module in NIC reset API

Fixes: 17551f6dffcc ("net/sfc/base: add API to control UDP tunnel ports")
Cc: stable@dpdk.org
Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: move empty efsys definitions to EFX headers
Martin Harvey [Mon, 10 Sep 2018 09:33:10 +0000 (10:33 +0100)]
net/sfc/base: move empty efsys definitions to EFX headers

Move empty definitions for platform-specific annotations from efsys.h
to EFX headers.

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix outer IPID field in TSO option descriptors
Vijay Srivastava [Mon, 10 Sep 2018 09:33:09 +0000 (10:33 +0100)]
net/sfc/base: fix outer IPID field in TSO option descriptors

Fixes: 912e603706c5 ("net/sfc/base: add outer IP ID parameter to TSOv2 descriptor")
Cc: stable@dpdk.org
Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add more definitions of partitions
Paul Fox [Mon, 10 Sep 2018 09:33:08 +0000 (10:33 +0100)]
net/sfc/base: add more definitions of partitions

Add definitions of dynamic config and expansion ROM backup
partitions.

Signed-off-by: Paul Fox <pfox@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix build because of no declaration
Andrew Rybchenko [Mon, 10 Sep 2018 09:33:07 +0000 (10:33 +0100)]
net/sfc/base: fix build because of no declaration

Functions declared in mcdi_mon.h are implemented in mcdi_mon.c.
The build fails if compiler options require declaration before definition.

Fixes: dfb3b1ce15f6 ("net/sfc/base: import monitors access via MCDI")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add space after sizeof
Andy Moreton [Mon, 10 Sep 2018 09:33:06 +0000 (10:33 +0100)]
net/sfc/base: add space after sizeof

Required by GLD cstyle.

Fixes: d4f4b8f9d260 ("net/sfc/base: make RxQ type data an union")
Cc: stable@dpdk.org
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: properly align on line continuation
Andy Moreton [Mon, 10 Sep 2018 09:33:05 +0000 (10:33 +0100)]
net/sfc/base: properly align on line continuation

Fixes: 19b64c6ac35f ("net/sfc/base: import libefx base")
Cc: stable@dpdk.org
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix SAL annotation for input buffers
Martin Harvey [Mon, 10 Sep 2018 09:33:04 +0000 (10:33 +0100)]
net/sfc/base: fix SAL annotation for input buffers

Fixes: d96a34d165b1 ("net/sfc/base: import NVRAM support")
Cc: stable@dpdk.org
Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: highlight that image layout header generated
Andrew Jackson [Mon, 10 Sep 2018 09:33:03 +0000 (10:33 +0100)]
net/sfc/base: highlight that image layout header generated

EF10 signed image layout header is generated from firmware sources.

Signed-off-by: Andrew Jackson <ajackson@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix output buffer SAL annotation
Martin Harvey [Mon, 10 Sep 2018 09:33:02 +0000 (10:33 +0100)]
net/sfc/base: fix output buffer SAL annotation

Found by PreFAST warnings.

Fixes: 3f2f0189dd44 ("net/sfc/base: add signed image layout support")
Cc: stable@dpdk.org
Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix invalid order of memset arguments
Martin Harvey [Mon, 10 Sep 2018 09:33:01 +0000 (10:33 +0100)]
net/sfc/base: fix invalid order of memset arguments

Found by PreFAST.

Fixes: 3f2f0189dd44 ("net/sfc/base: add signed image layout support")
Cc: stable@dpdk.org
Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix PreFAST warnings because of unused return
Martin Harvey [Mon, 10 Sep 2018 09:33:00 +0000 (10:33 +0100)]
net/sfc/base: fix PreFAST warnings because of unused return

Fixes: 19b64c6ac35f ("net/sfc/base: import libefx base")
Fixes: d96a34d165b1 ("net/sfc/base: import NVRAM support")
Fixes: e7cd430c864f ("net/sfc/base: import SFN7xxx family support")
Cc: stable@dpdk.org
Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/vmxnet3: support stats reset
Yogev Chaimovich [Thu, 20 Sep 2018 06:37:05 +0000 (06:37 +0000)]
net/vmxnet3: support stats reset

'stats_reset()' callback was missing because the device backend doesn't
support it.

This commit adds a workaround to this and implements the callback by
taking a snapshot of the stats (SNAPSHOT) each time 'stats_reset()'
is called.  When getting stats with 'stats_get()', hw stats which
always increase reduce SNAPSHOT stats.
That's how we get the "real" stats since the last 'stats_reset()'.

Signed-off-by: Yogev Chaimovich <yogev@cgstowernetworks.com>
Acked-by: Yong Wang <yongwang@vmware.com>
5 years agonet: fix Intel prepare function for IP checksum offload
Didier Pallard [Wed, 19 Sep 2018 14:42:08 +0000 (16:42 +0200)]
net: fix Intel prepare function for IP checksum offload

Current Intel tx prepare function does not properly handle the
case where only IP checksum is requested, without requesting
any L4 checksum or TSO: IP checksum is not properly reset to 0
and output packet may contain invalid IP checksum.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoapp/testpmd: fix missing jump action in flow action
Reshma Pattan [Wed, 19 Sep 2018 14:01:05 +0000 (15:01 +0100)]
app/testpmd: fix missing jump action in flow action

Added missing JUMP flow action in flow_action array.
Without this the flow rule cannot be created for JUMP action.

Fixes: 938a184a18 ("app/testpmd: implement basic support for flow API")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agoapp/testpmd: add check for Rx offload security flag
Kevin Laatz [Mon, 10 Sep 2018 16:28:54 +0000 (17:28 +0100)]
app/testpmd: add check for Rx offload security flag

Add a check for the DEV_RX_OFFLOAD_SECURITY flag to the
port_offload_cap_display().

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agonet/pcap: generate unique MAC addresses for interfaces
Cian Ferriter [Mon, 10 Sep 2018 15:52:17 +0000 (16:52 +0100)]
net/pcap: generate unique MAC addresses for interfaces

The MAC addresses are generated in a similar manner as in the TAP PMD,
where the address is based on the number of PCAP ports created.

This is useful for the purposes of debugging DPDK applications using
PCAP devices instead of real devices where multiple devices should still
have unique MAC addresses. This method was chosen over randomly
assigning MAC addresses to make the creation of pcaps, specifically
matching the destination ethernet address field to an interface, easier.

Signed-off-by: Cian Ferriter <cian.ferriter@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/failsafe: support runtime Tx queues setup
Ian Dolzhansky [Fri, 31 Aug 2018 16:09:38 +0000 (17:09 +0100)]
net/failsafe: support runtime Tx queues setup

Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/failsafe: support runtime Rx queues setup
Ian Dolzhansky [Fri, 31 Aug 2018 16:09:37 +0000 (17:09 +0100)]
net/failsafe: support runtime Rx queues setup

Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/failsafe: add Tx queue start and stop functions
Ian Dolzhansky [Thu, 20 Sep 2018 13:55:52 +0000 (14:55 +0100)]
net/failsafe: add Tx queue start and stop functions

Support Tx queue deferred start.

Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/failsafe: add Rx queue start and stop functions
Ian Dolzhansky [Thu, 20 Sep 2018 13:55:51 +0000 (14:55 +0100)]
net/failsafe: add Rx queue start and stop functions

Support Rx queue deferred start.

Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/failsafe: add checks for deferred queue setup
Ian Dolzhansky [Thu, 20 Sep 2018 13:55:50 +0000 (14:55 +0100)]
net/failsafe: add checks for deferred queue setup

Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoapp/testpmd: add queue deferred start switch
Ian Dolzhansky [Thu, 20 Sep 2018 13:55:49 +0000 (14:55 +0100)]
app/testpmd: add queue deferred start switch

Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/failsafe: fix crash on slave queue release
Igor Romanov [Fri, 31 Aug 2018 16:16:32 +0000 (17:16 +0100)]
net/failsafe: fix crash on slave queue release

Releasing a queue that is already released by slave may cause a
segmentation fault. For example, after a successfull device
configuration a queue is set up. Afterwards the device is reconfigured
with an invalid argument, forcing slaves to release the queues
(e.g. rte_eth_dev.data.tx_queues). Finally the failsafe's queues
are released. The queue release functions also try to release slaves'
queues using ETH(sdev)->data->tx_queues which is NULL at the time.

Add checks for NULL slaves' Tx and Rx queues before releasing them.

Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/ifc: support live migration
Xiao Wang [Mon, 10 Sep 2018 11:01:23 +0000 (19:01 +0800)]
net/ifc: support live migration

IFCVF can help to log dirty page in live migration stage,
each queue's index can be read and configured to support
VHOST_USER_GET_VRING_BASE and VHOST_USER_SET_VRING_BASE.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Tested-by: Xiaolong Ye <xiaolong.ye@intel.com>
5 years agonet/ixgbe: check firmware status at init
Xiaoyun Li [Wed, 26 Sep 2018 09:04:56 +0000 (17:04 +0800)]
net/ixgbe: check firmware status at init

Check the firmware status at init time. If the firmware is in
recovery mode, alert the user to check it.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbe/base: update version
Xiaoyun Li [Mon, 17 Sep 2018 09:28:14 +0000 (17:28 +0800)]
net/ixgbe/base: update version

Update README file to specify the version of CID drop.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbe/base: support DCB registers dump
Xiaoyun Li [Mon, 17 Sep 2018 09:28:13 +0000 (17:28 +0800)]
net/ixgbe/base: support DCB registers dump

Add support for DCB registers dump.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbe/base: update X550 SFP identification
Xiaoyun Li [Mon, 17 Sep 2018 09:28:12 +0000 (17:28 +0800)]
net/ixgbe/base: update X550 SFP identification

Use ixgbe_identify_sfp_module_X550em to update SFP identification
flow. ixgbe_identify_sfp_module_X550em includes specific checks for
X550 about supported SFP modules.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbe/base: replace an operation in X550 setup
Xiaoyun Li [Mon, 17 Sep 2018 09:28:11 +0000 (17:28 +0800)]
net/ixgbe/base: replace an operation in X550 setup

Replace "=" operation with "|=" operation to only set the intended
register bits.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbe/base: add FW recovery mode check
Xiaoyun Li [Mon, 17 Sep 2018 09:28:10 +0000 (17:28 +0800)]
net/ixgbe/base: add FW recovery mode check

Add FM NVM recovery mode check. Allow the software to detect this.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbe/base: cleanup codes
Xiaoyun Li [Mon, 17 Sep 2018 09:28:09 +0000 (17:28 +0800)]
net/ixgbe/base: cleanup codes

Cleanup UNREFERENCED_1PARAMETER() macro because "hw" is used.
And remove Light Spring codes because the device was never
productised. And cleanup unused bypass codes.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbe/base: update the license
Xiaoyun Li [Mon, 17 Sep 2018 09:28:08 +0000 (17:28 +0800)]
net/ixgbe/base: update the license

Update the GPL and BSD license headers to use the SPDX License
Identifier instead.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/virtio-user: fix memory hotplug support in vhost-kernel
Tiwei Bie [Wed, 5 Sep 2018 04:28:52 +0000 (12:28 +0800)]
net/virtio-user: fix memory hotplug support in vhost-kernel

It's possible to have much more hugepage backed memory regions
than what vhost-kernel supports due to the memory hotplug, which
may cause problems. A better solution is to have the virtio-user
pass all the memory ranges reserved by DPDK to vhost-kernel.

Fixes: 12ecb2f63b12 ("net/virtio-user: support memory hotplug")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio-user: avoid parsing process mappings
Tiwei Bie [Wed, 5 Sep 2018 04:28:51 +0000 (12:28 +0800)]
net/virtio-user: avoid parsing process mappings

Recently some memory APIs were introduced to allow users to
get the file descriptor and offset for each memory segment.
We can leverage those APIs to get rid of the /proc magic on
memory table preparation in vhost-user backend.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio-user: fix deadlock in memory events callback
Tiwei Bie [Wed, 5 Sep 2018 04:28:50 +0000 (12:28 +0800)]
net/virtio-user: fix deadlock in memory events callback

Deadlock can occur when allocating memory if a vhost-kernel
based virtio-user device is in use. To fix the deadlock,
we will take memory hotplug lock explicitly in virtio-user
when necessary, and always call the _thread_unsafe memory
functions.

Bugzilla ID: 81
Fixes: 12ecb2f63b12 ("net/virtio-user: support memory hotplug")
Cc: stable@dpdk.org
Reported-by: Seán Harte <seanbh@gmail.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Tested-by: Seán Harte <seanbh@gmail.com>
Reviewed-by: Seán Harte <seanbh@gmail.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/qede: support device reset
Shahed Shaikh [Sat, 8 Sep 2018 20:31:06 +0000 (13:31 -0700)]
net/qede: support device reset

Implement eth_dev_ops->dev_reset callback.

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
5 years agonet/qede/base: fix MFW FLR flow
Shahed Shaikh [Sat, 8 Sep 2018 20:31:05 +0000 (13:31 -0700)]
net/qede/base: fix MFW FLR flow

Management firmware does not properly clean IGU block in PF FLR flow
which may result in undelivered attentions for link events from
default status block.
Add a workaround in PMD to execute extra IGU cleanup right after PF FLR
is done.

Fixes: 9e2f08a4ad5f ("net/qede/base: add request for PF FLR before load request")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
5 years agonet/qede: support Rx descriptor status
Shahed Shaikh [Sat, 8 Sep 2018 20:31:04 +0000 (13:31 -0700)]
net/qede: support Rx descriptor status

This patch implement eth_dev_ops->rx_descriptor_status
callback.
Walk through receive completion ring to calculate receive
descriptors used by firmware and then provide the status of
offset accordingly.

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
5 years agonet/qede: fix Rx buffer size calculation
Shahed Shaikh [Sat, 8 Sep 2018 20:31:03 +0000 (13:31 -0700)]
net/qede: fix Rx buffer size calculation

 - HW does not include CRC in received frame when passed to host,
   so no need to consider CRC length while calculating Rx buffer size.
 - In scattered Rx mode, driver may allocate Rx buffer larger than
   the size of mbuf because it tries to adjust the buffer size to cache
   line size by ceiling it. Fix this by flooring the size instead of
   ceiling.
 - Consider the rule imposed by HW regarding the minimum size of Rx buffer
   in scattered Rx mode -
   (MTU + Maximum L2 Header Size + 2) / ETH_RX_MAX_BUFF_PER_PKT

Fixes: f6033f2497e7 ("net/qede: fix minimum buffer size and scatter Rx check")
CC: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
5 years agonet/qede: support generic flow API
Shahed Shaikh [Sat, 8 Sep 2018 20:31:02 +0000 (13:31 -0700)]
net/qede: support generic flow API

- Add support for rte_flow_validate(), rte_flow_create() and
  rte_flow_destroy() APIs
- This patch adds limited support for the flow items
  because of the limited filter profiles supported by HW.
- Only 4 tuples - src and dst IP (v4 or v6) addresses and
  src and dst port IDs of TCP or UDP.
- also, only redirect to queue action is supported.

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
5 years agonet/qede: refactor flow director into generic aRFS
Shahed Shaikh [Sat, 8 Sep 2018 20:31:01 +0000 (13:31 -0700)]
net/qede: refactor flow director into generic aRFS

- In order to prepare the base for RTE FLOW support,
  convert common code used for flow director support
  into common aRFS code.

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
5 years agonet/qede: fix flow director for IPv6 filter
Shahed Shaikh [Sat, 8 Sep 2018 20:31:00 +0000 (13:31 -0700)]
net/qede: fix flow director for IPv6 filter

- PMD does not fill vtc_flow field of IPv6 header while
  constructing a packet for IPv6 filter. Hence filter was
  not getting applied properly.
- IPv6 addresses got swapped while copying src and dst addresses.
- Same issue with UDP and TCP port ids.

Fixes: 622075356e8f ("net/qede: support ntuple and flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
5 years agonet/qede: reorganize filter code
Shahed Shaikh [Sat, 8 Sep 2018 20:30:59 +0000 (13:30 -0700)]
net/qede: reorganize filter code

 - rename qede_fdir.c to qede_filter.c
 - move all filter code to qede_filter.c

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
5 years agonet/qede/base: use pointer for bytes length read
Rasesh Mody [Sat, 8 Sep 2018 20:30:58 +0000 (13:30 -0700)]
net/qede/base: use pointer for bytes length read

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agonet/qede/base: use trust mode for forced MAC limitations
Shahed Shaikh [Sat, 8 Sep 2018 20:30:57 +0000 (13:30 -0700)]
net/qede/base: use trust mode for forced MAC limitations

When trust mode is set to ON, VF can change it's MAC address
inspite PF has set a forced MAC for that VF from HV.

Earlier similar functionality is provided by module parameter
"allow_vf_mac_change_mode" of qed.

This change makes few changes in behavior of VF shadow config -
 - Let driver track the VF mac in shadow config as long as trust
  mode is OFF.
 - Once trust mode is ON, we should not care about MACs in shadow
  config (because we never intend to fall back because of lack of restore
  implementation).
 - Delete existing shadow MAC (this helps when trust mode is turned OFF,
  and VF tries to add new MAC – it won’t fail that time since we have
  a clean slate).
 - Skip addition and deletion of MACs in shadow configs.

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
5 years agonet/qede/base: fix logic for sfp get/set
Rasesh Mody [Sat, 8 Sep 2018 20:30:56 +0000 (13:30 -0700)]
net/qede/base: fix logic for sfp get/set

Fix logic for sfp get rx_los, tx_fault, tx_disable, and sfp set tx_disable.

Fixes: bdc40630a8eb ("net/qede/base: add APIs for xcvr")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agonet/qede/base: correct MCP error handler log verbosity
Rasesh Mody [Sat, 8 Sep 2018 20:30:55 +0000 (13:30 -0700)]
net/qede/base: correct MCP error handler log verbosity

Correct the verbosity for slowpath message from DCB to SP.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agonet/qede/base: limit number of non ethernet queues to 64
Rasesh Mody [Sat, 8 Sep 2018 20:30:54 +0000 (13:30 -0700)]
net/qede/base: limit number of non ethernet queues to 64

Limit the number of non ethernet queues to 64, allowing a max queues to
status block ratio of 2:1 in case of storage target. Theoretically a
non-target storage PF can have 128 queues and SBs.

This change is to support 64 entries for a target iSCSI/FCoE PF and 128
for a non-target.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agonet/qede: fix ethernet type in HW registers
Rasesh Mody [Sat, 8 Sep 2018 20:30:53 +0000 (13:30 -0700)]
net/qede: fix ethernet type in HW registers

Fix to program the HW registers with proper ether type.

Fixes: 36f45bce2537 ("net/qede/base: fix to support OVLAN mode")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agonet/qede/base: get pre-negotiated values for stag and bw
Rasesh Mody [Sat, 8 Sep 2018 20:30:52 +0000 (13:30 -0700)]
net/qede/base: get pre-negotiated values for stag and bw

Request management FW for STAG and bandwidth values negotiated prior to
the driver load.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agonet/qede/base: add OneView APIs
Rasesh Mody [Sat, 8 Sep 2018 20:30:51 +0000 (13:30 -0700)]
net/qede/base: add OneView APIs

Add support for the following OneView APIs:
 - ecore_mcp_ov_update_mtu() - Send MTU value to the management FW.
 - ecore_mcp_ov_update_mac() - Send MAC address to the management FW.
 - ecore_mcp_ov_update_eswitch() - Send eswitch_mode to management FW
   after the firmware load.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agonet/qede/base: fix to handle stag update event
Rasesh Mody [Sat, 8 Sep 2018 20:30:50 +0000 (13:30 -0700)]
net/qede/base: fix to handle stag update event

This fix adds a ecore_mcp_update_stag() handler to handle the STAG update
events from management FW and program the STAG value.
It also clears the stag config on PF, when management FW invalidates
the stag value.

Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agonet/nfp: fix mbuf flags with checksum good
Alejandro Lucero [Thu, 6 Sep 2018 16:02:56 +0000 (17:02 +0100)]
net/nfp: fix mbuf flags with checksum good

If checksum offload enabled and hardware reports checksum as good,
update mbuf ol_flags with proper *_CKSUM_GOOD bits.

Fixes: b812daadad0d ("nfp: add Rx and Tx")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/*/base: allow use of experimental APIs in base code
Bruce Richardson [Fri, 31 Aug 2018 13:35:10 +0000 (14:35 +0100)]
net/*/base: allow use of experimental APIs in base code

The driver setting of "allow_experimental_apis" was not being used when
building the base code. To allow this we can manually put in a check
in the base code files for the setting and set the appropriate cflag
if it's needed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Ilya Maximets <i.maximets@samsung.com>
5 years agonet/ifc: do not notify before HW ready
Xiao Wang [Fri, 14 Sep 2018 01:25:17 +0000 (09:25 +0800)]
net/ifc: do not notify before HW ready

If the device is not clearly reset by the previous driver and holds
some invalid ring addr, and the relay thread kicks it before HW is
properly re-configured, a bad DMA request may happen.

Besides, the notify_addr which is used by the relay thread is set in
the vdpa_ifcvf_start function, if a kick relay happens before
vdpa_ifcvf_start finishes, a null addr is accessed.

Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
5 years agonet/i40e: remove driver log
Beilei Xing [Tue, 18 Sep 2018 05:44:10 +0000 (13:44 +0800)]
net/i40e: remove driver log

Remove driver log when no interrupt event indicated
in alarm handler for both PF and VF, otherwise there
will be lots of prints which makes console unusable.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/i40e: add option to use latest vector path
Xiaoyun Li [Tue, 18 Sep 2018 02:22:40 +0000 (10:22 +0800)]
net/i40e: add option to use latest vector path

For IA, the AVX2 vector path is only recommended to be used on later
platforms (identified by AVX512 support, like SKL etc.) This is because
performance benchmark shows downgrade when running AVX2 vector path on
early platform (BDW/HSW) in some cases. But we still observe perf gain
with some real work loading.

So this patch introduced the new devarg use-latest-supported-vec to
force the driver always selecting the latest supported vec path. Then
apps are able to take AVX2 path on early platforms. And this logic can
be re-used if we will have AVX512 vec path in future.

This patch only affects IA platforms. The selected vec path would be
like the following:
  Without devarg/devarg = 0:
  Machine vPMD
  AVX512F AVX2
  AVX2 SSE4.2
  SSE4.2 SSE4.2
  <SSE4.2 Not Supported

  With devarg = 1
  Machine vPMD
  AVX512F AVX2
  AVX2 AVX2
  SSE4.2 SSE4.2
  <SSE4.2 Not Supported

Other platforms can also apply the same logic if necessary in future.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/mlx5: add bluefield VF support
Ori Kam [Sun, 2 Sep 2018 13:55:59 +0000 (13:55 +0000)]
net/mlx5: add bluefield VF support

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx4: support meson build
Nelio Laranjeiro [Fri, 31 Aug 2018 07:16:05 +0000 (09:16 +0200)]
net/mlx4: support meson build

Compile Mellanox driver when their external dependencies are met.  A
glue version of the driver can still be requested by using the
-Denable_driver_mlx_glue=true

Meson will try to find the required external libraries.  When they are
not installed system wide, they can be provided though CFLAGS, LDFLAGS
and LD_LIBRARY_PATH environment variables, example (considering
RDMA-Core is installed in /tmp/rdma-core):

 # CLFAGS=-I/tmp/rdma-core/build/include \
   LDFLAGS=-L/tmp/rdma-core/build/lib \
   LD_LIBRARY_PATH=/tmp/rdma-core/build/lib \
   meson output
 # LD_LIBRARY_PATH=/tmp/rdma-core/build/lib \
   ninja -C output install

Note: LD_LIBRARY_PATH before ninja is necessary when the meson
configuration has changed (e.g. meson configure has been called), in
such situation the LD_LIBRARY_PATH is necessary to invoke the
autoconfiguration script.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agonet/mlx5: support meson build
Nelio Laranjeiro [Fri, 31 Aug 2018 07:16:05 +0000 (09:16 +0200)]
net/mlx5: support meson build

Compile Mellanox driver when its external dependencies are met.  A
glue version of the driver can still be requested by using the
-Denable_driver_mlx_glue=true

Meson will try to find the required external libraries.  When they are
not installed system wide, they can be provided though CFLAGS, LDFLAGS
and LD_LIBRARY_PATH environment variables, example (considering
RDMA-Core is installed in /tmp/rdma-core):

 # CLFAGS=-I/tmp/rdma-core/build/include \
   LDFLAGS=-L/tmp/rdma-core/build/lib \
   LD_LIBRARY_PATH=/tmp/rdma-core/build/lib \
   meson output
 # LD_LIBRARY_PATH=/tmp/rdma-core/build/lib \
   ninja -C output install

Note: LD_LIBRARY_PATH before ninja is necessary when the meson
configuration has changed (e.g. meson configure has been called), in
such situation the LD_LIBRARY_PATH is necessary to invoke the
autoconfiguration script.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agonet/e1000: fix queue number in RSS configuration
Beilei Xing [Thu, 13 Sep 2018 07:06:23 +0000 (15:06 +0800)]
net/e1000: fix queue number in RSS configuration

RSS configuration works for all e1000 NICs except 82576.
This patch fixes this issue by correcting queue number
in RSS configuration.

Fixes: 424ae915baf0 ("net/e1000: move RSS to flow API")
Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
5 years agodrivers/crypto: remove double assignment of driver
Shreyansh Jain [Fri, 28 Sep 2018 12:26:04 +0000 (17:56 +0530)]
drivers/crypto: remove double assignment of driver

Removing double copy of driver information. 04664e5c8346 has shifted
that from driver's probe to bus's probe.

Fixes: 04664e5c8346 ("drivers/bus: fill driver reference after NXP probing")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodrivers/net: remove double assignment of driver
Shreyansh Jain [Fri, 28 Sep 2018 12:26:03 +0000 (17:56 +0530)]
drivers/net: remove double assignment of driver

Removing double copy of driver information. 04664e5c8346 has shifted
that from driver's probe to bus's probe.

Fixes: 04664e5c8346 ("drivers/bus: fill driver reference after NXP probing")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodrivers/bus: fill driver reference after NXP probing
Thomas Monjalon [Mon, 24 Sep 2018 23:55:28 +0000 (01:55 +0200)]
drivers/bus: fill driver reference after NXP probing

The probing functions of NXP buses were missing to set
the driver used for successfully probing a device.

The NXP driver and the generic rte_driver are now set
in the device structures.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>