Commit Graph

6950 Commits

Author SHA1 Message Date
Akhil Goyal
b0894102cb crypto/dpaa: reset session before init
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2018-09-26 13:20:26 +02:00
Hemant Agrawal
3373a36ba7 crypto/dpaa: update the flib RTA
hw flib code is updated as per the latest set of APIs and macros

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2018-09-26 13:18:38 +02:00
Pablo de Lara
ceb8639387 crypto/aesni_gcm: support all truncated digest sizes
The full digest size of GCM/GMAC algorithms is 16 bytes.
However, it is sometimes truncated to a smaller size (such as in IPSec).
This commit allows a user to generate a digest of any size
up to the full size.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
2018-09-26 12:43:57 +02:00
Pablo de Lara
c7c29f1058 crypto/aesni_gcm: remove unneeded J0 calculation
When IV size is 12, padding to 16 bytes is required
and the LSB must be set to 1, according to the spec.
However, the Multi-buffer library is already doing this,
so it is not necessary to do it in the PMD.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
2018-09-26 12:43:57 +02:00
Pablo de Lara
d0fe8c48a4 crypto/aesni_mb: support large HMAC key sizes
Add support for SHAx-HMAC key sizes larger than the block size.
For these sizes, the input key is digested with the non-HMAC
version of the algorithm and used as the key.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
2018-09-26 12:45:13 +02:00
Pablo de Lara
035ecca5ea crypto/aesni_mb: support all truncated CMAC digest sizes
The full digest size of CMAC algorithm is 16 bytes.
However, it is sometimes truncated to a smaller size (such as in IPSec).
This commit allows a user to generate a digest of any size
up to the full size.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
2018-09-26 12:45:05 +02:00
Pablo de Lara
16a3558e0b crypto/aesni_mb: fix truncated digest size for CMAC
The truncated digest size for AES-CMAC is 12 and not 16,
as the Multi-buffer library can output both 12 and 16 bytes.

Fixes: 6491dbbece ("crypto/aesni_mb: support AES CMAC")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
2018-09-26 12:44:57 +02:00
Pablo de Lara
c4c0c312a8 crypto/aesni_mb: check for invalid digest size
When creating a crypto session, check if
ther requested digest size is supported for
AES-XCBC-MAC and AES-CCM.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
2018-09-26 12:44:51 +02:00
Pablo de Lara
763c24917d crypto/aesni_mb: support all truncated HMAC digest sizes
HMAC algorithms (MD5 and SHAx) have different full digest sizes.
However, they are often truncated to a smaller size (such as in IPSec).
This commit allows a user to generate a digest of any size
up to the full size.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
2018-09-26 12:43:57 +02:00
Pablo de Lara
95978a85a4 crypto/aesni_mb: fix possible array overrun
In order to process crypto operations in the AESNI MB PMD,
they need to be sent to the buffer manager of the Multi-buffer library,
through the "job" structure.

Currently, it is checked if there are outstanding operations to process
in the ring, before getting a new job. However, if there are no available
jobs in the manager, a flush operation needs to take place, freeing some
of the jobs, so it can be used for the outstanding operation.

In order to avoid leaving the dequeued operation without being processed,
the maximum number of operations that can be flushed is the remaining
operations to return, which is the maximum number of operations that can
be return minus the number of operations ready to be returned
(nb_ops - processed_jobs), minus 1 (for the new operation).

The problem comes when (nb_ops - processed_jobs) is 1 (last operation to
dequeue). In that case, flush_mb_mgr is called with maximum number of
operations equal to 0, which is wrong, causing a potential overrun in the
"ops" array.
Besides, the operation dequeued from the ring will be leaked, as no more
operations can be returned.

The solution is to first check if there are jobs available in the manager.
If there are not, flush operation gets called, and if enough operations
are returned from the manager, then no more outstanding operations get
dequeued from the ring, avoiding both the memory leak and the array
overrun.
If there are enough jobs, PMD tries to dequeue an operation from the ring.
If there are no operations in the ring, the new job pointer is not used,
and it will be used in the next get_next_job call, so no memory leak
happens.

Fixes: 0f548b50a1 ("crypto/aesni_mb: process crypto op on dequeue")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2018-09-25 17:57:25 +02:00
Radu Nicolau
7486331308 net/bonding: stop and deactivate slaves on stop
When a bonding port is stopped also stop and deactivate all slaves.
Otherwise slaves will be still listed as active.

Fixes: 2efb58cbab ("bond: new link bonding library")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2018-09-28 13:59:05 +02:00
Damjan Marion
3c4c76cf17 net/i40e: fix 25G AOC and ACC cable detection on XXV710
Fixes: 75d133dd32 ("net/i40e: enable 25G device")
Cc: stable@dpdk.org

Signed-off-by: Damjan Marion <damarion@cisco.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-09-28 01:41:03 +02:00
Beilei Xing
fa6475b606 net/i40e: remove keeping CRC configuration for VF
Remove keeping CRC configuration since it's not
supported by i40e VF.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-09-28 01:41:03 +02:00
Tiwei Bie
66908eff12 net/virtio: add missing supported features
The virtio features VIRTIO_NET_F_CSUM, VIRTIO_NET_F_HOST_TSO4
and VIRTIO_NET_F_HOST_TSO6 are supported by the virtio PMD.
But they are missing in the supported feature set. And since
below commit:

commit 4174a7b59d ("net/virtio: improve Tx offload features negotiation")

Virtio PMD will announce the Tx offloading capabilities based
on the features read from the device. And virtio-user won't
report the features which are not in virtio-PMD's supported
feature set. So since that commit, virtio-user won't announce
the DEV_TX_OFFLOAD_UDP_CKSUM, DEV_TX_OFFLOAD_TCP_CKSUM and
DEV_TX_OFFLOAD_TCP_TSO offloading capabilities even if the
vhost backend supports them.

This patch adds these missing features, and virtio-user will
report them if the backend supports them.

Fixes: 142678d429 ("net/virtio-user: fix wrongly get/set features")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-09-28 01:41:03 +02:00
Tiwei Bie
21b90f790a net/virtio-user: fix multiple queue for vhost-kernel
The multiple queue support in vhost-kernel is broken because
the dev->vhostfd is only available for vhost-user. We should
always try to enable queue pairs when it's not in server mode.

