dpdk.git
5 years agonet/bnxt: handle cleanup if flow creation fails
Ajit Khaparde [Wed, 2 Oct 2019 23:25:56 +0000 (16:25 -0700)]
net/bnxt: handle cleanup if flow creation fails

If flow creation fails because of an HWRM command failure or
or some other reason, reset the vnic and rxq info set earlier.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
5 years agonet/bnxt: validate RSS hash key length
Venkat Duvvuru [Wed, 2 Oct 2019 23:25:55 +0000 (16:25 -0700)]
net/bnxt: validate RSS hash key length

In bnxt_rss_hash_update_op, driver is proceeding with
bnxt_hwrm_vnic_rss_cfg even though RSS hashkey length is invalid.

This patch fixes the problem by returning -EINVAL when RSS hashkey
length is invalid.

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
5 years agonet/bnxt: check for VNIC ID in rollback
Somnath Kotur [Wed, 2 Oct 2019 23:25:54 +0000 (16:25 -0700)]
net/bnxt: check for VNIC ID in rollback

If driver init/probe fails as part of cleanup/rollback, we may end
up invoking this HWRM cmd even on an invalid vNIC which will
unnecessarily log an error message as the cmd will fail.
Check for invalid ID before issuing the HWRM cmd

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
5 years agonet/bnxt: check if device is started before flow creation
Ajit Khaparde [Wed, 2 Oct 2019 23:25:53 +0000 (16:25 -0700)]
net/bnxt: check if device is started before flow creation

Check device is started before flow creation.
Since the vnic data structures aren't created until device start,
the driver dereferences NULL vnic if flow creation is attempted before
device is started,

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
5 years agonet/bnxt: handle ring cleanup in case of error
Rahul Gupta [Wed, 2 Oct 2019 23:25:52 +0000 (16:25 -0700)]
net/bnxt: handle ring cleanup in case of error

Initialize all rings to INVALID_HW_RING_ID.
This can be used to determine the rings to free if allocation fails.

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
5 years agonet/bnxt: allow only unicast MAC address filter creation
Ajit Khaparde [Wed, 2 Oct 2019 23:25:51 +0000 (16:25 -0700)]
net/bnxt: allow only unicast MAC address filter creation

Check if the application is trying to create filters using
broadcast and multicast MAC address and reject it.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
5 years agonet/bnxt: fix setting default MAC address
Kalesh AP [Wed, 2 Oct 2019 23:25:50 +0000 (16:25 -0700)]
net/bnxt: fix setting default MAC address

Driver was incorrectly programming the MAC with the already
configured one instead of the newly requested MAC by user.

Also, fix to restore the old mac address back to the default
vnic filter if the mac update operation fails.

Fixes: 68f589f2c728 ("net/bnxt: fix setting primary MAC address")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: cleanup VNIC after flow validate
Ajit Khaparde [Wed, 2 Oct 2019 23:25:49 +0000 (16:25 -0700)]
net/bnxt: cleanup VNIC after flow validate

When an application issues flow validate, we free the temporary
filter that is created. But the vnic is not freed up. This can
potentially interfere with subsequent flow creation. So free the vnic.

Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: delete and flush L2 filters cleanly
Ajit Khaparde [Wed, 2 Oct 2019 23:25:48 +0000 (16:25 -0700)]
net/bnxt: delete and flush L2 filters cleanly

Once the last filter associated with a VNIC is deleted when using
RSS action or the Queue action free the VNIC. Also free the RSS
context if the VNIC is using it.

Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@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: parse priority attribute for flow creation
Ajit Khaparde [Wed, 2 Oct 2019 23:25:47 +0000 (16:25 -0700)]
net/bnxt: parse priority attribute for flow creation

Parse priority attribute during flow creation.
This information will be used to give a hint to the FW to
place the flow rule accordingly in the CFA tables.

Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: support RSS action
Ajit Khaparde [Wed, 2 Oct 2019 23:25:46 +0000 (16:25 -0700)]
net/bnxt: support RSS action

Add support for RSS action during flow creation.

group id should not be 0 when RSS action is specified. Driver will
return an error for such a flow.

If a group id is used to create a filter with “n” RSS queues, it cannot
be used to create a filter with a different number of RSS queues till
all the flows using that combination are deleted.

While creating a flow if a group id groups a certain Rx queue ids for
RSS, the same group id shall not create a flow with a different group of
Rx queue ids till all the flows belonging to the group ids are deleted.

While creating a flow if a group id groups a certain Rx queue ids for
RSS, the same queue ids shall not be used with a different group id till
all flows created with that group id are deleted.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
5 years agonet/bnxt: support creating SMAC and inner DMAC filters
Ajit Khaparde [Wed, 2 Oct 2019 23:25:45 +0000 (16:25 -0700)]
net/bnxt: support creating SMAC and inner DMAC filters

We are currently creating only outer DMAC filters.
Create SMAC and inner DMAC filters using HWRM_CFA_L2_FILTER_ALLOC.
For this the HWRM_CFA_L2_FILTER_ALLOC has already been updated.

Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@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: allow flow creation when RSS is enabled
Ajit Khaparde [Wed, 2 Oct 2019 23:25:44 +0000 (16:25 -0700)]
net/bnxt: allow flow creation when RSS is enabled

