dpdk.git
5 years agonet/virtio: fix packets check in mergeable packed Rx
Tiwei Bie [Thu, 20 Jun 2019 02:34:36 +0000 (10:34 +0800)]
net/virtio: fix packets check in mergeable packed Rx

We should check the descriptor state instead of vq's internal
free count (i.e. the number of descriptors that we haven't made
available) for the remaining mergeable packets.

Fixes: a76290c8f1cf ("net/virtio: implement Rx path for packed queues")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: fix memory leak in mergeable packed Rx
Tiwei Bie [Thu, 20 Jun 2019 02:34:35 +0000 (10:34 +0800)]
net/virtio: fix memory leak in mergeable packed Rx

When there is no enough segments for a packet in mergeable
packed Rx path, we should free the whole mbuf chain instead
of just recycling the last segment.

Fixes: a76290c8f1cf ("net/virtio: implement Rx path for packed queues")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: fix memory leak in mergeable Rx
Tiwei Bie [Thu, 20 Jun 2019 02:34:34 +0000 (10:34 +0800)]
net/virtio: fix memory leak in mergeable Rx

When there is no enough segments for a packet in mergeable
Rx path, we should free the whole mbuf chain instead of just
recycling the last segment.

Fixes: bcac5aa207f8 ("net/virtio: improve batching in mergeable path")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: fix memory leak in in-order Rx
Tiwei Bie [Thu, 20 Jun 2019 02:34:33 +0000 (10:34 +0800)]
net/virtio: fix memory leak in in-order Rx

When there is no enough segments for a packet in in-order
mergeable Rx path, we should free the whole mbuf chain instead
of just recycling the last segment.

Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: move VLAN tag insertion to Tx prepare
Dilshod Urazov [Mon, 17 Jun 2019 11:31:38 +0000 (12:31 +0100)]
net/virtio: move VLAN tag insertion to Tx prepare

VLAN tag insertion should be in Tx prepare, not in Tx burst functions.
One of Tx prepare goals is to be able to do preparations in advance
(possibly on different CPU core) and then transmit it fast.
Also Tx prepare can report that a packet does not pass Tx offloads
check. E.g. has no enough headroom to insert VLAN header.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: add Tx preparation
Dilshod Urazov [Mon, 17 Jun 2019 11:31:37 +0000 (12:31 +0100)]
net/virtio: add Tx preparation

Virtio requires pseudo-header checksum in TCP/UDP checksum to do
offload, but it was lost when Tx prepare is introduced. Also
rte_validate_tx_offload() should be used to validate Tx offloads.

Also it is incorrect to do virtio_tso_fix_cksum() after prepend
to mbuf without taking prepended size into account, since layer 2/3/4
lengths provide incorrect offsets after prepend.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agoexamples/vdpa: remove trace of legacy linuxapp
David Marchand [Mon, 17 Jun 2019 07:54:42 +0000 (09:54 +0200)]
examples/vdpa: remove trace of legacy linuxapp

This check on Linux environment has been added at a time when we already
had switched to using the boolean RTE_EXEC_ENV_LINUXAPP.
It was then missed when converting to RTE_EXEC_ENV_LINUX.

Fixes: edbed86d1cc3 ("examples/vdpa: introduce a new sample for vDPA")
Fixes: 742bde12f3bd ("build/linux: rename macro from LINUXAPP to LINUX")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
5 years agoapp/testpmd: drop the workaround for virtio-user
Tiwei Bie [Wed, 5 Jun 2019 09:43:42 +0000 (17:43 +0800)]
app/testpmd: drop the workaround for virtio-user

The RTE_ETH_DEV_CLOSE_REMOVE support has been enabled in
virtio-user, private resources for the port will be freed
by rte_eth_dev_close(), so there is no need to have this
workaround anymore.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: release port upon close
Tiwei Bie [Wed, 5 Jun 2019 09:43:41 +0000 (17:43 +0800)]
net/virtio: release port upon close

Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private
resources for the port can be freed by rte_eth_dev_close().

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: unmap device on initialization error
Tiwei Bie [Wed, 5 Jun 2019 09:43:40 +0000 (17:43 +0800)]
net/virtio: unmap device on initialization error

We should unmap the device when we failed to initialize the device.

Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0")
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: unmap port IO for legacy device
Tiwei Bie [Wed, 5 Jun 2019 09:43:39 +0000 (17:43 +0800)]
net/virtio: unmap port IO for legacy device

For legacy devices, we should also unmap the port IO
resource on device removal.

Fixes: b8f04520ad71 ("virtio: use PCI ioport API")
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: fix queue memory leak on error
Tiwei Bie [Wed, 5 Jun 2019 09:43:38 +0000 (17:43 +0800)]
net/virtio: fix queue memory leak on error

We should free queues when we failed to initialize the virtio device.

Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/iavf: move compile time define to configuration
Lavanya Govindarajan [Mon, 10 Jun 2019 13:07:38 +0000 (14:07 +0100)]
net/iavf: move compile time define to configuration

DEBUG_DUMP_DESC flag is commented out in IAVF Makefile and to enable
it user needs to edit the Makefile. It is felt that this method is not
good. Hence removing this flag from IAVF makefile and adding a flag
CONFIG_RTE_LIBRTE_IAVF_DEBUG_DUMP_DESC to config/common_base.

Signed-off-by: Lavanya Govindarajan <lavanyax.govindarajan@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: remove empty queue stats mapping set devops
Stephen Hemminger [Tue, 28 May 2019 19:43:18 +0000 (12:43 -0700)]
net/i40e: remove empty queue stats mapping set devops