Fixes: 201a416517 ("net/virtio-user: fix multiple queues fail in server mode")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-09-28 01:41:03 +02:00
Beilei Xing
98ff88b3c4 net/avf: remove keeping CRC configuration
Remove keeping CRC configuration as it's not supported by AVF.

Fixes: 5ce4c2be1a ("net/avf: fix offload capabilities")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-09-28 01:41:03 +02:00
Zyta Szpak
9e79d81091 net/mvpp2: support Tx scatter/gather
The patch introduces scatter/gather support on transmit path.
A separate Tx callback is added and set if the application
requests multisegment Tx offload. Multiple descriptors are
sent per one packet.

Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Yelena Krivosheev <yelena@marvell.com>
2018-09-28 01:41:03 +02:00
Tomasz Duszynski
e04ec42af0 net/mvpp2: align with MUSDK 18.09
This patch introduces necessary changes required by MUSDK 18.09 library.

* As of MUSDK 18.09, pp2_cookie_t is no longer available. Now
  RX descriptor cookie is defined as plain u64 so existing cast
  is no longer valid.

* MUSDK 18.09 increased number of available bpools (buffer hw pools) by
  introducing dma regions support. Update mvpp2 driver accordingly.

* replace MV_NET_IP4_F_TOS with MV_NET_IP4_F_DSCP

  Before this patch, API allowed to configure a classification rule
  according to IPv4 TOS, which was not supported in classifier. This patch
  fixes this by using proper field.

* use 48 bit address mask

  We cannot get pointers exceeding 48 bits thus using 48 bit
  mask for extracting higher IOVA address bits is enough.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Signed-off-by: Yuval Caduri <cyuval@marvell.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Reviewed-by: Shlomi Gridish <sgridish@marvell.com>
Reviewed-by: Alan Winkowski <walan@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2018-09-28 01:41:03 +02:00
Natalie Samsonov
79ec62028b net/mvpp2: update MTU and MRU related calculations
This commit updates MTU and MRU related calculations.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Yelena Krivosheev <yelena@marvell.com>
Reviewed-by: Dmitri Epshtein <dima@marvell.com>
2018-09-28 01:41:03 +02:00
Yuval Caduri
406aeb1524 net/mvpp2: detach Tx QoS from Rx cls/QoS config
Functional change:
Open receive cls/qos related features, only if the
config file contains an rx_related configuration entry.
This allows to configure tx_related entries, w/o unintentionally
opening rx cls/qos.

Code:
'use_global_defaults' is by default set to '1'.
Only if an rx_related entry was configured, it is updated to '0'.
rx cls/qos is performed only if 'use_global_defaults' is '0'.
Default TC configuration is now only mandatory when
'use_global_defaults' is '0'.

Signed-off-by: Yuval Caduri <cyuval@marvell.com>
Reviewed-by: Natalie Samsonov <nsamsono@marvell.com>
Tested-by: Natalie Samsonov <nsamsono@marvell.com>
2018-09-28 01:41:03 +02:00
Tomasz Duszynski
429c394417 net/mvpp2: support traffic manager
Add traffic manager support.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2018-09-28 01:41:03 +02:00
Tomasz Duszynski
a1f83becf9 net/mvpp2: add init and deinit to flow
Add init and deinit functionality to flow implementation.

Init puts structures used by flow in a sane sate.
Deinit deallocates all resources used by flow.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Shlomi Gridish <sgridish@marvell.com>
2018-09-28 01:41:03 +02:00
Tomasz Duszynski
e97d88740a net/mvpp2: change default policer configuration
Change QoS configuration file syntax for port's default policer
setup.

Since default policer configuration is performed before
any other policer configuration we can pick a default id.

This simplifies default policer configuration since user
no longer has to choose ids from range [0, PP2_CLS_PLCR_NUM].

Explicitly document values for rate_limit_enable field.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2018-09-28 01:41:03 +02:00
Tomasz Duszynski
cdb53f8da6 net/mvpp2: support metering
Add support for configuring plcr via DPDK generic metering API.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2018-09-28 01:41:03 +02:00
Tomasz Duszynski
fad0cfe030 net/mvpp2: move common code
Cleanup sources by moving common code to the pmd
header file.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2018-09-28 01:41:03 +02:00
Natalie Samsonov
5997b0a827 net/mvpp2: initialize ppio only once
This changes stop/start/configure behavior due to issue in MUSDK
library itself.  From now on, ppio can be reconfigured only after interface
is closed.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Yuval Caduri <cyuval@marvell.com>
2018-09-28 01:41:03 +02:00
Ivan Malov
7a0665940f net/bonding: inherit descriptor limits from slaves
Descriptor limits are used by applications to take
optimal decisions on queue sizing.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Chas Williams <chas3@att.com>
2018-09-28 01:41:03 +02:00
Ivan Malov
f5f93e106e net/bonding: provide default Rx/Tx configuration
Default Rx/Tx configuration has become a helpful
resource for applications relying on the optimal
values to make rte_eth_rxconf and rte_eth_txconf
structures. These structures can then be tweaked.

Default configuration is also used internally by
rte_eth_rx_queue_setup or rte_eth_tx_queue_setup
API calls when NULL pointer is passed by callers
with the argument for custom queue configuration.

The use cases of bonding driver may also benefit
from exercising default settings in the same way.

Restructure the code to collect various settings
from slave ports and make it possible to combine
default Rx/Tx configuration of these devices and
report it to the callers of rte_eth_dev_info_get.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Chas Williams <chas3@att.com>
2018-09-28 01:41:03 +02:00
Rahul Lakkireddy
0f3ff2445d net/cxgbe: announce Rx scatter offload
Scatter Rx is already supported by CXGBE PMD. So, add the missing
DEV_RX_OFFLOAD_SCATTER flag to the list of supported Rx offload
features.

Also, move the macros for supported list of offload features to
header file.

Fixes: 436125e641 ("net/cxgbe: update to Rx/Tx offload API")
Cc: stable@dpdk.org