Currently flow creation is allowed with queue action only
when RSS is disabled. Remove this restriction. Flows can be
created when RSS is enabled.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
5 years agonet/bnxt: allow dynamic creation of VNIC
Ajit Khaparde [Wed, 2 Oct 2019 23:25:43 +0000 (16:25 -0700)]
net/bnxt: allow dynamic creation of VNIC

Refactor code to allow dynamic creation of VNIC for RSS
or Queue Action during flow create.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
5 years agonet/bnxt: return standard error codes for HWRM command
Ajit Khaparde [Wed, 2 Oct 2019 23:25:42 +0000 (16:25 -0700)]
net/bnxt: return standard error codes for HWRM command

If the FW returns an error for an HWRM request, it does not necessarily
return standard error codes.
Convert these HWRM errors to standard errno.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/szedata2: fix dependency check
Thomas Monjalon [Sat, 14 Sep 2019 09:37:00 +0000 (11:37 +0200)]
net/szedata2: fix dependency check

The library libsze2 provides a pkg-config file: libsze2.pc.
Looking for this .pc file - with dependency() - is preferred
than looking for the library - with cc.find_library().

If the library is not installed in a standard path,
it can be found thanks to PKG_CONFIG_PATH variable.
The previous solution required to use CFLAGS and LDFLAGS
environment variables.

Fixes: 508cfe6be9f1 ("net/szedata2: add to meson build")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Jan Remes <remes@netcope.com>
5 years agonet/nfb: fix dependency check
Thomas Monjalon [Sat, 14 Sep 2019 09:36:59 +0000 (11:36 +0200)]
net/nfb: fix dependency check

The library libnfb is part of netcope-common which provides
a pkg-config file: netcope-common.pc.
Looking for this .pc file - with dependency() - is preferred
than looking for the library - with cc.find_library().

If the library is not installed in a standard path,
it can be found thanks to PKG_CONFIG_PATH variable.
The previous solution required to use CFLAGS and LDFLAGS
environment variables.

Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Jan Remes <remes@netcope.com>
5 years agonet/qede: re-add to meson
David Marchand [Thu, 3 Oct 2019 08:18:19 +0000 (10:18 +0200)]
net/qede: re-add to meson

qede has been dropped from the drivers/net meson.
Add it again.

Fixes: 9a8864c8b5da ("net/octeontx2: add build and doc infrastructure")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/dpaa2: add soft parser driver
Sunil Kumar Kori [Thu, 29 Aug 2019 10:27:37 +0000 (15:57 +0530)]
net/dpaa2: add soft parser driver

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: support soft parser in MC
Sunil Kumar Kori [Thu, 29 Aug 2019 10:27:36 +0000 (15:57 +0530)]
net/dpaa2: support soft parser in MC

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agonet/dpaa2: support separate MC portal per process
Shreyansh Jain [Thu, 29 Aug 2019 10:27:35 +0000 (15:57 +0530)]
net/dpaa2: support separate MC portal per process

Earlier, there was a single MCP handle which was available across
complete DPAA2 driver as well as part of the dev_private which was
shared by the secondary process.

For secondary, that is not valid and it would require to open its
own handle for the MC. This is eventually used as part of the DPNI
configuration.

By using the process_private member of the rte_eth_dev, it is
possible to keep separate handles per process. Without worry of
overwriting when secondary process accesses the dev_private.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agobus/fslmc: support multi VFIO group
Hemant Agrawal [Thu, 29 Aug 2019 10:27:34 +0000 (15:57 +0530)]
bus/fslmc: support multi VFIO group

DPAA2 support VFIO device passthrough in VM.
However in this case, each device is associated with different vfio group.

This code required different container id for each group.
On using the same container fd the second time,
ioctl calls are returning error.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/fslmc: check for DMA map in primary process only
Shreyansh Jain [Thu, 29 Aug 2019 10:27:33 +0000 (15:57 +0530)]
bus/fslmc: check for DMA map in primary process only

DMA mapping is a property of primary process - SMMU population done
once by primary doesn't need to be populated again in secondary

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agobus/fslmc: restrict address translation to PA mode
Shreyansh Jain [Thu, 29 Aug 2019 10:27:32 +0000 (15:57 +0530)]
bus/fslmc: restrict address translation to PA mode

The address translation support for PA->VA is required only in
case of PA mode operation of DPDK. This was causing warning to
be reported on running any DPAA2 application in VA mode:

    Add: Incorrect entry for PA->VA Table(xxxxxxxxxx)
    Add: Lowest address: xxxxxxxxxxxx

This was caused by call to update the DPAAX table when VA mode
was enabled, in which case the VA==IOVA address.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agonet/dpaa2: add PTP driver
Priyanka Jain [Thu, 29 Aug 2019 10:27:31 +0000 (15:57 +0530)]
net/dpaa2: add PTP driver

This patch adds the support for PTP driver for
DPAA2 devices.

To enable set
CONFIG_RTE_LIBRTE_IEEE1588=y in
config/defconfig_arm64-dpaa2-linuxapp-gc

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: add DPRTC sub-module
Priyanka Jain [Thu, 29 Aug 2019 10:27:30 +0000 (15:57 +0530)]
net/dpaa2: add DPRTC sub-module