This driver was inserting its own stub for queue_stats_mapping which
did nothing but cause this device to return a different errno
than every other device driver.  All devices that don't implement
queue stats mapping should return the same error.

Maybe the plan originally was to implement something, if that
ever happens, just put in the right code.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/ice: fix dropped packets statistics name
David Marchand [Mon, 3 Jun 2019 08:31:28 +0000 (10:31 +0200)]
net/ice: fix dropped packets statistics name

Copy/paste from i40e, let's align with the fix on i40e.

Fixes: a37bde56314d ("net/ice: support statistics")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: fix dropped packets statistics name
David Marchand [Mon, 3 Jun 2019 08:31:27 +0000 (10:31 +0200)]
net/i40e: fix dropped packets statistics name

i40e and i40evf currently use two different names for the statistic on
dropped packets on the rx and tx sides.
Let's prefer i40evf so that all statistics are suffixed with _packets.

This also avoids a statistic name conflict in OVS.

Fixes: f4a91c38b4ad ("i40e: add extended stats")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
5 years agonet/ipn3ke: fix null pointer dereference
Andy Pei [Thu, 23 May 2019 04:31:22 +0000 (12:31 +0800)]
net/ipn3ke: fix null pointer dereference

In 'ipn3ke_hw_tm_node_wr()', elements of 'n->parent_node' are accessed
but 'n->parent_node' can be NULL.

After applying this patch, this null pointer dereference is avoided.

Coverity issue: 337921
Fixes: c820468ac99c ("net/ipn3ke: support TM")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agonet/ipn3ke: fix accessing variable before null check
Andy Pei [Thu, 23 May 2019 02:53:03 +0000 (10:53 +0800)]
net/ipn3ke: fix accessing variable before null check

Check input argument "rte_eth_dev *ethdev", to be sure variable is not
NULL before operating on it.

Coverity issue: 337922
Fixes: 70d6b7f550f4 ("net/ipn3ke: add representor")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agonet/ipn3ke: delete identical branch
Andy Pei [Wed, 22 May 2019 06:44:42 +0000 (14:44 +0800)]
net/ipn3ke: delete identical branch

Whether the if statement is true or not, the operation is identical.
It is unnecessary to check the if statement, so just delete the if
statement.

Coverity issue: 337928
Fixes: c820468ac99c ("net/ipn3ke: support TM")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agonet/ice: support Tx checksum offload for tunnel
Beilei Xing [Tue, 18 Jun 2019 07:04:48 +0000 (15:04 +0800)]
net/ice: support Tx checksum offload for tunnel

Enable Tx checksum offload for tunneling packets by configuring
tunneling parameters in Tx descriptors, including outer L3/L4 checksum
offload.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: allow VF to configure pctype mapping
Beilei Xing [Mon, 17 Jun 2019 03:17:35 +0000 (11:17 +0800)]
net/i40e: allow VF to configure pctype mapping

This patch allows VF to get/update/reset pctype mapping info.

Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/netvsc: initialize VF spinlock
Stephen Hemminger [Thu, 6 Jun 2019 16:15:10 +0000 (09:15 -0700)]
net/netvsc: initialize VF spinlock

The VF spinlock was never initialized. It works because it is
in zmalloc'd memory and an unlocked lock on x86 is 0.
But for good practice, all spinlock's should be initialized.

Fixes: dc7680e8597c ("net/netvsc: support integrated VF")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
5 years agonet/sfc/base: add APIs for PTP privilege configuration
Gautam Dawar [Mon, 10 Jun 2019 07:38:44 +0000 (08:38 +0100)]
net/sfc/base: add APIs for PTP privilege configuration

Implement the efx_proxy_auth_privilege_mask_get() to get a function's
privilege mask and efx_proxy_auth_privilege_modify() to add/remove
privileges for a function specified by PF and VF index.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: provide API to fetch vPort statistics
Gautam Dawar [Mon, 10 Jun 2019 07:38:43 +0000 (08:38 +0100)]
net/sfc/base: provide API to fetch vPort statistics

Hypervisor should be able to track VF statistics.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: provide APIs to configure and reset vPort
Gautam Dawar [Mon, 10 Jun 2019 07:38:42 +0000 (08:38 +0100)]
net/sfc/base: provide APIs to configure and reset vPort

Implement functions to set vPort VLAN and MAC address and reset the vPort.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: provide proxy APIs to client drivers
Gautam Dawar [Mon, 10 Jun 2019 07:38:41 +0000 (08:38 +0100)]
net/sfc/base: provide proxy APIs to client drivers

Implement the APIs for PROXY_CMD, PROXY_COMPLETE and PRIVILEGE_MASK
messages to allow client drivers authorize VF operations like set MAC,
set MTU etc. with firmware.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: implement proxy auth MCDI event handling
Gautam Dawar [Mon, 10 Jun 2019 07:38:40 +0000 (08:38 +0100)]
net/sfc/base: implement proxy auth MCDI event handling

Add the capability to receive MCDI proxy event from firmware and
invoke the client driver registered function to handle it.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: support proxy auth operations for SR-IOV
Gautam Dawar [Mon, 10 Jun 2019 07:38:39 +0000 (08:38 +0100)]
net/sfc/base: support proxy auth operations for SR-IOV