Reported-by: Martin Weiser <martin.weiser@allegro-packets.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
c4084fb3d0 net/sfc/base: use transceiver ID when reading info
In efx_mcdi_phy_module_get_info() probe the
transceiver identification byte rather than assume
the module matches the fixed port type.  This
supports scenarios such as a SFP mounted in a QSFP
port via a QSA module.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
f8683231c9 net/sfc/base: add accessor to whole link status
Add a function which makes an MCDI GET_LINK request and
packages up the results. Currently, the get-link function
is triggered from several entry points which then pass
on or store selected parts of the data. When the driver
needs to obtain the current link state, it is more
efficient to do this in a single call.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Tom Millington
161c9ab395 net/sfc/base: guard Rx scale code with corresponding option
Previously only some of the code was guarded by this which caused
a build error when EFSYS_OPT_RX_SCALE is 0 (e.g. in manftest).

Signed-off-by: Tom Millington <tmillington@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
0c9c1d9ec9 net/sfc/base: infer port mode bandwidth from max link speed
Limit the port mode bandwidth calculations by the maximum
reported link speed. This system detects 25G vs 10G cards,
and 100G port modes vs 40G.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
ac664071e7 net/sfc/base: support improvements to bandwidth calculations
Change the interface to ef10_nic_get_port_mode_bandwidth()
so more NIC information can be used to infer bandwidth
requirements. Huntington calculations separated out
completely.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
cd7dc6c812 net/sfc/base: add X2 port modes to bandwidth calculator
Add cases for the new port modes supported by X2 NICs.
Lane bandwidth is calculated for pre-X2 cards so is an
underestimate for X2 in 25G/100G modes.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
a77a72cdd7 net/sfc/base: update to current port mode terminology
>From Medford onwards, the newer constants enumerating
port modes should be used.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
dad744f763 net/sfc/base: adjust PHY module info interface
Adjust data types in interface to permit the complete
module information buffer to be obtained in a single
call.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
c0516b777e net/sfc/base: expose PHY module device address constants
Rearrange so the valid addresses are visible to the caller.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Richard Houldsworth
7624c9442d net/sfc/base: make last byte of module information available
Adjust bounds so the interface supports reading
the last available byte of data.

Fixes: 19b64c6ac3 ("net/sfc/base: import libefx base")
Cc: stable@dpdk.org

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Evgeny Im
901efc0da9 net/failsafe: support multicast address list set
Signed-off-by: Evgeny Im <evgeny.im@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
ec4569c1f9 mempool/dpaa: change debug log level to DP
When the system goes out of buffers temporarily, the logs
further slow down the system. There is no need for this
continuos logs.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
539c80ca06 bus/dpaa: add check for re-definition in compat
Few fields in compat are giving re-defination error
with new drivers such as caam_jr.
Checks have been added.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
1ee09e39b5 net/dpaa: tune prefetch in Rx path
As part of performance optimization excercise, tuning
the prefetch placement.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
19b4aba204 net/dpaa: separate Rx function for LS1046
This is to avoid the checks in datapath and help in performance.
LS1046 has different data stash settings.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Sunil Kumar Kori
9afce5aa86 net/dpaa: rearrange atomic queue support
This is to align the code with dpaa2 to ease out maintenance
of both driver code bases.

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
2018-09-28 01:41:02 +02:00
Nipun Gupta
fa362cea28 bus/dpaa: avoid big endian conversions for contextb
minor optimization in packet handling path

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-09-28 01:41:02 +02:00
Nipun Gupta
b6ee63a763 bus/dpaa: avoid tag set for eqcr in Tx path
Minor optimization for TX path.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
8e253882cd bus/dpaa: support interrupt portal based fd
This patch add supports in bus driver for qbman to support
and configure portal based FDs, which can be used for interrupt
based processing.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
079a67c251 net/dpaa: minor debug log enhancements
Improving the debug message for event mode and
reducing the log level for less important log

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Sachin Saxena
c1752a36b0 net/dpaa: fix link speed based on MAC type
The link speed shall be on the basis of mac type.

Fixes: 799db4568c ("net/dpaa: support device info and speed capability")
Cc: shreyansh.jain@nxp.com
Cc: stable@dpdk.org

Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
55576ac26e net/dpaa: support scatter offload
This patch implement the sg support, which can be
enabled/disabled w.r.t configuration.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
deeec8ef57 net/dpaa: fix jumbo buffer config
Set the missing dev data mtu for the correct size.
Set the max supported size in hw, if user is asking for more.

Fixes: 9658ac3a4e ("net/dpaa: set the correct frame size in device MTU")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Hemant Agrawal
f04e713924 net/dpaa: configure frame queue on MAC ID basis
The current code has the hardcoded seq for fq allocation.
It require multiple changes, when some of the interfaces
are assigned to kernel stack. Changing it on the mac
id basis provide the flexibility to assign any interface
to kernel.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-09-28 01:41:02 +02:00
Chas Williams
e1110e9776 net/bonding: fix Rx slave fairness
Some PMDs, especially ones with vector receives, require a minimum number
of receive buffers in order to receive any packets.  If the first slave
read leaves less than this number available, a read from the next slave
may return 0 implying that the slave doesn't have any packets which
results in skipping over that slave as the next active slave.

To fix this, implement round robin for the slaves during receive that
is only advanced to the next slave at the end of each receive burst.
This is also done to provide some additional fairness in processing in
other bonding RX burst routines as well.

Fixes: 2efb58cbab ("bond: new link bonding library")
Cc: stable@dpdk.org

Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Matan Azrad <matan@mellanox.com>
2018-09-28 01:41:02 +02:00
Luca Boccassi
bfabd06000 net/avf: support meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-28 01:41:02 +02:00
Bruce Richardson
bfd38e4d70 net/avf: fix missing compiler error flags
The AVF driver was missing $(WERROR_FLAGS) in it's cflags, which means
that a number of compilation errors were getting missed. This patch adds
in the flag and fixes most of the errors, just disabling the
strict-aliasing ones.

Fixes: 22b123a36d ("net/avf: initialize PMD")
Fixes: 69dd4c3d08 ("net/avf: enable queue and device")
Fixes: a2b29a7733 ("net/avf: enable basic Rx Tx")
Fixes: 319c421f38 ("net/avf: enable SSE Rx Tx")