This patch add support for dprtc
(Data Path Real Time Clock) sub-module
based on MC 10.16.0 flib.

It provides interface for PTP stack software
to access physical IEEE 1588 Real Time Clock.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: support timestamp
Priyanka Jain [Thu, 29 Aug 2019 10:27:29 +0000 (15:57 +0530)]
net/dpaa2: support timestamp

IEEE1588 driver needs timestamp of packets.
For DPAA2, the timestamp of TX packets is
stored in annotation area of corresponding
TX confirmation packet.

This patch enables timestamp fields in
annotation area and TX confirmation mode if
CONFIG_RTE_LIBRTE_IEEE1588 is set in
config/defconfig_arm64-dpaa2-linuxapp-gc

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: support Tx confirmation mode
Priyanka Jain [Thu, 29 Aug 2019 10:27:28 +0000 (15:57 +0530)]
net/dpaa2: support Tx confirmation mode

TX confirmation mode provides dedicated confirmation
queues for transmitted packets. These queues are used
by software to get the status and release
transmitted packets buffers.

By default TX confirmation mode is kept disabled.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: support DPDMUX classification for ethernet
Hemant Agrawal [Thu, 29 Aug 2019 10:27:27 +0000 (15:57 +0530)]
net/dpaa2: support DPDMUX classification for ethernet

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: use LFQIDs in Tx instead of QDID
Sachin Saxena [Thu, 29 Aug 2019 10:27:26 +0000 (15:57 +0530)]
net/dpaa2: use LFQIDs in Tx instead of QDID

Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agonet/dpaa2: support config max Rx length in HW
Hemant Agrawal [Thu, 29 Aug 2019 10:27:25 +0000 (15:57 +0530)]
net/dpaa2: support config max Rx length in HW

The MC expects the length to be configured without CRC

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: add CGR counters in xstats
Hemant Agrawal [Thu, 29 Aug 2019 10:27:24 +0000 (15:57 +0530)]
net/dpaa2: add CGR counters in xstats

Add congestion frame drop and byte drop count in xtra stats.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: support taildrop on frame count basis
Hemant Agrawal [Thu, 29 Aug 2019 10:27:23 +0000 (15:57 +0530)]
net/dpaa2: support taildrop on frame count basis

The existing taildrop was based on queue data size.
This patch replaces it with frame count bases using
CGR methods of DPAA2 device.
The number of CGRs are limited. So,
- use per queue CGR based tail drop for as many as CGR
available.
- Remaining queues shall use the legacy byte based tail drop

Number of CGRs can be controlled by dpl file during dpni_create.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: add optional non-prefetch Rx mode
Nipun Gupta [Thu, 29 Aug 2019 10:27:22 +0000 (15:57 +0530)]
net/dpaa2: add optional non-prefetch Rx mode

When we need particular number of packets from the rx routine,
which would change in every call, we cannot prefetch the packets
and provide previous results to the user.

User can select the mode by using devargs for non prefetch mode.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: support L2 payload based RSS distribution
Hemant Agrawal [Thu, 29 Aug 2019 10:27:21 +0000 (15:57 +0530)]
net/dpaa2: support L2 payload based RSS distribution

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: enable Rx offload for timestamp
Hemant Agrawal [Thu, 29 Aug 2019 10:27:20 +0000 (15:57 +0530)]
net/dpaa2: enable Rx offload for timestamp

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: realign Rx offload support types
Hemant Agrawal [Thu, 29 Aug 2019 10:27:19 +0000 (15:57 +0530)]
net/dpaa2: realign Rx offload support types

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agomempool/dpaa: reduce debug messages
Hemant Agrawal [Thu, 29 Aug 2019 10:27:18 +0000 (15:57 +0530)]
mempool/dpaa: reduce debug messages

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agocommon/dpaax: reduce debug messages
Hemant Agrawal [Thu, 29 Aug 2019 10:27:17 +0000 (15:57 +0530)]
common/dpaax: reduce debug messages

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agonet/dpaa2: improve Rx offload debug message
Hemant Agrawal [Thu, 29 Aug 2019 10:27:16 +0000 (15:57 +0530)]
net/dpaa2: improve Rx offload debug message

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa: reduce debug messages
Hemant Agrawal [Thu, 29 Aug 2019 10:27:15 +0000 (15:57 +0530)]
net/dpaa: reduce debug messages

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agonet/dpaa: support Tx scatter gather for non-DPAA buffer
Nipun Gupta [Thu, 29 Aug 2019 10:27:14 +0000 (15:57 +0530)]
net/dpaa: support Tx scatter gather for non-DPAA buffer

This patch adds support for Scatter Gather
in the transmit side, for the cases where the
buffer are received which are not from DPAA
buffer pool.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa: support Rx interrupt enable and disable
Nipun Gupta [Thu, 29 Aug 2019 10:27:13 +0000 (15:57 +0530)]
net/dpaa: support Rx interrupt enable and disable