VMware expects that certain kind of configurations made on the VFs are
authorized by the ESXi before these are applied e.g. assigning a MAC
address to the VF, setting MTU etc. Firmware supports a feature called
MCDI proxy which will be used to implement this authorization check.
The proxy auth module is governed by EFSYS_OPT_MCDI_PROXY_AUTH switch.
This patch adds the framework for proxy auth module along with the APIs
required for SR-IOV initialization.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: support data path with EVB module
Gautam Dawar [Mon, 10 Jun 2019 07:38:38 +0000 (08:38 +0100)]
net/sfc/base: support data path with EVB module

ef10_nic_init() allocates a vAdaptor for the physical port in current
flow. In case of SR-IOV, this vAdaptor must be created for the PF as the
vSwitch is allocated on the physical port. So, the call to
efx_mcdi_vadaptor_alloc() should be avoided in ef10_nic_init() in SR-IOV
flow. To achieve this, for SR-IOV use case, the vSwitch is created
before NIC initialization and its handle is used to prevent vAdaptor
allocation in ef10_nic_init(). This approach has been taken to minimize
the changes in NIC initialization flow.

This is also the case with Linux driver where vSwitch creation happens
before NIC initialization.

Also, when DMA queues need to be allocated for Tx/Rx functionality
(MC_CMD_INIT_RXQ / MC_CMD_INIT_TXQ), the correct vPort is selected
based on efx_vswitch_t property of efx_nic_t structure - vport
corresponding to PF in case of SR-IOV use case and EVB_PORT_ID_ASSIGNED
for physical port.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: factor out upstream port vAdaptor allocation
Gautam Dawar [Mon, 10 Jun 2019 07:38:37 +0000 (08:38 +0100)]
net/sfc/base: factor out upstream port vAdaptor allocation

Separate out vAdaptor allocation from ef10_nic_init() as it is not
required for SR-IOV use case. In case of SR-IOV, vAdaptor is allocated
early along with vSwitch creation and vPort configuration.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: implement vSwitch create/destroy
Gautam Dawar [Mon, 10 Jun 2019 07:38:36 +0000 (08:38 +0100)]
net/sfc/base: implement vSwitch create/destroy

The vSwitch create API takes an array of num_vports client driver
allocated vPort config entries where entry at index 0 contains the PF
configuration and rest num_vports-1 entries refer to vPort configuration
for VFs 0 to (num_vports-2). The required hierarchy
(vswitch/vport/vadaptor) is created within this API. The destroy API
tears down this hierarchy and releases memory for the vSwitch object.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add EVB module vSwitch/vPort/vAdaptor ops
Gautam Dawar [Mon, 10 Jun 2019 07:38:35 +0000 (08:38 +0100)]
net/sfc/base: add EVB module vSwitch/vPort/vAdaptor ops

Implement functions to allocate and free vSwitch, vPort and vAdaptor.
Also, implement functions to add and delete vPort MAC address and EVB
port assign.

Most of the efx_evb_ops_t functions take vSwitch ID as a parameter for
future enhancements. Currently, firmware doesn't implement vSwitch
identifier and hence this parameter is unused for EF10 architecture
implementation.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add MCDI wrappers for vPort and vSwitch in EVB
Gautam Dawar [Mon, 10 Jun 2019 07:38:34 +0000 (08:38 +0100)]
net/sfc/base: add MCDI wrappers for vPort and vSwitch in EVB

Add the functions to implement the vPort and vSwitch MCDI calls.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: introduce EVB module for SR-IOV
Gautam Dawar [Mon, 10 Jun 2019 07:38:33 +0000 (08:38 +0100)]
net/sfc/base: introduce EVB module for SR-IOV

Implement the framework for Enterprise Virtual Briding (EVB) module.
SR-IOV augments the software virtual switch with NIC capabilities
supported from EVB module.
Further patches will add APIs to create and destroy EVB switching
hierarchy required for SR-IOV and APIs to set vPort properties like MAC,
VLAN etc.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: export the zero-based MCDI port number
Gautam Dawar [Mon, 10 Jun 2019 07:38:32 +0000 (08:38 +0100)]
net/sfc/base: export the zero-based MCDI port number

Proxy authorization module for SR-IOV requires one instance of proxy
data structures per card. In order to achieve this, proxy data
structures will be allocated only for primary port (port id 0) and other
secondary ports in the card will access those data structures through
reference to primary port. Accordingly, the port number obtained from
efx_mcdi_get_port_assignment is stored in NIC configuration as
enc_mcdi_port.

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add definition of OEM TLV
Kevin Lampis [Mon, 10 Jun 2019 07:38:31 +0000 (08:38 +0100)]
net/sfc/base: add definition of OEM TLV

Allows to enable additional functionality related to this OEM
(e.g. vendor extensions to VPD, NC-SI etc.)

Signed-off-by: Kevin Lampis <klampis@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add definition of bundle metadata partition
Paul Fox [Mon, 10 Jun 2019 07:38:30 +0000 (08:38 +0100)]
net/sfc/base: add definition of bundle metadata partition

Signed-off-by: Paul Fox <pfox@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add background mode firmware updating
Richard Houldsworth [Mon, 10 Jun 2019 07:38:29 +0000 (08:38 +0100)]
net/sfc/base: add background mode firmware updating