CC: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-09-28 01:41:02 +02:00
Bruce Richardson
584798f8e8 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: 69dd4c3d08 ("net/avf: enable queue and device")
Fixes: 3fd7a3719c ("net/avf: enable ops for MTU setting")
Fixes: d6bde6b5ea ("net/avf: enable Rx interrupt")
Fixes: 22b123a36d ("net/avf: initialize PMD")
Fixes: 319c421f38 ("net/avf: enable SSE Rx Tx")
Fixes: a2b29a7733 ("net/avf: enable basic Rx Tx")
Fixes: 1060591ead ("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>
2018-09-28 01:41:02 +02:00
Gaetan Rivet
be665ba55e 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>
2018-09-28 01:41:02 +02:00
Julien Meunier
2750b60fd6 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>
2018-09-28 01:41:02 +02:00
Didier Pallard
e8c220aa97 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: cf80ba6e20 ("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>
2018-09-28 01:41:02 +02:00
Didier Pallard
c8dc2d66c5 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: e0cb96204b ("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>
2018-09-28 01:41:02 +02:00
Didier Pallard
310e479b5f 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: 30f3ce999e ("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>
2018-09-28 01:41:02 +02:00
Didier Pallard
a6607ae14c 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: e5c05e6590 ("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>
2018-09-28 01:41:02 +02:00
Beilei Xing
dc6a4514fb 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>
2018-09-28 01:41:02 +02:00
Igor Romanov
5d138ef92d 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: b1b7ad933b ("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>
2018-09-28 01:41:02 +02:00
Igor Romanov
7eb7588c99 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: ce35b05c63 ("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>
2018-09-28 01:41:02 +02:00
Vijay Srivastava
e3ea742e85 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>
2018-09-28 01:41:02 +02:00
Andy Moreton
42f235911a 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: 8c7c723dfe ("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>
2018-09-28 01:41:02 +02:00
Richard Houldsworth
95ea95ec41 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>
2018-09-28 01:41:02 +02:00
Ivan Malov
bb53d84843 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>
2018-09-28 01:41:02 +02:00
Ivan Malov
86dbbc5dbb 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>
2018-09-28 01:41:02 +02:00
Ivan Malov
c4ea98c42d 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>
2018-09-28 01:41:02 +02:00
Ivan Malov
b65eb10c4d 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>
2018-09-28 01:41:02 +02:00
Vijay Srivastava
7ec0fca2c0 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>
2018-09-28 01:41:02 +02:00
Ivan Malov
9673e044a1 net/sfc/base: fix a typo in unicast filter insertion comment
Fixes: e7cd430c86 ("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>
2018-09-28 01:41:02 +02:00
Ivan Malov
e7feaba71c 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: 613cbe75ae ("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>
2018-09-28 01:41:02 +02:00
Mark Spender
f78fb0a8e1 net/sfc/base: prevent access to the NIC config before probe
NIC config is initialized during NIC probe.

Fixes: 19b64c6ac3 ("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>
2018-09-28 01:41:02 +02:00
Andy Moreton
416aa7f1c9 net/sfc/base: fix ID retrieval in v3 licensing
Fixes: 05fce2ce84 ("net/sfc/base: import libefx licensing")
Fixes: f67e471914 ("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>
2018-09-28 01:41:02 +02:00
Andy Moreton
efb15738c7 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>
2018-09-28 01:41:02 +02:00
Andy Moreton
2cfbf25105 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>
2018-09-28 01:41:02 +02:00
Gautam Dawar
ed42d18458 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: 6f619653b9 ("net/sfc/base: import MCDI implementation")
Fixes: f7dc06bf35 ("net/sfc/base: import 5xxx/6xxx family support")
Fixes: e7cd430c86 ("net/sfc/base: import SFN7xxx family support")
Fixes: 1dae25112a ("net/sfc/base: import built-in selftest")
Fixes: 0a78643491 ("net/sfc/base: import PHY statistics")
Fixes: 8c7c723dfe ("net/sfc/base: import MAC statistics")
Fixes: 5935cd8c47 ("net/sfc/base: import RSS support")
Fixes: 9ee64bd404 ("net/sfc/base: import loopback control")
Fixes: dfb3b1ce15 ("net/sfc/base: import monitors access via MCDI")
Fixes: d96a34d165 ("net/sfc/base: import NVRAM support")
Fixes: 05fce2ce84 ("net/sfc/base: import libefx licensing")
Fixes: ba6afee9a8 ("net/sfc/base: add advanced function to extract FW version")
Fixes: c7815c1d1f ("net/sfc/base: use proper MCDI command for encap filters")
Fixes: 17551f6dff ("net/sfc/base: add API to control UDP tunnel ports")
Fixes: eff9b666ea ("net/sfc/base: move RxDP config get to EF10 NIC code")
Fixes: 4aab7f07a6 ("net/sfc/base: refactor EF10 get datapath capabilities")
Fixes: 480a13044b ("net/sfc/base: support FW subvariant choice")
Fixes: 6f60cc4a78 ("net/sfc/base: support equal stride super-buffer Rx mode")
Fixes: 9a733758c0 ("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>
2018-09-28 01:41:02 +02:00
Mark Spender
b2fe569359 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>
2018-09-28 01:41:02 +02:00
Martin Harvey
da8692388e net/sfc/base: avoid usage of too big arrays on stack
Found by PreFAST static analysis.

Fixes: 1dae25112a ("net/sfc/base: import built-in selftest")
Fixes: d96a34d165 ("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>
2018-09-28 01:41:02 +02:00
Richard Houldsworth
bb5c3b1691 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>
2018-09-28 01:41:02 +02:00
Richard Houldsworth
7e63a9a1a5 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>
2018-09-28 01:41:02 +02:00
Richard Houldsworth
45cc346bc9 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>
2018-09-28 01:41:02 +02:00
Martin Harvey
dded2ffdf9 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>
2018-09-28 01:41:02 +02:00
Martin Harvey
252faf84f4 net/sfc/base: check size of memory to read sensors data to
Size of provided memory should be consistent with specified size.

Fixes: dfb3b1ce15 ("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>
2018-09-28 01:41:02 +02:00
Martin Harvey
0c52235b43 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>
2018-09-28 01:41:02 +02:00
Mark Spender
05039b815c 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>
2018-09-28 01:41:02 +02:00
Martin Harvey
aa0bac03e9 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>
2018-09-28 01:41:02 +02:00
Vijay Srivastava
f933b46a0a net/sfc/base: add check for TUNNEL module in NIC reset API
Fixes: 17551f6dff ("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>
2018-09-28 01:41:02 +02:00
Martin Harvey
aa9f2e6bc9 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>
2018-09-28 01:41:02 +02:00
Vijay Srivastava
b5f238171d net/sfc/base: fix outer IPID field in TSO option descriptors
Fixes: 912e603706 ("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>
2018-09-28 01:41:02 +02:00
Paul Fox
a5ecbaa7c9 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>
2018-09-28 01:41:02 +02:00
Andrew Rybchenko
5d23ac47e9 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: dfb3b1ce15 ("net/sfc/base: import monitors access via MCDI")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Andy Moreton
f64f2a47f0 net/sfc/base: add space after sizeof
Required by GLD cstyle.

Fixes: d4f4b8f9d2 ("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>
2018-09-28 01:41:02 +02:00
Andy Moreton
9d42b13e8c net/sfc/base: properly align on line continuation
Fixes: 19b64c6ac3 ("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>
2018-09-28 01:41:02 +02:00
Martin Harvey
d0e22de5bd net/sfc/base: fix SAL annotation for input buffers
Fixes: d96a34d165 ("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>
2018-09-28 01:41:02 +02:00
Andrew Jackson
58b1393e75 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>
2018-09-28 01:41:02 +02:00
Martin Harvey
a8fb089398 net/sfc/base: fix output buffer SAL annotation
Found by PreFAST warnings.

Fixes: 3f2f0189dd ("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>
2018-09-28 01:41:02 +02:00
Martin Harvey
b1c25748dd net/sfc/base: fix invalid order of memset arguments
Found by PreFAST.

Fixes: 3f2f0189dd ("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>
2018-09-28 01:41:02 +02:00
Martin Harvey
f394c63d2d net/sfc/base: fix PreFAST warnings because of unused return
Fixes: 19b64c6ac3 ("net/sfc/base: import libefx base")
Fixes: d96a34d165 ("net/sfc/base: import NVRAM support")
Fixes: e7cd430c86 ("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>
2018-09-28 01:41:02 +02:00
Yogev Chaimovich
30f77abecd 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>
2018-09-28 01:41:02 +02:00
Cian Ferriter
48329b0403 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>
2018-09-28 01:41:02 +02:00
Ian Dolzhansky
99aa3e0fca net/failsafe: support runtime Tx queues setup
Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Ian Dolzhansky
c942a18292 net/failsafe: support runtime Rx queues setup
Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Ian Dolzhansky
b32c9075ee 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>
2018-09-28 01:41:02 +02:00
Ian Dolzhansky
3db7001e51 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>
2018-09-28 01:41:02 +02:00
Ian Dolzhansky
c3a210a264 net/failsafe: add checks for deferred queue setup
Fixes: a46f8d584e ("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>
2018-09-28 01:41:02 +02:00
Igor Romanov
6b35f4d88b 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: a46f8d584e ("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>
2018-09-28 01:41:02 +02:00
Xiao Wang
d7fe5a2861 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>
2018-09-28 01:41:02 +02:00
Xiaoyun Li
c399cc9ba0 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>
2018-09-28 01:41:02 +02:00
Xiaoyun Li
8e2030bea0 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>
2018-09-28 01:41:02 +02:00
Xiaoyun Li
36a036bc6f 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>
2018-09-28 01:41:02 +02:00
Xiaoyun Li
175bedb0cc 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>
2018-09-28 01:41:02 +02:00
Xiaoyun Li
1b665ccd9c 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>
2018-09-28 01:41:02 +02:00
Xiaoyun Li
5fb0a9acbb 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>
2018-09-28 01:41:02 +02:00
Xiaoyun Li
043be1f6f4 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>
2018-09-28 01:41:02 +02:00
Xiaoyun Li
9db3087f4f 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>
2018-09-28 01:41:01 +02:00
Tiwei Bie
7572865425 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: 12ecb2f63b ("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>
2018-09-28 01:41:01 +02:00
Tiwei Bie
534bccbad1 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>
2018-09-28 01:41:01 +02:00
Tiwei Bie
7ff269575b 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: 12ecb2f63b ("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>
2018-09-28 01:41:01 +02:00
Shahed Shaikh
ad4d092be7 net/qede: support device reset
Implement eth_dev_ops->dev_reset callback.

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
2018-09-28 01:41:01 +02:00
Shahed Shaikh
797ce8eec7 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: 9e2f08a4ad ("net/qede/base: add request for PF FLR before load request")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
2018-09-28 01:41:01 +02:00
Shahed Shaikh
3f373e1a0a 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>
2018-09-28 01:41:01 +02:00
Shahed Shaikh
318d7da312 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: f6033f2497 ("net/qede: fix minimum buffer size and scatter Rx check")
CC: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
2018-09-28 01:41:01 +02:00
Shahed Shaikh
267d32de46 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>
2018-09-28 01:41:01 +02:00
Shahed Shaikh
f5765f66f9 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>
2018-09-28 01:41:01 +02:00
Shahed Shaikh
7ffef6292b 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: 622075356e ("net/qede: support ntuple and flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
2018-09-28 01:41:01 +02:00
Shahed Shaikh
eb54ba75c7 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>
2018-09-28 01:41:01 +02:00
Rasesh Mody
979582a1aa net/qede/base: use pointer for bytes length read
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-09-28 01:41:01 +02:00
Shahed Shaikh
2cf7a0faf4 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>
2018-09-28 01:41:01 +02:00
Rasesh Mody
6d1be6d6f8 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: bdc40630a8 ("net/qede/base: add APIs for xcvr")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-09-28 01:41:01 +02:00
Rasesh Mody
657b762a87 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>
2018-09-28 01:41:01 +02:00
Rasesh Mody
3f11cf0623 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>
2018-09-28 01:41:01 +02:00
Rasesh Mody
d5df6159dd net/qede: fix ethernet type in HW registers
Fix to program the HW registers with proper ether type.

Fixes: 36f45bce25 ("net/qede/base: fix to support OVLAN mode")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-09-28 01:41:01 +02:00
Rasesh Mody
4fe58a3ecf 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>
2018-09-28 01:41:01 +02:00
Rasesh Mody
ebbc55b871 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>
2018-09-28 01:41:01 +02:00
Rasesh Mody
cb71992793 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: ec94dbc573 ("qede: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-09-28 01:41:01 +02:00
Alejandro Lucero
0962b51d3c 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: b812daadad ("nfp: add Rx and Tx")
Cc: stable@dpdk.org

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-09-28 01:41:01 +02:00
Bruce Richardson
589dd86aaf 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>
2018-09-28 01:41:01 +02:00
Xiao Wang
971c19c77c 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: a3f8150eac ("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>
2018-09-28 01:41:01 +02:00
Beilei Xing
55c7fbe42d 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>
2018-09-28 01:41:01 +02:00
Xiaoyun Li
c11f654042 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>
2018-09-28 01:41:01 +02:00
Ori Kam
c322c0e558 net/mlx5: add bluefield VF support
Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-09-28 01:41:01 +02:00
Nelio Laranjeiro
1dd7c7e38c 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>
2018-09-28 01:41:01 +02:00
Nelio Laranjeiro
96d7c62a70 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>
2018-09-28 01:41:01 +02:00
Beilei Xing
2b39bf0f75 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: 424ae915ba ("net/e1000: move RSS to flow API")
Fixes: ac8d22de23 ("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>
2018-09-28 01:41:01 +02:00
Shreyansh Jain
eb5a9a7639 drivers/crypto: remove double assignment of driver
Removing double copy of driver information. 04664e5c83 has shifted
that from driver's probe to bus's probe.

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

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-09-28 18:02:58 +02:00
Shreyansh Jain
5fb08dd326 drivers/net: remove double assignment of driver
Removing double copy of driver information. 04664e5c83 has shifted
that from driver's probe to bus's probe.

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

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-09-28 18:02:49 +02:00
Thomas Monjalon
04664e5c83 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>
2018-09-27 14:43:47 +02:00
Thomas Monjalon
2ed055c5e3 bus/ifpga: remove useless driver cast
The rte_afu_driver is assigned to rte_afu_device.driver during probing.
There is no need of accessing the rte_afu_driver via rte_device.driver
and type casting to its container.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Rosen Xu <rosen.xu@intel.com>
2018-09-27 14:43:47 +02:00
Luca Boccassi
7abb521d2c event/opdl: add in meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:53:35 +02:00
Luca Boccassi
76ca29a7d6 event/opdl: rename map file to match library name
So that it can be used from Meson as well

Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:53:35 +02:00
Luca Boccassi
8fabc16808 baseband/null: add in meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:53:35 +02:00
Luca Boccassi
cd2b6458a1 crypto/scheduler: add in meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:53:35 +02:00
Luca Boccassi
263b9ba2d3 net/vmxnet3: add in meson build
Note that the library built by meson will not have the _uio suffix:
librte_pmd_vmxnet3.so - as it follows the directory name, while the
legacy makefile rename it to librte_pmd_vmxnet3_uio.so.

Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:53:35 +02:00
Luca Boccassi
30d3d01683 net/qede: add in meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Shahed Shaikh <shahed.shaikh@cavium.com>
2018-09-18 22:53:35 +02:00
Luca Boccassi
9fc43dbfd6 net/vdev_netvsc: add in meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:49:39 +02:00
Luca Boccassi
095cae3668 net/tap: add in meson build
Use same autoconf generation mechanism as the MLX4/5 PMDs

Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:48:49 +02:00
Bruce Richardson
77a5e7cdb2 build: fix compatibility with meson 0.41 onwards
Versions of meson prior to 0.47 flattened the parameters to the
"set_variable" function, which meant that the function could not take
array variables as a parameter. Therefore, we need to disable driver
tracking for those older versions, in order to maintain compatibility
with the minimum supported 0.41 version, and also v0.45 shipped in
Ubuntu 18.04 release.

Fixes: 806c45dd48 ("build: add configuration summary at end of config")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Timothy Redaelli <tredaelli@redhat.com>
2018-09-18 15:18:52 +02:00
Bruce Richardson
806c45dd48 build: add configuration summary at end of config
After running meson to configure a DPDK build, it can be useful to know
what was automatically enabled or disabled. Therefore, print out by way of
summary a categorised list of libraries and drivers to be built.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-17 13:58:40 +02:00
Luca Boccassi
60bd13a296 net/i40e: use -Wno-error=format-security for meson
This PMD is built with -Wno-format, which means GCC errors out if
-Wformat-security is used.

Fixes: e940646b20 ("drivers/net: build Intel NIC PMDs with meson")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-17 12:18:13 +02:00
Luca Boccassi
fd5a5cf7a9 raw/ifpga: use -Wno-error=format-security for meson
This PMD is built with -Wno-format, which means GCC errors out if
-Wformat-security is used.

Fixes: 56bb54ea1b ("raw/ifpga/base: add Intel FPGA OPAE share code")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-17 12:17:24 +02:00
Ashish Gupta
0b5284ad57 crypto/openssl: replace macros by static inline functions
Replace macros by static inline functions in openssl version
compatibility layer

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2018-08-30 05:10:50 +02:00
Fiona Trahe
df8cca4633 compress/qat: use compression specific driver name
The QAT compression driver was named "qat".
Rename to compress_qat for consistency with other compressdev drivers
and with crypto_qat.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
2018-08-30 05:10:50 +02:00
Fiona Trahe
6a3e44717d crypto/qat: fix typo
Fixes: f9a3d7f68f ("crypto/qat: move code into appropriate files")

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
2018-08-30 05:10:50 +02:00
Ferruh Yigit
58c3b60969 net/i40e: remove invalid comment
Comments says "no csum error report support" but there is no check
related csum offloads. Removing the comment.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-09-14 20:19:57 +02:00
Stephen Hemminger
dc7680e859 net/netvsc: support integrated VF
Integrate accelerated networking support into netvsc PMD.
This allows netvsc to manage VF without using failsafe or vdev_netvsc.
For the exception vswitch path some tests like transmit
get a 22% increase in packets/sec.
For the VF path, the code is slightly shorter but has no
real change in performance.

Pro:
   * using netvsc is more like other DPDK NIC's
   * the exception packet uses less CPU
   * much smaller code size
   * no locking required on VF transmit/receive path
   * no legacy Linux network device to get mangled by userspace
   * much simpler (1K vs 9K) LOC
   * unified extended statistics

Con:
   * using netvsc has more complex startup model
   * no bifurcated driver support
   * no flow support (since host does not have flow API).
   * no tunnel offload support
   * no receive interrupt support

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-09-14 20:08:41 +02:00
Stephen Hemminger
f6ddcf80ad net/netvsc: implement link state change callback
Implement callback functionality on link state changes.
This is not really driven off of interrupt file descriptor like most other
PMD's. Instead, it happens when a link state change message arrives
in the common ring buffer.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-09-14 20:08:41 +02:00
Stephen Hemminger
85c4209189 net/netvsc: exhausting Tx descriptors is not an error
If application sends faster than vswitch can keep up, then the
transmit descriptor pool will be exhausted. This is not a failure
so change the name statistic and don't include it in oerrors.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-09-14 20:08:41 +02:00
Stephen Hemminger
a25d39a3eb net/netvsc: allow tuning latency with devargs
Allow overriding default guest to host latency on per device basis
with devargs.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-09-14 20:08:41 +02:00
Stephen Hemminger
cf2b90756c bus/vmbus: add devargs support
Take device arguments from command line and put
them in the device devargs.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-09-14 20:08:41 +02:00
Ferruh Yigit
323e7b667f ethdev: make default behavior CRC strip on Rx
Removed DEV_RX_OFFLOAD_CRC_STRIP offload flag.
Without any specific Rx offload flag, default behavior by PMDs is to
strip CRC.

PMDs that support keeping CRC should advertise DEV_RX_OFFLOAD_KEEP_CRC
Rx offload capability.

Applications that require keeping CRC should check PMD capability first
and if it is supported can enable this feature by setting
DEV_RX_OFFLOAD_KEEP_CRC in Rx offload flag in rte_eth_dev_configure()

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Jan Remes <remes@netcope.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2018-09-14 20:08:41 +02:00
Igor Romanov
83cf204a98 net/bonding: do not ignore RSS key on device config
Bonding driver ignores the value of RSS key (that is set in the port RSS
configuration) in bond_ethdev_configure(). So the only way to set
non-default RSS key is by using rss_hash_update(). This is not an
expected behaviour.

Make the bond_ethdev_configure() set default RSS key only if
requested key is set to NULL.

Fixes: 734ce47f71 ("bonding: support RSS dynamic configuration")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Chas Williams <chas3@att.com>
2018-09-14 20:08:41 +02:00
Igor Romanov
617d1ac2fd net/bonding: use evenly distributed default RSS RETA
Default Redirection Table that is set in bonding driver is distributed
evenly over all Rx queues only within every RETA group (the first RETA
entries in every group are always start with zero). But in the most
drivers, default RETA is distributed over all Rx queues without sequence
resets in the beginning of a new group, which implies more balanced
per-core load.

Change the default RETA to be evenly distributed over all Rx queues
considering the whole table.

Fixes: 734ce47f71 ("bonding: support RSS dynamic configuration")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Chas Williams <chas3@att.com>
2018-09-14 20:08:41 +02:00
Igor Romanov
862b35afca net/sfc: support runtime Tx queue setup
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-14 20:08:41 +02:00
Igor Romanov
0668a27a62 net/sfc: support runtime Rx queue setup
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-14 20:08:41 +02:00
Shagun Agrawal
fefee7a619 net/cxgbe: add flow ops to match based on dest MAC
Add flow operations to match packets based on destination MAC address.
Allocate and program hardware MPS table with the destination MAC
address to be matched against. The returned MPS index is then used while
offloading flows to LETCAM (maskfull) and HASH (maskless) filter regions.

Also update existing mac_addr_set() to use the new MPS table API.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-09-14 20:08:41 +02:00
Shagun Agrawal
6fda3f0ddd net/cxgbe: add API to program hardware MPS table
Add API to program and manage hardware Multi Port Switch table. MPS
holds destination MAC addresses to be matched against incoming packets
for further rule processing. Packets not matching any entry in MPS table
will be dropped by default, unless the underlying port is in promiscuous
mode.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-09-14 20:08:41 +02:00
Shagun Agrawal
1decc62b1c net/cxgbe: add flow operations to offload VLAN actions
Add flow API operations to offload vlan push, pop, and rewrite actions.
For vlan push or rewrite actions, allocate and program an entry from
L2T table. Use the L2T index to program vlan actions for LETCAM
(maskfull) and HASH (maskless) filters.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-09-14 20:08:41 +02:00
Shagun Agrawal
23af667f15 net/cxgbe: add API to program hardware layer 2 table
Add API to program and manage hardware Layer 2 Table. L2T holds
information necessary to rewrite specific fields in packet, such
as destination MAC address and vlan id.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-09-14 20:08:41 +02:00
Chas Williams
044846f071 net/i40e: stop LLDP before setting local LLDP MIB
>From the Intel Ethernet Controller X710/XXV710/XL710 Specification
Update:

    Starting from NVM 5.02, if the Set Local LLDP MIB command is
    received while the DCBx specific agent is stopped, the command
    returns an EPERM error. If the command is received while the
    LLDP agent is stopped, it sets the local MIB without exchanging
    LLDP with peer, and returns SUCCESS.

This results in the harmless, but annoying, diagnostic:

    default dcb config fails. err = -53, aq_err = 1.

So, if possible (older firmwares cannot safely stop LLDP), stop the
LLDP daemon when we are in software mod before we attempt to call
i40e_set_dcb_config.

Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-09-14 20:08:41 +02:00
Beilei Xing
4205c7ccec net/i40e: add alarm handler
This patch adds alarm handler, and then i40e
PF will use alarm handler instead of interrupt
handler when device is started and Rx interrupt
mode is disabled. This way will save CPU cycles
during receiving packets.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-09-14 20:08:41 +02:00
Eric Zhang
1db4d2330b net/virtio-user: check negotiated features before set
This patch checks negotiated features to see if necessary to offload
before set the tap device offload capabilities. It also checks if kernel
support the TUNSETOFFLOAD operation.

Fixes: 5e97e42025 ("net/virtio-user: enable offloading")
Cc: stable@dpdk.org

Signed-off-by: Eric Zhang <eric.zhang@windriver.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
2018-09-12 19:10:09 +02:00
Xueming Li
3afdf157fc net/mlx5: fix interrupt completion queue index wrapping
Rxq cq_ci was 16 bits while hardware is expecting to wrap
around 24 bits, this caused interrupt failure after burst of packets.

Fixes: 43e9d9794c ("net/mlx5: support upstream rdma-core")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-09-10 13:59:03 +02:00
Luca Boccassi
8fd55a0794 net/ixgbe: do not return internal code
In case of a temporary failure the ixgbe driver can return the internal
error IXGBE_ERR_RESET_FAILED to the application. Instead, return
-EAGAIN as per the public API specification.

Fixes: cddaf87a1e ("lib: fix unused values")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-09-10 13:31:37 +02:00
Shagun Agrawal
450f99ce7b net/cxgbe: fix memory access when parsing flow match items
Coverity issue: 293096
Fixes: ee61f5113b ("net/cxgbe: parse and validate flows")
Cc: stable@dpdk.org

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-09-03 19:33:19 +02:00
Yaroslav Brustinov
daa3b0833f net/e1000: fix Tx offload capability typos
Fix rx/tx typos in igb_get_tx_port_offloads_capa and
igb_get_tx_queue_offloads_capa.

Fixes: e5c05e6590 ("net/e1000: convert to new Tx offloads API")
Cc: stable@dpdk.org

Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-09-03 19:08:41 +02:00
Jia Yu
6b2a47de07 net/bonding: fix buffer corruption in packets
When bond slave devices cannot transmit all packets in bufs array,
tx_burst callback shall merge the un-transmitted packets back to
bufs array. Recent merge logic introduced a bug which causes
invalid mbuf addresses being written to bufs array.
When caller frees the un-transmitted packets, due to invalid addresses,
application will crash.

The fix is avoid shifting mbufs, and directly write un-transmitted
packets back to bufs array.

Fixes: 09150784a7 ("net/bonding: burst mode hash calculation")
Cc: stable@dpdk.org

Signed-off-by: Jia Yu <jyu@vmware.com>
Acked-by: Chas Williams <chas3@att.com>
2018-08-28 15:27:39 +02:00
Alejandro Lucero
7712a1c660 net/nfp: fix live MAC changes not supported
Some NFP firmwares support live changes to the MAC address, but
this is not always true and the firmware advertises it accordingly.

This patch checks if firmware does not support live changes and
sets RTE_ETH_DEV_NOLIVE_MAC_ADDR in that case.

Cc: stable@dpdk.org

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-08-28 15:27:39 +02:00
Natalie Samsonov
4943a290b8 net/mvpp2: support VLAN for parser offload
Add VLAN packet type support for parser offload.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Shlomi Gridish <sgridish@marvell.com>
Reviewed-by: Dmitri Epshtein <dima@marvell.com>
Reviewed-by: Yuval Caduri <cyuval@marvell.com>
2018-08-28 15:27:39 +02:00
Natalie Samsonov
61940700f5 net/mvpp2: make private variables static
Mark internal variables static to avoid potential redefinition
errors later on.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Yelena Krivosheev <yelena@marvell.com>
2018-08-28 15:27:39 +02:00
Natalie Samsonov
63e0f01704 net/mvpp2: fix comments and error messages
Fix comments and error messages.

Fixes: 7235341d75 ("net/mrvl: support classifier")
Cc: stable@dpdk.org

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2018-08-28 15:27:39 +02:00
Tomasz Duszynski
fe37bf0f7d net/mvpp2: fix array initialization
Fix used_bpools array initialization by using range initializer.
This way all necessary variables are properly initialized regardless
of PP2_NUM_PKT_PROC value.

Fixes: 0ddc9b815b ("net/mrvl: add net PMD skeleton")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2018-08-28 15:27:39 +02:00
Liron Himi
4b4ab496c9 net/mvpp2: use common code to initialize DMA
Use common code to initialize MUSDK DMA memory buffers.

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Natalie Samsonov <nsamsono@marvell.com>
2018-08-28 15:27:39 +02:00
Liron Himi
7a39d1b099 common/mvep: add common code for Marvell drivers
Add MVEP (Marvell Embedded Processors) to drivers/common which
will keep code reused by current and future MRVL PMDs.
Right now we have only common DMA memory initialization routines there.

Signed-off-by: Liron Himi <lironh@marvell.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Reviewed-by: Natalie Samsonov <nsamsono@marvell.com>
2018-08-28 15:27:39 +02:00
Shahaf Shuler
b8ac090835 net/mlx5: fix RSS flow action hash type selection
On the code after the below commits, the criteria to select the IPV4 or
IPV6 hash functions was the existence of some ETH_RSS_IPV4 RSS types on
the flow rule.

The check is wrong. For example ETH_RSS_NONFRAG_IPV4_TCP will not select
the IPV4 hash which will cause the packet to be spread in a bad way.

Fix it by adding the corresponding types needed for each hash selection.

Fixes: 592f05b29a ("net/mlx5: add RSS flow action")
Fixes: fd0b70316b ("net/mlx5: support inner RSS computation")
Cc: stable@dpdk.org

Reported-by: Yaroslav Brustinov <ybrustin@cisco.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-08-28 15:27:39 +02:00
Shahaf Shuler
f9de87187b net/mlx5: disable ConnectX-4 Lx Multi Packet Send by default
On ConnectX-4 Lx the Multi Packet Send (MPW) feature is considered
un-secure, as on some cases were the application provides incorrect mbufs
on the Tx burst the host or NIC can get stuck.

Hence, disabling the feature by default for this specific NIC.
Users can still enable this feature and enjoy the performance gain
(mostly for low number of cores) by using the txq_mpw_en devarg.

This patch will impact the out of the box performance of some application
using ConnectX-4 Lx for the sack of security and robustness.

Since we need different defaults based on the underlying device the mpw
field in the configuration struct was extended to contain also the
MLX5_ARG_UNSET option.

Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-08-28 15:27:39 +02:00