This patch adds support for dpaa eth driver
interrupt enable and disable callback functions.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa: support Rx interrupt handler
Nipun Gupta [Thu, 29 Aug 2019 10:27:12 +0000 (15:57 +0530)]
net/dpaa: support Rx interrupt handler

This patch adds interrupt handler support for
the ethernet devices which are configured with
a dedicated portal for packet Rx
(i.e. for FQ's in push mode).

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/dpaa: decouple FQ portal alloc and init
Nipun Gupta [Thu, 29 Aug 2019 10:27:11 +0000 (15:57 +0530)]
bus/dpaa: decouple FQ portal alloc and init

The decoupling of FQ portal allocation is required as a
pre-requisite to support Rx interrupts as we need to have
event FD's at portal allocation i.e. before the
initialization of the Frame Queues.
This change will help us get the event fd once the portals
have been allocated for static FQ's.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/dpaa: remove thread affinity
Nipun Gupta [Thu, 29 Aug 2019 10:27:10 +0000 (15:57 +0530)]
bus/dpaa: remove thread affinity

Thread affinity is already taken care by DPDK. Remove them from bus.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa: improve Rx offload debug message
Hemant Agrawal [Thu, 29 Aug 2019 10:27:09 +0000 (15:57 +0530)]
net/dpaa: improve Rx offload debug message

This patch also align few RX offload support to right category.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agobus/dpaa: fix dpaa_sec blacklist
Hemant Agrawal [Thu, 29 Aug 2019 10:27:08 +0000 (15:57 +0530)]
bus/dpaa: fix dpaa_sec blacklist

The black list of dpaa_sec devices fails.
EAL: failed to parse device "dpaa:dpaa_sec-1"

This patch address following issues:
- bus usages dpaa-sec while the driver usage dpaa_sec
- bus usages numbers from 0 to MAX_SEC - while driver
probe usages sec number form max-fman_device +1

Fixes: 6e0752205bb2 ("bus/dpaa: support device blacklisting")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agonet/bnxt: use macro for getting default VNIC
Kalesh AP [Wed, 2 Oct 2019 17:17:45 +0000 (10:17 -0700)]
net/bnxt: use macro for getting default VNIC

Minor code cleanup. BNXT_GET_DEFAULT_VNIC macro returns the default VNIC
of the function and fixed code to use the macro.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: support for QinQ insertion and stripping
Somnath Kotur [Wed, 2 Oct 2019 17:17:44 +0000 (10:17 -0700)]
net/bnxt: support for QinQ insertion and stripping

Driver will accelerate only outer/S-VLAN insertion by turning on
the appropriate bits in the Tx Buffer Descriptor when the packet
arrives for transmission.
The TPID to be used for this S-VLAN is conveyed by the vlan_tpid_set
dev_op which will terminate in the driver.
In the Rx path, driver will continue providing the stripped vlan tag
in the mbuf's vlan tci field. This would be the outermost vlan tag
in a double-tagged packet or the vlan tag for a single vlan tagged pkt.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix crash in secondary process
Stephen Hemminger [Wed, 2 Oct 2019 17:17:43 +0000 (10:17 -0700)]
net/bnxt: fix crash in secondary process

The secondary process should not modify device state when
init is called. The pci device information pointed to by
dev_private pointer is not correct in secondary process.

Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix Rx queue count
Rahul Gupta [Wed, 2 Oct 2019 17:17:42 +0000 (10:17 -0700)]
net/bnxt: fix Rx queue count

Fix Computing of number of used descriptors in an Rx queue.

Fixes: 1b7ceba3e375 ("net/bnxt: support Rx queue count")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: fix accessing variable before null check
Kalesh AP [Wed, 2 Oct 2019 17:17:41 +0000 (10:17 -0700)]
net/bnxt: fix accessing variable before null check

Check input argument "rxq" in bnxt_rx_queue_release_mbufs(), to be sure
variable is not NULL before accessing it.

Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop")
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: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
5 years agonet/bnxt: remove unnecessary interrupt disable
Kalesh AP [Wed, 2 Oct 2019 17:17:40 +0000 (10:17 -0700)]
net/bnxt: remove unnecessary interrupt disable

Since bnxt_enable_int() is called at start time,
invoke bnxt_disable_int() during stop only.
Remove it from device uninit function.

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: remove unused macro
Kalesh AP [Wed, 2 Oct 2019 17:17:39 +0000 (10:17 -0700)]
net/bnxt: remove unused macro

remove MAX_NUM_MAC_ADDR macro

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: remove unnecessary return check
Kalesh AP [Wed, 2 Oct 2019 17:17:38 +0000 (10:17 -0700)]
net/bnxt: remove unnecessary return check

HWRM_CHECK_RESULT_SILENT() returns if the HWRM command fails.
There is no need to check the return value after this call.

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: fix deferred start of Tx queues
Kalesh AP [Wed, 2 Oct 2019 17:17:37 +0000 (10:17 -0700)]
net/bnxt: fix deferred start of Tx queues

Driver should not change "deferred_start" state of the tx queues.
It should get the state in queue_setup_op() and use that value.

Since the deferred start state was being used in the packet transmit
functions to determine whether the queue has been stopped already,
introduced a per-txq flag to track queue stopped/started state.

Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop")
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: fix L2 context calculation for Thor
Kalesh AP [Wed, 2 Oct 2019 17:17:36 +0000 (10:17 -0700)]
net/bnxt: fix L2 context calculation for Thor

On Wh+, number of L2 context supported by FW is the sum of number of
EM flow count and number of L2 context count returned in HWRM_FUNC_QCFG.
This is not true for Thor. Restrict this only for Whitney for now.

Fixes: ff9c0ca47e81 ("net/bnxt: save the number of EM flow count")
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: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
5 years agonet/bnxt: fix 40G link for Thor
Santoshkumar Karanappa Rastapur [Wed, 2 Oct 2019 17:17:35 +0000 (10:17 -0700)]
net/bnxt: fix 40G link for Thor

Link auto negotiation for 40G is not supported by Thor.
Hence speed needs to be forced and autoneg disabled to configure 40G
speed.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix async link handling and update
Ajit Khaparde [Wed, 2 Oct 2019 17:17:34 +0000 (10:17 -0700)]
net/bnxt: fix async link handling and update

When updating the link because of an async link notification
there is no need to set wait_for_completion. At this point
the link related information should be available without need to poll.
Use rte_eth_linkstatus_set instead of memcpy to ensure atomicity
while updating the link status.
We force the physical link down as a part of device stop.
But we are not waiting there enough and handling the async notification
before exiting. It just sits in the default CQ till we do a device
start.
Fix it by calling the CQ handler in device stop.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
5 years agonet/bnxt: subscribe to link speed change notification
Ajit Khaparde [Wed, 2 Oct 2019 17:17:33 +0000 (10:17 -0700)]
net/bnxt: subscribe to link speed change notification

We are not subscribing to link speed change notification.
This patch addresses that.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
5 years agonet/bnxt: fix Rx queue start/stop
Kalesh AP [Wed, 2 Oct 2019 17:17:32 +0000 (10:17 -0700)]
net/bnxt: fix Rx queue start/stop

Driver should not change "deferred_start" state of the rx queues.
It should get the state in queue_setup_op() and use that value.

Since the deferred start state was being used in the packet receive
functions to determine whether a stopped rx ring should be polled,
introduced a per-rxq flag to track queue stopped/started state.

Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix forwarding with higher mbuf size
Santoshkumar Karanappa Rastapur [Wed, 2 Oct 2019 17:17:31 +0000 (10:17 -0700)]
net/bnxt: fix forwarding with higher mbuf size

Maximum frame length supported by hw is 9600 bytes.
When user launches testpmd with --mbuf-size=9729,
we are posting buffer descriptors of size 9601 to the ring.
This was causing packets getting discarded.

Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
5 years agonet/bnxt: fix flow steering
Santoshkumar Karanappa Rastapur [Wed, 2 Oct 2019 17:17:30 +0000 (10:17 -0700)]
net/bnxt: fix flow steering

When user creates a flow similar to an existing flow with just the
destination queue change, we delete the old filter and allocate a new
one with this destination queue change. We were also allocating a new L2
filter matching the same destination mac resulting in 2 L2 filters for the
same destination mac.
This was causing any flow matching the destination mac to be steered to
this queue instead of the default queue.

Fixed it by deleting this stale L2 filter.

Fixes: 5c1171c97216 ("net/bnxt: refactor filter/flow")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: enforce IO barrier for doorbell command
Gavin Hu [Mon, 16 Sep 2019 11:27:18 +0000 (19:27 +0800)]
net/bnxt: enforce IO barrier for doorbell command

The doorbell ringing operation requires a rte_io_mb immediately to make
the command complete and visible to the device before reading the
response, otherwise it may read stale or invalid responses.

Fixes: ca241d9a0952 ("net/bnxt: use I/O device memory read/write API")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: replace memory barrier for doorbell response
Gavin Hu [Mon, 16 Sep 2019 11:27:17 +0000 (19:27 +0800)]
net/bnxt: replace memory barrier for doorbell response

To read the doorbell response, which is held in the host CIO memory,
rte_cio_rmb is sufficient.

Fixes: 804e746c7b73 ("net/bnxt: add hardware resource manager init code")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: remove duplicate barrier
Gavin Hu [Mon, 16 Sep 2019 11:27:16 +0000 (19:27 +0800)]
net/bnxt: remove duplicate barrier

As there is an inclusive rte_io_wmb within the following rte_write32()
API who rings the doorbell, this makes the above rte_wmb unnecessary and
remove it.

Fixes: 1cd45aeb3270 ("net/bnxt: support Stratus VF device")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/ice: use relaxed and remove duplicate barrier
Gavin Hu [Mon, 16 Sep 2019 11:27:15 +0000 (19:27 +0800)]
net/ice: use relaxed and remove duplicate barrier

To guarantee the orderings of successive stores to CIO and MMIO memory,
a lighter weight rte_io_wmb [1] can be used instead of rte_wmb, and since
the ICE_PCI_REG_WRITE API already has an inclusive rte_io_wmb, this
explicit call can even be saved.

[1] http://git.dpdk.org/dpdk/tree/lib/librte_eal/common/include/generic/
rte_atomic.h#n98

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: use relaxed and remove duplicate barrier
Gavin Hu [Mon, 16 Sep 2019 11:27:14 +0000 (19:27 +0800)]
net/i40e: use relaxed and remove duplicate barrier

To guarantee the orderings of successive stores to CIO and MMIO memory,
a lighter weight rte_io_wmb [1] can be used instead of rte_wmb, and since
the I40E_PCI_REG_WRITE API already has an inclusive rte_io_wmb, this
explicit call can be even saved.

[1] http://git.dpdk.org/dpdk/tree/lib/librte_eal/common/include/generic/
rte_atomic.h#n98

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/bnxt: support PTP for Thor
Kalesh AP [Wed, 2 Oct 2019 01:23:35 +0000 (18:23 -0700)]
net/bnxt: support PTP for Thor

On Thor, direct access to PTP registers (via GRC) is not supported.
Driver must use HWRM to access the timestamp information.

Vectorized Rx/Tx cannot be enabled if RTE_LIBRTE_IEEE1588=y.
Remove the PTP flags handling code from the vector Rx path.

Add support to read tx timestamp value and the time from the
timesync clock.

On Thor, Rx timestamps are provided directly in the Rx completion
records to the driver. Only 32 bits of the timestamp is present in
the completion. Driver needs to read the current 48 bit free running
timer using the HWRM_PORT_TS_QUERY command and combine the upper
16 bits from the HWRM response with the lower 32 bits in the
Rx completion to produce the 48 bit timestamp for the Rx packet.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: use macro for bit definitions
Kalesh AP [Wed, 2 Oct 2019 01:23:34 +0000 (18:23 -0700)]
net/bnxt: use macro for bit definitions

use BIT macro instead of bit fields.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: avoid null pointer dereference
Kalesh AP [Wed, 2 Oct 2019 01:23:33 +0000 (18:23 -0700)]
net/bnxt: avoid null pointer dereference

Commit "bd0a14c99f65" enables the creation of a dedicated completion
ring for asynchronous event handling instead of handling these
events on a receive completion ring on non Stingray Platforms.

This causes a segfault due to NULL pointer dereference in
bnxt_alloc_async_cp_ring() on stingray. Fix this by checking the
pointer validity before accessing it.

Fixes: bd0a14c99f65 ("net/bnxt: use dedicated CPR for async events")
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: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
5 years agonet/bnxt: reduce verbosity of logs
Kalesh AP [Wed, 2 Oct 2019 01:23:32 +0000 (18:23 -0700)]
net/bnxt: reduce verbosity of logs

When IOMMU is available, EAL picks IOVA as VA as the default IOVA mode.
This causes the bnxt driver to log warning messages saying
"Memzone physical address same as virtual." and
"Using rte_mem_virt2iova()" during load.

Reduce the verbosity of logs to DEBUG. Reduced couple of other
logs level to DEBUG as well.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: support hot firmware upgrade for Stingray
Kalesh AP [Wed, 2 Oct 2019 01:23:31 +0000 (18:23 -0700)]
net/bnxt: support hot firmware upgrade for Stingray

FW sets HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERR_RECOVER_RELOAD
in HWRM_FUNC_QCAPS command, if device requires to invoke
fastboot FW during FW reset.

Driver has to poll for shutdown bit in fw_status register:
1. in case of hot fw upgrade, this bit will be set after all
   function drivers unregistered with fw.
2. in case of fw initiated error recovery, this bit will be
   set after fw has collected the core dump

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: support FW reset
Kalesh AP [Wed, 2 Oct 2019 01:23:30 +0000 (18:23 -0700)]
net/bnxt: support FW reset

Added code to perform FW_RESET. When the driver detects error in FW,
it has to initiate the recovery by resetting the cores. FW advertise
the method to do a core reset, reset register offsets and values
to perform reset in response of HWRM_ERROR_RECOVERY_QCFG command.

There are 2 ways to recover from the error.
1. Master function issues core resets to recover from error.
2. Master function detects chimp dead condition and notify the Kong
   processor about the chimp dead case through FW_RESET HWRM command.
   Kong Processor send an RESET_NOTIFY async event with
   REASON_CODE_FW_EXCEPTION_FATAL to all the PF’s/VF’s that
   chimp is dead and it is going to reset the chimp.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: support periodic FW health monitoring
Kalesh AP [Wed, 2 Oct 2019 01:23:29 +0000 (18:23 -0700)]
net/bnxt: support periodic FW health monitoring

Periodically poll the FW heartbeat register and FW recovery counter
registers to check the FW health. Polling frequency will be
advertised by the FW in HWRM_ERROR_RECOVERY_QCFG response.
Schedule the task upon receiving the async event from FW.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: handle error recovery FW event
Kalesh AP [Wed, 2 Oct 2019 01:23:28 +0000 (18:23 -0700)]
net/bnxt: handle error recovery FW event

1. Advertise HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ERROR_RECOVERY_SUPPORT flag
   in the FUNC_DRV_RGTR command.
2. request for the async event ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY
   in the FUNC_DRV_RGTR command.
3. handle the async event EVENT_ID_ERROR_RECOVERY from FW.

Error recovery support will be used by firmware only if all the driver
instances support error recovery process.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: map status registers for FW health monitoring
Kalesh AP [Wed, 2 Oct 2019 01:23:27 +0000 (18:23 -0700)]
net/bnxt: map status registers for FW health monitoring

HWRM_ERROR_RECOVERY_QCFG command returns the FW status registers offset
for periodic firmware health check monitoring. Map them to GRC window 2.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: query firmware error recovery capabilities
Kalesh AP [Wed, 2 Oct 2019 01:23:26 +0000 (18:23 -0700)]
net/bnxt: query firmware error recovery capabilities

In Driver initiated error recovery process, driver has to know about
the registers offset and values to initiate FW reset. The HWRM command
HWRM_ERROR_RECOVERY_QCFG is used to obtain all the registers and values
required to initiate FW reset. This command response includes
FW heart_beat register, health status register, Error counter register,
register offsets and values to do chip reset if firmware crashes and
becomes unresponsive.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: handle fatal event from FW
Kalesh AP [Wed, 2 Oct 2019 01:23:25 +0000 (18:23 -0700)]
net/bnxt: handle fatal event from FW

When firmware hit some unrecoverable error conditions, firmware initiate
the recovery by sending an async event EVENT_CMPL_EVENT_ID_RESET_NOTIFY
with data1 set to RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL
to all host drivers and will reset the chip.

The recovery procedure is same sequence as the one for hot FW upgrade.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: inform firmware about IF state changes
Kalesh AP [Wed, 2 Oct 2019 01:23:24 +0000 (18:23 -0700)]
net/bnxt: inform firmware about IF state changes

Use latest firmware API to inform firmware about IF state changes.
Firmware has the option to clean up resources during IF down and
to require the driver to reserve resources again during IF up.

During port start, HWRM_FUNC_DRV_IF_CHANGE command response
flags indicates that firmware has reset. Add logic to re-probe
the firmware and re-setup resources.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: handle reset notify async event from FW
Kalesh AP [Wed, 2 Oct 2019 01:23:23 +0000 (18:23 -0700)]
net/bnxt: handle reset notify async event from FW

When the FW upgrade is initiated the current instance
of FW issues a HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY
async notification to the driver. On receiving this notification,
the PMD shall quiesce itself and poll on the HWRM_VER_GET FW
command at regular intervals.

Once the VER_GET command succeeds, the driver should go through
the rediscovery process and re-initialize the device.

Also register with FW for the reset notify async event.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: prevent device access when device is in reset
Kalesh AP [Wed, 2 Oct 2019 01:23:22 +0000 (18:23 -0700)]
net/bnxt: prevent device access when device is in reset

Refactor init and uninit functions so that the driver can fail
the eth_dev_ops callbacks and accessing Tx and Rx queues
when device is in reset or in error state.

Transmit and receive queues are freed during reset cleanup and
reallocated during recovery. So we block all data path handling
in this state. The eth_dev dev_started field is updated depending
on the status of the device.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: add FW reset HWRM command
Kalesh AP [Wed, 2 Oct 2019 01:23:21 +0000 (18:23 -0700)]
net/bnxt: add FW reset HWRM command

This patch adds new FW reset HWRM command.
Code using this command will be added in future patch.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/mlx5: check sibling device configurations mismatch
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:35 +0000 (07:53 +0000)]
net/mlx5: check sibling device configurations mismatch