Request firmware updates be performed in background mode.
In this mode MCDI to the function processing the update
remains accessible and the client polls for completion.
This is supported for lengthy partition updates such as
MCFW and bundles. The MC ignores the flags used for this
mode for other partition updates.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: transition to the extensible NVRAM info API
Richard Houldsworth [Mon, 10 Jun 2019 07:38:28 +0000 (08:38 +0100)]
net/sfc/base: transition to the extensible NVRAM info API

Old NVRAM info API required function prototype too often.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: support direct FW update for bundle partitions
Richard Houldsworth [Mon, 10 Jun 2019 07:38:27 +0000 (08:38 +0100)]
net/sfc/base: support direct FW update for bundle partitions

All signed images other than for the MCFW partition should
be written fully to the partition with no rearrangement.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add firmware ID header
Richard Houldsworth [Mon, 10 Jun 2019 07:38:26 +0000 (08:38 +0100)]
net/sfc/base: add firmware ID header

Add definitions header for reflash header IDs. This is required to
support different handling modes for signed firmware images.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: update MCDI headers
Andrew Rybchenko [Mon, 10 Jun 2019 07:38:25 +0000 (08:38 +0100)]
net/sfc/base: update MCDI headers

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add NVRAM info
Richard Houldsworth [Mon, 10 Jun 2019 07:38:24 +0000 (08:38 +0100)]
net/sfc/base: add NVRAM info

Add function to query partition characteristics.
Refactor efx_nvram_size to share implementation.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add extensible NVRAM info function
Richard Houldsworth [Mon, 10 Jun 2019 07:38:23 +0000 (08:38 +0100)]
net/sfc/base: add extensible NVRAM info function

Includes the partition read-only flag, to allow for
checks before opening the partition.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add capabilities for bundle partition
Richard Houldsworth [Mon, 10 Jun 2019 07:38:22 +0000 (08:38 +0100)]
net/sfc/base: add capabilities for bundle partition

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add driver version string registration
Richard Houldsworth [Mon, 10 Jun 2019 07:38:21 +0000 (08:38 +0100)]
net/sfc/base: add driver version string registration

Support the registration of a version string by the libefx
client. The string is passed on to the MC in efx_nic_probe
only to allow the MC to advertise the OS driver version in
NC-SI, and the content is considered opaque for libefx.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: do not rely on indirect header inclusion
Andrew Rybchenko [Mon, 10 Jun 2019 07:38:20 +0000 (08:38 +0100)]
net/sfc/base: do not rely on indirect header inclusion

Types defined in efx_types.h are used in efx.h and it is better do
not rely on the header inclusion from somewhere else (typically from
efsys.h).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: improve code style in sensors decoding
Mark Spender [Mon, 10 Jun 2019 07:38:19 +0000 (08:38 +0100)]
net/sfc/base: improve code style in sensors decoding

Add more comments to simplify code reading and understanding.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: fix shift by more bits than field width
Mark Spender [Mon, 10 Jun 2019 07:38:18 +0000 (08:38 +0100)]
net/sfc/base: fix shift by more bits than field width

This was probably an oversight when support for multiple sensor pages
was added.

Despite being undefined behaviour in C, it probably worked on Intel
x32/x64 as on them bit shift operations wrap round.

Fixes: dfb3b1ce15f6 ("net/sfc/base: import monitors access via MCDI")
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 signed/unsigned mismatch
Andrew Lee [Mon, 10 Jun 2019 07:38:17 +0000 (08:38 +0100)]
net/sfc/base: fix signed/unsigned mismatch

Use UINT32_MAX instead of assigning -1 to a uint32_t variable to
resolve "conversion from 'int' to 'uint32_t', signed/unsigned mismatch"
errors produced by the Visual Studio 2017 toolchain [with the default
/W4 /WX C compiler options which set warning level 4 and treat warnings
as errors].

Fixes: 107cf1d792cb ("net/sfc/base: move limits config to ef10 NIC board config")
Cc: stable@dpdk.org
Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: enable chained multicast on all EF10 cards
Gautam Dawar [Mon, 10 Jun 2019 07:38:16 +0000 (08:38 +0100)]
net/sfc/base: enable chained multicast on all EF10 cards

Set WORKAROUND_BUG26807 which does the job.

Fix the misunderstanding in the Medford code: i.e. the workaround is
always supported by firmware, but the driver still needs to enable it.
Also, as it now applies to all EF10 controllers, the implementation is
moved to EF10 common place.

Fixes: 94190e3543bf ("net/sfc/base: import SFN8xxx family support")
Fixes: 2b38e7b7b7e1 ("net/sfc/base: add Medford2 support to NIC module")
Cc: stable@dpdk.org
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agotelemetry: fix memory leak
Reshma Pattan [Wed, 29 May 2019 12:43:17 +0000 (13:43 +0100)]
telemetry: fix memory leak

Free the `values` pointer before returning
from rte_telemetry_command_ports_all_stat_values()
to avoid memory leak.

Fixes: c12cefa379 ("telemetry: fix mapping of statistics")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
5 years agomaintainers: add Windows exports script
Thomas Monjalon [Thu, 13 Jun 2019 14:11:55 +0000 (23:11 +0900)]
maintainers: add Windows exports script

A script used with meson was missing in the list of files.

Fixes: 4c773788e05a ("build: generate Windows exports file")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agokni: remove PCI related information
Igor Ryzhov [Thu, 6 Jun 2019 13:26:26 +0000 (16:26 +0300)]
kni: remove PCI related information

As there is no ethtool support in KNI anymore,
PCI related information is no longer needed.