The devices backed by mlx5 PMD might share the same multiport
Infiniband device context. It regards representors and slaves
of bonding device. These ports are spawned with devargs.
These patch check whether configuration deduced from these
devargs is compatible with configurations if devices
sharing the same context. It prevents the incorrect
whitelists, like:

-w 82:00.0,representor=0,dv_flow_en=1
-w 82:00.0,representor=1,dv_flow_en=0

The representors with indices [0-1] are supposed to spawned
over the same PCi device, but there is dv_flow_en parameter
mismatch.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: update switch port id in bonding configuration
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:34 +0000 (07:53 +0000)]
net/mlx5: update switch port id in bonding configuration

With bonding configuration multiple PFs may represent the
single switching device with multiple ports as representors.
To distinguish representors belonging to different PFs we
should generated unique port ID. It is proposed to use
the PF index in bonding configuration to generate this
unique port IDs.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: extend switch domain searching range
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:33 +0000 (07:53 +0000)]
net/mlx5: extend switch domain searching range

With bonding configurations the switch domain may be shared
between multiple PCI devices, we should search the switch
sibling devices within the entire set of present ethernet
devices backed by the mlx5 PMD.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: update source and destination vport translations
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:32 +0000 (07:53 +0000)]
net/mlx5: update source and destination vport translations

There new kernel/rdma_core [1] supports matching on metadata
register instead of vport field to provide operations over
VF LAG bonding configurations. This patch provides correct
translations for flow matchers and destination port actions
if united E-Switch (for VF LAG) is configured and/or new vport
matching mode is engaged.

[1] http://patchwork.ozlabs.org/cover/1122170/
    "Mellanox, mlx5 vport metadata matching"

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: elaborate E-Switch port parameters query
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:31 +0000 (07:53 +0000)]
net/mlx5: elaborate E-Switch port parameters query

The routine mlx5_port_to_eswitch_info() is elaborated
to two ones (get E-Switch port parameters by port and
by device pointer) and simplified to returning structure
containing all parameters instead of copying.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: query vport index match mode and parameters
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:30 +0000 (07:53 +0000)]
net/mlx5: query vport index match mode and parameters

There new kernel/rdma_core [1] supports matching on metadata
register instead of vport field to provide operations over
VF LAG bonding configurations. The patch retrieves parameters
and information about the way is engaged to match vport on E-Switch.

[1] http://patchwork.ozlabs.org/cover/1122170/
    "Mellanox, mlx5 vport metadata matching"

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: check kernel support for VF LAG bonding
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:29 +0000 (07:53 +0000)]
net/mlx5: check kernel support for VF LAG bonding