Fixes: ea6b39b5b847 ("kni: remove ethtool support")

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: fix typo in EAL guide
Thomas Monjalon [Sun, 16 Jun 2019 14:32:06 +0000 (17:32 +0300)]
doc: fix typo in EAL guide

The EAL init diagram had a typo for "lauch"
instead of "launch".

Fixes: fc1f2750a3ec ("doc: programmers guide")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoapp/testpmd: fix crash
Ferruh Yigit [Fri, 14 Jun 2019 17:19:39 +0000 (18:19 +0100)]
app/testpmd: fix crash

Testpmd tries to calculate mbuf size based on "max Rx packet size" and
"max MTU segment number".
When driver set a "nb_mtu_seg_max" to zero, it causes division by zero
segmentation fault in testpmd.

If the PMD set "nb_mtu_seg_max" to zero, testpmd shouldn't try to
calculate the mbuf size.

Fixes: 33f9630fc23d ("app/testpmd: create mbuf based on max supported segments")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agobus/pci: fix TOCTOU for sysfs access
Stephen Hemminger [Tue, 2 Apr 2019 18:51:05 +0000 (11:51 -0700)]
bus/pci: fix TOCTOU for sysfs access

Using access followed by open causes a static analysis warning
about Time of check versus Time of use. Also, access() and
open() have different UID permission checks.

This is not a serious problem; but easy to fix by using errno instead.

Coverity issue: 300870
Fixes: 4a928ef9f611 ("bus/pci: enable write combining during mapping")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agonet/bnxt: fix build with some compilers
Ajit Khaparde [Fri, 14 Jun 2019 04:20:57 +0000 (09:50 +0530)]
net/bnxt: fix build with some compilers

The driver was defining its own version of roundup which was
conflicting with another version defined elsewhere.

Change the local definition of roundup to avoid compilation errors.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/mlx5: fix master device Netlink socket sharing
Viacheslav Ovsiienko [Thu, 6 Jun 2019 12:23:01 +0000 (12:23 +0000)]
net/mlx5: fix master device Netlink socket sharing

There is the patch [1] that uses master device Netlink socket
to retrieve master device link settings. This is not thread safe
because this resource may be in use by other call to the master
device itself. Using the same Netlink socket concurrently from
the multiple threads causes Netlink requests malfunction and
must be eliminated. The patch replaces master Netlink socket
with the socket from representor device.

[1] http://patches.dpdk.org/patch/53120/

Fixes: 0333b2f584d9 ("net/mlx5: inherit master link settings for representors")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: recover secondary process Tx errors
Matan Azrad [Thu, 30 May 2019 10:20:39 +0000 (10:20 +0000)]
net/mlx5: recover secondary process Tx errors

The SQ errors recovery mechanism in the PMD invokes a Verbs
functions to modify the RQ states in order to reset the SQ and to
reactivate it.

These Verbs functions are not allowed to be invoked from a secondary
process, hence the PMD skips the recovery when the error is captured
by secondary processes queues.

Using the DPDK IPC mechanism the secondary process can request Verbs
queues state modifications to be done synchronically by the primary
process.

Add support for secondary process Tx errors recovery.

Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: recover secondary process Rx errors
Matan Azrad [Thu, 30 May 2019 10:20:38 +0000 (10:20 +0000)]
net/mlx5: recover secondary process Rx errors

The RQ errors recovery mechanism in the PMD invokes a Verbs functions to
modify the RQ states in order to reset the RQ and to reactivate it.

These Verbs functions are not allowed to be invoked from a secondary
process, hence the PMD skips the recovery when the error is captured by
secondary processes queues.

Using the DPDK IPC mechanism the secondary process can request Verbs
queues state modifications to be done synchronically by the primary
process.

Add support for secondary process Rx errors recovery.

Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: handle Tx completion with error
Matan Azrad [Thu, 30 May 2019 10:20:37 +0000 (10:20 +0000)]
net/mlx5: handle Tx completion with error

When WQEs are posted to the HW to send packets, the PMD may get a
completion report with error from the HW, aka error CQE which is
associated to a bad WQE.

The error reason may be bad address, wrong lkey, bad sizes, etc.
that can wrongly be configured by the PMD or by the user.

Checking all the optional mistakes to prevent error CQEs doesn't make
sense due to performance impacts and huge complexity.

The error CQEs change the SQ state to error state what causes all the
next posted WQEs to be completed with CQE flush error forever.

Currently, the PMD doesn't handle Tx error CQEs and even may crashed
when one of them appears.

Extend the Tx data-path to detect these error CQEs, to report them by
the statistics error counters, to recover the SQ by moving the state
to ready again and adjusting the management variables appropriately.

Sometimes the error CQE root cause is very hard to debug and even may
be related to some corner cases which are not reproducible easily, hence
a dump file with debug information will be created for the first number
of error CQEs, this number can be configured by the PMD probe
parameters.

Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: extend Rx completion with error handling
Matan Azrad [Thu, 30 May 2019 10:20:36 +0000 (10:20 +0000)]
net/mlx5: extend Rx completion with error handling

When WQEs are posted to the HW to receive packets, the PMD may receive
a completion report with error from the HW, aka error CQE which is
associated to a bad WQE.

The error reason may be bad address, wrong lkey, small buffer size,
etc. that can wrongly be configured by the PMD or by the user.

Checking all the optional mistakes to prevent error CQEs doesn't make
sense due to performance impacts, moreover, some error CQEs can be
triggered because of the packets coming from the wire when the DPDK
application has no any control.