If bonding Infiniband device is found the unified E-Switch
is supposed and the extra rdma-core/kernel support is needed
to retrieve vport indices. The patch introduces this feature
defines, bonding support check is added to probe routine.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: generate bonding device name
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:28 +0000 (07:53 +0000)]
net/mlx5: generate bonding device name

If device is VF LAG bonding one the port name includes
the bonding Infiniband device name and looks like:

  82:00.0_mlx5_bond_0 - for master device port PF0
  82:00.1_mlx5_bond_0_representor_5 - for representor
                                           VF5 over PF1

where bonding Infiniband device mlx5_bond_0 controls
the 82:00.0 as PF0 and 82:00.1 as PF1 PCI functions.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: add VF LAG mode bonding device recognition
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:27 +0000 (07:53 +0000)]
net/mlx5: add VF LAG mode bonding device recognition

The Mellanox NICs starting from ConnectX-5 support LAG over
NIC ports internally, implemented by the NIC firmware and hardware.
The multiport NIC presents multiple physical PCI functions (PF),
with SR-IOV multiple virtual PCI functions (VFs) might be presented.
With switchdev mode the VF representors are engaged and PFs and their
VFs are connected by internal E-Switch feature. Each PF and related VFs
have dedicated E-Switch and belong to dedicated switch domain.

If NIC ports are combined to support NIC the kernel drivers introduce
the single unified Infiniband multiport devices, and all only one
unified E-Switch with single switch domain combines master PF
all all VFs. No extra DPDK bonding device is needed.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: allocate device list explicitly
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:26 +0000 (07:53 +0000)]
net/mlx5: allocate device list explicitly

At device probing the device list to spawn was allocated
as dynamic size local variable. It was no possible to have
one unified exit point from routine due to compiler warnings.
This patch allocates the spawn device list directly with
rte_zmalloc() and it is possible to goto to unified exit
label from anywhere of the routine.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: update PCI address retrieving routine
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:25 +0000 (07:53 +0000)]
net/mlx5: update PCI address retrieving routine

The routine mlx5_ibv_device_to_pci_addr() takes Infiniband
device list object, takes the device sysfs path from there
and retrieves PCI address. The routine may be implemented
in more generic way by taking sysfs path directly as parameter
and can be used for getting PCI address of netdevs.

The generic routine is renamed to mlx5_dev_to_pci_addr()

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: move backing PCI device to private context
Viacheslav Ovsiienko [Wed, 25 Sep 2019 07:53:24 +0000 (07:53 +0000)]
net/mlx5: move backing PCI device to private context

Now all devices created over the same multiport IB device
have shared context containing the backing PCI device field.
For the VF LAG configurations it becomes possible the
representors might be connected to VF created over different
PFs. In this case representors have the different backing
PCI devices and mentioned field should be moved to device
private area.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agodoc: remove deprecated flow director from enic guide
John Daley [Thu, 5 Sep 2019 21:33:18 +0000 (14:33 -0700)]
doc: remove deprecated flow director from enic guide

The legacy filter API "flow director" has been superseded by rte_flow
since 2017. Remove comments in the enic guide regarding the deprecated
feature.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: add PCI id for new virtual function
John Daley [Thu, 5 Sep 2019 21:33:17 +0000 (14:33 -0700)]
net/enic: add PCI id for new virtual function

Probe for the PCI ID of a new mode of VF which will be added to VIC
adapter firmware. When fully implemented, the new mode will operate
independent of the Cisco Virtual Machine Fabric Extender (VM-FEX) and
will not need to be provisioned through libvirt. The new mode is dubbed
"Standalone vNic" mode or "SN" mode.

Also, minor formatting changes.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/null: fix multi-process Rx and Tx
Yasufumi Ogawa [Sun, 29 Sep 2019 02:41:41 +0000 (11:41 +0900)]
net/null: fix multi-process Rx and Tx

Packet processing in secondary process cannot work because rx_pkt_burst
and tx_pkt_burst in eth_dev are not initialized while probing device.
This patch is to the initialization.

Fixes: ee27edbe0c10 ("drivers/net: share vdev data to secondary process")
Cc: stable@dpdk.org
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: support symmetric Toeplitz hash
Simei Su [Tue, 1 Oct 2019 09:22:13 +0000 (17:22 +0800)]
app/testpmd: support symmetric Toeplitz hash

This patch adds command line support for Symmetric Toeplitz
hash configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>