Most of the error CQE types change the RQ state to error state what
causes all the next received packets to be dropped by the HW and to be
completed with CQE flush error forever.

The current solution detects these error CQEs and even reports the
errors to the user by the statistics error counters but without
recovery, so if the RQ inserted to the error state it never moves to
ready state again and all the next packets ever will be dropped.

Extend the error CQEs handling for recovery by moving the state to
ready again, and rearranging all the RQ WQEs and the management
variables appropriately.

Sometimes the error CQE root cause is very hard to debug and even may
be related to some corner cases which are not reproducible easily,
hence a dump file with debug information will be created for the first
number of error CQEs, this number can be configured by the PMD probe
parameters.

Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: separate Rx queue initialization
Matan Azrad [Thu, 30 May 2019 10:20:35 +0000 (10:20 +0000)]
net/mlx5: separate Rx queue initialization

Move the RQ WQEs initialization code to separate function as an
arrangement to CQE error recovering for code reuse.

CC: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: mitigate Rx doorbell memory barrier
Matan Azrad [Thu, 30 May 2019 10:20:34 +0000 (10:20 +0000)]
net/mlx5: mitigate Rx doorbell memory barrier

The RQ WQEs must be written in the memory before the HW gets the RQ
doorbell, hence a memory barrier should be triggered after the WQEs
writing and before the doorbell writing.

The current code used rte_wmb barrier which ensures that all the memory
stores were done while it is enough to use rte_cio_wmb barrier for the
local memory stores because the WQEs are in local memory.

CC: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix device arguments error detection
Matan Azrad [Thu, 30 May 2019 10:20:33 +0000 (10:20 +0000)]
net/mlx5: fix device arguments error detection

When bad device arguments are added to the DPDK command line, the PMD
ignores all the command line arguments specified by the user and uses
the default values instead.

This behavior doesn't make sense because the user intention is to force
some device parameters and expects to get an error in case of
problematic issues with the arguments.

Stop probing and report an error in case of problematic command line
arguments.

Fixes: e72dd09b614e ("net/mlx5: add support for configuration through kvargs")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add log file procedure for debug data
Matan Azrad [Thu, 30 May 2019 10:20:32 +0000 (10:20 +0000)]
net/mlx5: add log file procedure for debug data

Add a global function in the PMD which dumps debug information to
specific file.

The data can be printed in hexadecimal format or as regular string.

The number of debug files per PMD entity should be limited by a new PMD
probe parameter called max_dump_files_num.

The files will be created in the /var/log directory or in the current
directory.

Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: remove Rx queues indexes correlation
Matan Azrad [Thu, 30 May 2019 10:20:31 +0000 (10:20 +0000)]
net/mlx5: remove Rx queues indexes correlation

There is a full correlation between the CQE indexes to the WQE indexes
in the vectorized Rx queues management.

When the RQ is inserted to the reset state, the correlation may break
because the HW starts the RQ polling from index 0 while the CQ polling
continues regularly.

As an arrangement to CQE errors handling, when the RQ can be reset,
the correlation dependence should be removed from all the Rx queues
index managements.

Remove the aforementioned dependence from the vectorized Rx burst
functions.

Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/ixgbevf: add full link status check option
Haiyue Wang [Fri, 7 Jun 2019 15:56:21 +0000 (23:56 +0800)]
net/ixgbevf: add full link status check option

To get the VF's link status by calling 'rte_eth_link_get_nowait()', the
VF not only check PF's physical link status, but also check the mailbox
running status. And mailbox checking will generate mailbox interrupt in
PF, it will be worse if many VFs are running in the system, the PF will
have to handle many interrrupts.

Normally, checking the PF's physical link status is enough for nowait.
For different scenarios, adding an 'pflink_fullchk' option to control
whether to check the link fully or not.

Fixes: 91546fb62e67 ("net/ixgbevf: fix link state")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Scott Daniels <daniels@research.att.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/bnxt: fix icc build
Naresh Kumar PBS [Sat, 8 Jun 2019 19:22:08 +0000 (23:22 +0400)]
net/bnxt: fix icc build

Address build errors reported by intel compiler while compiling
on Windows. Instead of typeof() using the actual type in ALLOW_FUNC

Cc: stable@dpdk.org
Signed-off-by: Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
5 years agonet/bnxt: fix interrupt vector initialization
Naresh Kumar PBS [Sat, 8 Jun 2019 19:22:07 +0000 (23:22 +0400)]
net/bnxt: fix interrupt vector initialization

Initialize the vector array when it is valid, thereby
preventing a case were it may be accessed when
the array is unallocated

Fixes: 1fe427fd08ee ("net/bnxt: support enable/disable interrupt")
Cc: stable@dpdk.org
Signed-off-by: Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
5 years agonet/bnxt: fix xstats
Kalesh AP [Sat, 8 Jun 2019 19:22:06 +0000 (23:22 +0400)]
net/bnxt: fix xstats

If the HWRM_PORT_QSTATS_EXT fails to initialize
fw_rx_port_stats_ext_size or fw_tx_port_stats_ext_size,
the driver can end up passing junk statistics to the application.

Instead of relying on the application to initialize the xstats
buffer before calling the xstats_get dev_op, memset xstats
with zeros to avoid returning or displaying incorrect statistics.

Also fixed the buffer starting offset.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
5 years agonet/bnxt: use configured MTU during load
Somnath Kotur [Sat, 8 Jun 2019 19:22:05 +0000 (23:22 +0400)]
net/bnxt: use configured MTU during load

The MTU value of a port can be (re)configured out-of-band.
FW will be returning this configured MTU as part of func_qcfg cmd.
Driver to use this value during load time.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: check for null completion ring doorbell
Somnath Kotur [Sat, 8 Jun 2019 19:22:04 +0000 (23:22 +0400)]
net/bnxt: check for null completion ring doorbell

It is observed that sometimes during init, the bnxt_int_handler() gets
invoked while the cpr->cp_db.doorbell is not yet initialized. Check for
the same and return.

Fixes: f7ecea911ec5 ("net/bnxt: fix interrupt handler")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: support redirecting tunnel packets to VF
Somnath Kotur [Sat, 8 Jun 2019 19:22:03 +0000 (23:22 +0400)]
net/bnxt: support redirecting tunnel packets to VF

Add code to redirect GRE, NVGRE and VXLAN tunnel packets
to the specified VF.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/enic: remove flow locks
John Daley [Thu, 6 Jun 2019 15:26:58 +0000 (08:26 -0700)]
net/enic: remove flow locks

There is no requirement for thread safety in the flow PMD code and no
need for the locks.

Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled")
Cc: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: remove flow count action support
John Daley [Thu, 6 Jun 2019 15:26:57 +0000 (08:26 -0700)]
net/enic: remove flow count action support

The firmware in 1400 series VIC adapters which would support COUNT
flow action was postponed and reworked. The capability will be
re-added in a future release when the firmware is available.

This reverts the following commits.
commit 86df6c4e2fce ("net/enic: support flow counter action")
commit 1b4ce87dc5e6 ("net/enic: fix counter action")

Cc: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: report speed capabilities
Hyong Youb Kim [Thu, 6 Jun 2019 15:26:56 +0000 (08:26 -0700)]
net/enic: report speed capabilities

Available link speeds are based on VIC adapter model, which is encoded
in PCI subsystem device ID.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agonet/enic: set min and max MTU
Hyong Youb Kim [Thu, 6 Jun 2019 15:26:55 +0000 (08:26 -0700)]
net/enic: set min and max MTU

These values correspond to those used in the MTU handler (enic_set_mtu).

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agonet/sfc: support Rx interrupts for ef10 datapath
Georgiy Levashov [Thu, 6 Jun 2019 17:33:25 +0000 (18:33 +0100)]
net/sfc: support Rx interrupts for ef10 datapath

Similar to support for efx datapath, Rx interrupt disabling
just avoids rearming the next time.

Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: support Rx interrupts for efx datapath
Georgiy Levashov [Thu, 6 Jun 2019 17:33:24 +0000 (18:33 +0100)]
net/sfc: support Rx interrupts for efx datapath

When Rx interrupts are disabled, we simply disable rearm when
the interrupt fires the next time. So, the next packet will
trigger interrupt (if it is not happened yet after previous Rx
burst processing).

Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/vmxnet3: fix Tx prepare to set positive rte_errno
Andrew Rybchenko [Wed, 5 Jun 2019 08:16:04 +0000 (09:16 +0100)]
net/vmxnet3: fix Tx prepare to set positive rte_errno

Fixes: baf3bbae5556 ("net/vmxnet3: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Yong Wang <yongwang@vmware.com>
5 years agonet/qede: fix Tx prepare to set positive rte_errno
Andrew Rybchenko [Wed, 5 Jun 2019 08:16:03 +0000 (09:16 +0100)]
net/qede: fix Tx prepare to set positive rte_errno

Fixes: 29540be7efce ("net/qede: support LRO/TSO offloads")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ixgbe: fix Tx prepare to set positive rte_errno
Andrew Rybchenko [Wed, 5 Jun 2019 08:16:02 +0000 (09:16 +0100)]
net/ixgbe: fix Tx prepare to set positive rte_errno

Fixes: 7829b8d52be0 ("net/ixgbe: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: fix Tx prepare to set positive rte_errno
Andrew Rybchenko [Wed, 5 Jun 2019 08:16:01 +0000 (09:16 +0100)]
net/ice: fix Tx prepare to set positive rte_errno

Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/iavf: fix Tx prepare to set positive rte_errno
Andrew Rybchenko [Wed, 5 Jun 2019 08:16:00 +0000 (09:16 +0100)]
net/iavf: fix Tx prepare to set positive rte_errno

Fixes: a2b29a7733ef ("net/avf: enable basic Rx Tx")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/i40e: fix Tx prepare to set positive rte_errno
Andrew Rybchenko [Wed, 5 Jun 2019 08:15:59 +0000 (09:15 +0100)]
net/i40e: fix Tx prepare to set positive rte_errno

Fixes: 3f33e643e5c6 ("net/i40e: add Tx preparation")
Fixes: bfeed0262b0c ("net/i40e: check illegal packets")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/fm10k: fix Tx prepare to set positive rte_errno
Andrew Rybchenko [Wed, 5 Jun 2019 08:15:58 +0000 (09:15 +0100)]
net/fm10k: fix Tx prepare to set positive rte_errno

Fixes: 9b134aa39716 ("net/fm10k: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
5 years agonet/enic: fix Tx prepare to set positive rte_errno
Andrew Rybchenko [Wed, 5 Jun 2019 08:15:57 +0000 (09:15 +0100)]
net/enic: fix Tx prepare to set positive rte_errno

Fixes: 1e81dbb5321b ("net/enic: add Tx prepare handler")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/e1000: fix Tx prepare to set positive rte_errno
Andrew Rybchenko [Wed, 5 Jun 2019 08:15:56 +0000 (09:15 +0100)]
net/e1000: fix Tx prepare to set positive rte_errno

Fixes: 2b76648872c9 ("net/e1000: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/atlantic: fix Tx prepare to set positive rte_errno
Andrew Rybchenko [Wed, 5 Jun 2019 08:15:55 +0000 (09:15 +0100)]
net/atlantic: fix Tx prepare to set positive rte_errno

Fixes: 2b1472d7150c ("net/atlantic: implement Tx path")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoethdev: fix Tx prepare documentation to use positive errno
Andrew Rybchenko [Wed, 5 Jun 2019 08:15:54 +0000 (09:15 +0100)]
ethdev: fix Tx prepare documentation to use positive errno

Tx prepare documentation was incorrectly suggesting to use
negative rte_errno.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Fixes: 439a90b5f2a7 ("ethdev: reorder inline functions")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bnx2x: fix supported max Rx/Tx descriptor count
Shahed Shaikh [Tue, 4 Jun 2019 18:53:52 +0000 (11:53 -0700)]
net/bnx2x: fix supported max Rx/Tx descriptor count

Driver does not provide limit on number Rx and Tx descriptors per queue,
this may result in application configuring 64k descriptors (default set
by rte_eth_dev_info_get()) and further result in issues in PMD and HW
flows due to unsupported number.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
5 years agonet/bnx2x: fix link state
Shahed Shaikh [Tue, 4 Jun 2019 18:53:51 +0000 (11:53 -0700)]
net/bnx2x: fix link state

Don't call bnx2x_link_status_update() from bnx2x_link_update().
Actual use case of bnx2x_link_status_update() is to update the link
status in shared memory between driver and MFW, and not to get the
link status from HW.

So ideally, bnx2x_link_status_update() should be called when there
is an actual link event or change in link status.

Calling bnx2x_link_status_update() from bnx2x_link_update() may
corrupt the data of link status in shared memory and result
in inconsistent state of link.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
5 years agonet/bnx2x: fix memory leak
Shahed Shaikh [Tue, 4 Jun 2019 18:53:50 +0000 (11:53 -0700)]
net/bnx2x: fix memory leak

bnx2x_free_hsi_mem() does not free DMA memory.
Fix it here.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
5 years agonet/bnx2x: fix interrupt flood
Shahed Shaikh [Tue, 4 Jun 2019 18:53:49 +0000 (11:53 -0700)]
net/bnx2x: fix interrupt flood

PMD sets up and clears the slow path interrupt status block in dev_start
and dev_stop flow and slow path interrupt status block DMA memory for
device is allocated in dev_configure flow.

This situation creates a state where, after dev_stop is called, and if
there is a slow path interrupt from device, PMD sees the old value of
status block consumer in dev_start flow, since DMA memory for status
block belongs to old configuration and dev_start will result in
new slow path interrupt status block configuration.
And since PMD fails to ack new slow path interrupt with correct status
block consumer value, device continues to trigger interrupt causing an
interrupt flood.

Fix is to create and destroy status block DMA memory in dev_start and
dev_stop flow instead of dev_configure and dev_close flow.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
5 years agonet/bnx2x: fix packet drop
Shahed Shaikh [Tue, 4 Jun 2019 18:53:48 +0000 (11:53 -0700)]
net/bnx2x: fix packet drop

Patch "8bd31421c593 ("net/bnx2x: fix ramrod timeout")"
introduced a regression where sc->scan_fp flags is
set for unexpectedly long time. So the slow path completion
handler flow is run unnecessarily which walks over receive
descriptor ring of fast path and drops the data packets while looking
for slow path completion descriptor out of fast path ring.

This issue is seen under heavy traffic with link events happening
in background.

Fixes: 8bd31421c593 ("net/bnx2x: fix ramrod timeout")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
5 years agonet/ena: fix assigning NUMA node to IO queue
Michal Krawczyk [Tue, 4 Jun 2019 10:59:36 +0000 (12:59 +0200)]
net/ena: fix assigning NUMA node to IO queue

Previous solution was using memzones in invalid way in hope to assign
IO queue to the appropriate NUMA zone.

The right way is to use socket_id from the rx/tx queue setup function
and then pass it to the IO queue.

Fixes: 3d3edc265fc8 ("net/ena: make coherent memory allocation NUMA-aware")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoapp/testpmd: create mbuf based on max supported segments
Sunil Kumar Kori [Mon, 27 May 2019 08:35:29 +0000 (14:05 +0530)]
app/testpmd: create mbuf based on max supported segments

Configuring buffer size based following parameters:
- max-pkt-len
- max supported segments per MTU

Buffer size are configured as given below:
- If platform supports infinite segments per packet then default
  buffer size is used.
- If platform supports nb_mtu_seg_max segments then buffer size
  is configured as (max-pkt-len / nb_mtu_seg_max) + headroom

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoethdev: add default value for max segment
Sunil Kumar Kori [Mon, 27 May 2019 08:35:28 +0000 (14:05 +0530)]
ethdev: add default value for max segment

rte_eth_dev_info structure exposes, nb_seg_max & nb_mtu_seg_max
to provide maximum number of supported segments for a given platform.

Defining UINT16_MAX as default value of above mentioned variables to
expose support of infinite/maximum segments.

Based on above values, application can decide best size for buffers
while creating mbuf pool.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>