dpdk.git
4 years agonet/mlx5: update Tx queue create for LRO
Dekel Peled [Mon, 22 Jul 2019 14:52:05 +0000 (14:52 +0000)]
net/mlx5: update Tx queue create for LRO

Update function mlx5_txq_ibv_new(), query and store the TIS
transport domain value.
It is required later on Rx side when creating matching TIR.
Add field in mlx5 data structure to store Transport Domain ID.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: support Tx interface query via DevX
Dekel Peled [Mon, 22 Jul 2019 14:52:04 +0000 (14:52 +0000)]
net/mlx5: support Tx interface query via DevX

Implement function mlx5_devx_cmd_qp_tis_td_query(), to query
QP TIS Transport Domain value.

Add related structs in mlx5_prm.h.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: check conditions to enable LRO
Dekel Peled [Mon, 22 Jul 2019 14:52:03 +0000 (14:52 +0000)]
net/mlx5: check conditions to enable LRO

Use DevX API to read device LRO capabilities.
Check if LRO is supported and can be enabled.
Check if MPRQ is supported and can be used.
Enable MPRQ for LRO use if not enabled by user.
Added note for mlx5_mprq_enabled(), to emphasize that LRO
enables MPRQ.
Disable CQE compression and CRC stripping if LRO is enabled.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: add glue for create action via DevX
Dekel Peled [Mon, 22 Jul 2019 14:52:02 +0000 (14:52 +0000)]
net/mlx5: add glue for create action via DevX

Add compile option HAVE_MLX5DV_DR_ACTION_DEST_DEVX_TIR, and matching
dest_tir flag in device configuration structure.
Add glue function pointer dv_create_flow_action_dest_devx_tir, and
function mlx5_glue_dv_create_flow_action_dest_devx_tir(),
to invoke API mlx5dv_dr_action_create_dest_devx_tir();

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: add glue for queue query via DevX
Dekel Peled [Mon, 22 Jul 2019 14:52:01 +0000 (14:52 +0000)]
net/mlx5: add glue for queue query via DevX

Add function mlx5_glue_devx_qp_query().
Add glue function pointer devx_qp_query to run it.
Glue version updated to 19.08.0.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: query LRO capabilities via DevX
Dekel Peled [Mon, 22 Jul 2019 14:52:00 +0000 (14:52 +0000)]
net/mlx5: query LRO capabilities via DevX

Update function mlx5_devx_cmd_query_hca_attr() to query HCA
capabilities related to LRO.

Add relevant structs in drivers/net/mlx5/mlx5_prm.h.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: introduce LRO
Dekel Peled [Mon, 22 Jul 2019 14:51:59 +0000 (14:51 +0000)]
net/mlx5: introduce LRO

Add command-line argument to set LRO session timeout.
Add LRO settings struct in PMD configuration struct.
Add support of LRO offload in port configuration.
Add macros and function to check if LRO is supported and enabled.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: remove redundant item from union
Dekel Peled [Mon, 22 Jul 2019 14:51:58 +0000 (14:51 +0000)]
net/mlx5: remove redundant item from union

A variable of type struct ibv_cq_ex is declared in 2 unions, but
isn't used.
This patch removes the 2 redundant declarations.

Fixes: 6218063b39a6 ("net/mlx5: refactor Rx data path")
Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agoapp/testpmd: fix MAC address parser for flow rule
Ferruh Yigit [Mon, 22 Jul 2019 16:58:32 +0000 (17:58 +0100)]
app/testpmd: fix MAC address parser for flow rule

MAC address parsing was causing failure [1],
this patch partially reverts the commit
commit b5ddce8959b2 ("app/testpmd: use new ethernet address parser")

[1]
testpmd> flow validate 0  priority  2 ingress group 0 pattern eth dst
is 98:03:9B:5C:D9:00 / end actions queue index  0 / end
Bad arguments

Fixes: b5ddce8959b2 ("app/testpmd: use new ethernet address parser")

Reported-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Raslan Darawsheh <rasland@mellanox.com>
4 years agonet/i40e: fix flow director rule destroy
Xiaolong Ye [Mon, 22 Jul 2019 12:06:38 +0000 (20:06 +0800)]
net/i40e: fix flow director rule destroy

We should tear down the fdir when the last flow is destroyed, current
logic is opposite to expected behavior, this patch fixes this issue.

Fixes: 2e67a7fbf3ff ("net/i40e: config flow director automatically")
Cc: stable@dpdk.org
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e: fix ethernet flow rule
Xiaolong Ye [Mon, 22 Jul 2019 12:06:37 +0000 (20:06 +0800)]
net/i40e: fix ethernet flow rule

i40e FDIR doesn't allow to create flow with empty spec and mask for
ethertype pattern. Without this patch, below flow would be created
successfully which is unexpected.

> flow create 0 ingress pattern eth / end actions drop / end

Fixes: 7d83c152a207 ("net/i40e: parse flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/octeontx2: fix driver reconfiguration
Krzysztof Kanas [Mon, 22 Jul 2019 14:58:51 +0000 (16:58 +0200)]
net/octeontx2: fix driver reconfiguration

When configure returns error, e.g. in case not supported offloads
(outer ip and sctp) driver released Rx,Tx queues. Then in case of
correct configuration the driver could not start due to queues already
released but the driver thought it was configured correctly.

Secondly if driver returns error from configuration librte_ethdev will
release, rx queues and tx queues, without chaining driver configured
state.

Fix that by 'releasing' configuration and changing driver state when
error is returned from otx2_nix_configure.

Fixes: 548b5839a32b ("net/octeontx2: add device configure operation")

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Reviewed-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/ark: remove resources when port is close
Ed Czeck [Mon, 22 Jul 2019 12:35:41 +0000 (08:35 -0400)]
net/ark: remove resources when port is close

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

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
4 years agonet/ark: fix queue packet replacement
Ed Czeck [Mon, 22 Jul 2019 12:35:40 +0000 (08:35 -0400)]
net/ark: fix queue packet replacement

Queue index was incorrectly incremented with port, which
caused incorrect queue packet placement. This manifested
when port number was != 0.

Fixes: c33d45af3633 ("net/ark: add Tx initial version")
Cc: stable@dpdk.org
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
4 years agonet/dpaa2: fix multi-segment Tx
Nipun Gupta [Fri, 19 Jul 2019 10:06:09 +0000 (15:36 +0530)]
net/dpaa2: fix multi-segment Tx

This patch resets frc and ctrl in sg tx fd to avoid corruption.

Fixes: 774e9ea91992 ("net/dpaa2: add support for multi seg buffers")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa: check multi-segment external buffers
Hemant Agrawal [Fri, 19 Jul 2019 10:06:08 +0000 (15:36 +0530)]
net/dpaa: check multi-segment external buffers

This patch add check to return error as the handling
for external buffer packets with SG is currently missing.

Fixes: 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/mlx5: revert Netlink socket sharing
Viacheslav Ovsiienko [Sun, 21 Jul 2019 14:56:41 +0000 (14:56 +0000)]
net/mlx5: revert Netlink socket sharing

This reverts commit e28111ac9864af09e826241a915dfff87a9c00ad.
The netlink requests are replaced by ifindex caching and
not needed anymore.

Fixes: e28111ac9864 ("net/mlx5: fix master device Netlink socket sharing")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: cache associated network device index
Viacheslav Ovsiienko [Sun, 21 Jul 2019 14:56:40 +0000 (14:56 +0000)]
net/mlx5: cache associated network device index

The associated device index is retrieved via Netlink request to
underlying Infiniband device driver. This network device index
is permanent throughout the lifetime of device. We do not
spawn the rte_eth_dev ports without associated network device, and
if network device is being unbound we get the remove notification
message and rte_eth_dev port is also detached. So, we may store
the ifindex in mlx5_device_spawn() routine at rte_eth_dev port
creation and initialization time and use the cached value further
instead of doing actual Netlink request.

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: report max number of mbuf segments
Viacheslav Ovsiienko [Sun, 21 Jul 2019 14:25:00 +0000 (14:25 +0000)]
net/mlx5: report max number of mbuf segments

This patch fills the tx_desc_lim.nb_seg_max and
tx_desc_lim.nb_mtu_seg_max fields of rte_eth_dev_info
structure to report thee maximal number of packet
segments, requested inline data configuration is
taken into account in conservative way.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: implement Tx burst template
Viacheslav Ovsiienko [Sun, 21 Jul 2019 14:24:59 +0000 (14:24 +0000)]
net/mlx5: implement Tx burst template

This patch adds the implementation of tx_burst routine template.
The template supports all Tx offloads and multiple optimized
tx_burst routines can be generated by compiler from this one.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: introduce Tx burst routine template
Viacheslav Ovsiienko [Sun, 21 Jul 2019 14:24:58 +0000 (14:24 +0000)]
net/mlx5: introduce Tx burst routine template

Mellanox NICs support the wide set of Tx offloads. The supported
offloads are reported by the mlx5 PMD in rte_eth_dev_info
tx_offload_capa field.
An application may choose any combination of supported offloads
and configure the device appropriately. Some of Tx offloads may be
not requested by application, or ever all of them may be omitted.
Most of the Tx offloads require some code branches in tx_burst routine
to support ones. If Tx offload is not requested the tx_burst routine
code may be significantly simplified and consume less CPU cycles.

For example, if application does not engage TSO offload this code
can be omitted, if multi-segment packet is not supposed the tx_burst
may assume single mbuf packets only, etc.

Currently, the mlx5 PMD implements multiple tx_burst subroutines
for most common combinations of requested Tx offloads, each branch
has its own dedicated implementation. It is not very easy to update,
support and develop such kind of code - multiple branches impose
the multiple points to process. Also many of frequently requested
offload combinations are not supported yet. That leads to selecting of
not completely matching tx_burst routine and harms the performance.

This patch introduces the new approach for tx_burst code. It is proposed
to develop the unified template for tx_burst routine, which supports
all the Tx offloads and takes the compile time defined parameter
describing the supposed set of supported offloads. On the base
of this template, the compiler is able to generate multiple tx_burst
routines highly optimized for the statically specified set of
Tx offloads.
Next, in runtime, at Tx queue configuration the best matching optimized
implementation of tx_burst is chosen.

This patch intentionally omits the template internal implementation,
but just introduces the template itself to emboss the approach of
the multiple specially tuned tx_burst routines.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: add Tx configuration and setup
Viacheslav Ovsiienko [Sun, 21 Jul 2019 14:24:57 +0000 (14:24 +0000)]
net/mlx5: add Tx configuration and setup

This patch updates the Tx datapath control and configuration
structures and code for managing Tx datapath settings.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: extend NIC attributes query via DevX
Viacheslav Ovsiienko [Sun, 21 Jul 2019 14:24:56 +0000 (14:24 +0000)]
net/mlx5: extend NIC attributes query via DevX

This patch extends the NIC attributes query via DevX.
The appropriate interface structures are borrowed from
kernel driver headers and DevX calls are added to
mlx5_devx_cmd_query_hca_attr() routine.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: update Tx definitions
Viacheslav Ovsiienko [Sun, 21 Jul 2019 14:24:55 +0000 (14:24 +0000)]
net/mlx5: update Tx definitions

This patch updates Tx datapath definitions, mostly hardware related.
The Tx descriptor structures are redefined with required fields,
size definitions are renamed to reflect the meanings in more
appropriate way. This is a preparation step before introducing
the new Tx datapath implementation.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: add Tx devargs
Viacheslav Ovsiienko [Sun, 21 Jul 2019 14:24:54 +0000 (14:24 +0000)]
net/mlx5: add Tx devargs

This patch introduces new mlx5 PMD devarg options:

- txq_inline_min - specifies minimal amount of data to be inlined into
  WQE during Tx operations. NICs may require this minimal data amount
  to operate correctly. The exact value may depend on NIC operation
  mode, requested offloads, etc.

- txq_inline_max - specifies the maximal packet length to be completely
  inlined into WQE Ethernet Segment for ordinary SEND method. If packet
  is larger the specified value, the packet data won't be copied by the
  driver at all, data buffer is addressed with a pointer. If packet
  length is less or equal all packet data will be copied into WQE.

- txq_inline_mpw - specifies the maximal packet length to be completely
  inlined into WQE for Enhanced MPW method.

Driver documentation is also updated.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: remove Tx implementation
Viacheslav Ovsiienko [Sun, 21 Jul 2019 14:24:53 +0000 (14:24 +0000)]
net/mlx5: remove Tx implementation

This patch removes the existing Tx datapath code
as preparation step before introducing the new
implementation. The following entities are being
removed:

- deprecated devargs support
- tx_burst() routines
- related PRM definitions
- SQ configuration code
- Tx routine selection code
- incompatible Tx completion code

The following devargs are deprecated and ignored:
- "txq_inline" is going to be converted to "txq_inline_max"
  for compatibility issue
- "tx_vec_en"
- "txqs_max_vec"
- "txq_mpw_hdr_dseg_en"
- "txq_max_inline_len" is going to be converted
  to "txq_inline_mpw" for compatibility issue

The deprecated devarg keys are recognized by PMD
and ignored/converted to the new ones in order not
to block device probing.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: fix typos in comments
Dekel Peled [Thu, 18 Jul 2019 19:40:52 +0000 (22:40 +0300)]
net/mlx5: fix typos in comments

Some spelling mistakes were found in comments.
This patch fixes them.

Fixes: d10b09db0a45 ("net/mlx5: fix allocation when no memory on device NUMA node")
Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items")
Fixes: 7d6bf6b866b8 ("net/mlx5: add Multi-Packet Rx support")
Fixes: f6d9ab4e769f ("net/mlx5: check Tx queue size overflow")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx4: fix typo in comment
Dekel Peled [Thu, 18 Jul 2019 19:36:46 +0000 (22:36 +0300)]
net/mlx4: fix typo in comment

A spelling mistake was found in comment.
This patch fixes it.

Fixes: 8e4937640022 ("net/mlx4: add external allocator for Verbs object")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: fix flow item flags bitmap
Dekel Peled [Thu, 18 Jul 2019 19:42:23 +0000 (22:42 +0300)]
net/mlx5: fix flow item flags bitmap

In functions flow_dv_translate() and  flow_dv_validate(), the flow
items are scanned and each item is marked in item_flags bitmap.
The code handling some of the items was ported from another project,
where items are marked in a slightly different manner.

This patch fixes the setting of items in bitmap, adapting it to the
required manner.

Fixes: d53aa89aea91 ("net/mlx5: support matching on ICMP/ICMP6")
Fixes: 5865955ad994 ("net/mlx5: match GRE key and present bits")
Fixes: 2e4c987aad91 ("net/mlx5: validate Direct Rule E-Switch")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Xiaoyu Min <jackmin@mellanox.com>
4 years agonet/octeontx2: support IPv6 ext parsing
Kiran Kumar K [Fri, 19 Jul 2019 03:18:41 +0000 (08:48 +0530)]
net/octeontx2: support IPv6 ext parsing

Adding support for ipv6_ext header parsing in the octeontx2 flow.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: add build check on fast path fields
Nithin Dabilpuram [Thu, 18 Jul 2019 13:46:22 +0000 (19:16 +0530)]
net/octeontx2: add build check on fast path fields

Add build bug on on fast path used fields that are
dependent on their positions and values.

Fixes: f1eff76ab63e ("net/octeontx2: add Rx vector version")
Fixes: ddc1bc26e9ed ("net/octeontx2: add Tx vector version")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx: use driver log type
Stephen Hemminger [Tue, 16 Jul 2019 18:47:30 +0000 (11:47 -0700)]
net/octeontx: use driver log type

All log messages should use driver logtype. RTE_LOGTYPE_PMD is
planned to be deprecated in the future.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/ice: fix unsafe tailq element removal
Beilei Xing [Fri, 19 Jul 2019 05:28:28 +0000 (13:28 +0800)]
net/ice: fix unsafe tailq element removal

TAILQ_FOREACH macro is not safe to remove elements
during iterating tailq lists. Replace it with
TAILQ_FOREACH_SAFE.

Fixes: d76116a4678f ("net/ice: add generic flow API")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/e1000: fix buffer overrun while i219 processing DMA
Xiao Zhang [Sat, 20 Jul 2019 17:01:37 +0000 (01:01 +0800)]
net/e1000: fix buffer overrun while i219 processing DMA

IntelĀ® 100/200 Series Chipset platforms reduced the round-trip
latency for the LAN Controller DMA accesses, causing in some high
performance cases a buffer overrun while the I219 LAN Connected
Device is processing the DMA transactions. I219LM and I219V devices
can fall into unrecovered Tx hang under very stressfully UDP traffic
and multiple reconnection of Ethernet cable. This Tx hang of the LAN
Controller is only recovered if the system is rebooted. Slightly slow
down DMA access by reducing the number of outstanding requests.
This workaround could have an impact on TCP traffic performance
on the platform. Disabling TSO eliminates performance loss for TCP
traffic without a noticeable impact on CPU performance.

Please, refer to I218/I219 specification update:
https://www.intel.com/content/www/us/en/embedded/products/networking/
ethernet-connection-i218-family-documentation.html

Cc: stable@dpdk.org
Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/bnxt: remove unnecessary interrupt disable
Ajit Khaparde [Fri, 19 Jul 2019 06:19:05 +0000 (11:49 +0530)]
net/bnxt: remove unnecessary interrupt disable

Remove an unnecessary rte_intr_disable() call to disable interrupt
during device init.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: disable vector mode Tx with VLAN offload
Lance Richardson [Fri, 19 Jul 2019 06:19:04 +0000 (11:49 +0530)]
net/bnxt: disable vector mode Tx with VLAN offload

The vector mode transmit path does not currently support VLAN tag
insertion, so we need to disable vector transmit when transmit
VLAN insertion offload is enabled.

Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix interrupt rearm logic
Rahul Gupta [Fri, 19 Jul 2019 06:19:03 +0000 (11:49 +0530)]
net/bnxt: fix interrupt rearm logic

Rearm will intimate hardware that current interrupts are processed
and it can continue to send more.

Fixes: 1fe427fd08ee ("net/bnxt: support enable/disable interrupt")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix Rx interrupt vector
Stephen Hemminger [Fri, 19 Jul 2019 06:19:02 +0000 (11:49 +0530)]
net/bnxt: fix Rx interrupt vector

The receive interrupt vector should be offset by the constant
RTE_INTR_VEC_RXTX_OFFSET; otherwise setting up some queue interrupts
will fail.

Fixes: 1fe427fd08ee ("net/bnxt: support enable/disable interrupt")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Tested-by: Rahul Gupta <rahul.gupta@broadcom.com>
4 years agonet/bnxt: add new device id
Kalesh AP [Fri, 19 Jul 2019 06:19:00 +0000 (11:49 +0530)]
net/bnxt: add new device id

Added support for new thor device.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: update HWRM API to version 1.10.0.91
Ajit Khaparde [Thu, 18 Jul 2019 03:36:16 +0000 (09:06 +0530)]
net/bnxt: update HWRM API to version 1.10.0.91

Update HWRM API to version 1.10.0.91

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix checking result of HWRM command
Kalesh AP [Thu, 18 Jul 2019 03:36:15 +0000 (09:06 +0530)]
net/bnxt: fix checking result of HWRM command

HWRM_CHECK_RESULT macro is used to check the status of HWRM commands.

Fixes: 18c2854b96dd ("net/bnxt: configure a default VF VLAN")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix MAC/VLAN filter allocation
Santoshkumar Karanappa Rastapur [Thu, 18 Jul 2019 03:36:14 +0000 (09:06 +0530)]
net/bnxt: fix MAC/VLAN filter allocation

We were adding the VLAN filters to all the VNICs of the function.
Also, we were adding these VLANs to all the existing MAC only filters.
This was resulting in fewer VLANs getting added. By default we should
allocate MAC+VLAN filter only to the default VNIC of the function using
the default mac address.
Similar logic was followed in the VLAN deletion code. This patch fixes
it.  Use inner VLAN fields instead of outer VLAN during filter deletion
to be in sync with VLAN addition code.

Fixes: 246c5cc5f05e ("net/bnxt: use correct flags during VLAN configuration")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix getting statistics
Lance Richardson [Thu, 18 Jul 2019 03:36:13 +0000 (09:06 +0530)]
net/bnxt: fix getting statistics

Avoid overrun in rte_eth_stats struct when the number of tx/rx
rings in use is greater than RTE_ETHDEV_QUEUE_STAT_CNTRS.

Fixes: 57d5e5bc86e4 ("net/bnxt: add statistics")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix RSS table address for thor
Lance Richardson [Thu, 18 Jul 2019 03:36:12 +0000 (09:06 +0530)]
net/bnxt: fix RSS table address for thor

The current implementation erroneously passes the address of the
beginning of RSS table for each 64-entry context instead of the
address of the appropriate suitable for the context. This results
in only the first 64 receive queues being used. Fix by passing the
correct address for each context.

Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix RSS context numbers for thor
Lance Richardson [Thu, 18 Jul 2019 03:36:11 +0000 (09:06 +0530)]
net/bnxt: fix RSS context numbers for thor

BCM57500-based adapters use a variable number of RSS contexts
depending upon the number of receive rings in use. The current
implementation is erroneously using the maximum possible number
of RSS contexts instead of the actual number allocated when
setting up RSS tables in the adapter. Fix by using the actual
number of allocated contexts.

Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix HWRM messages for thor RSS config
Lance Richardson [Thu, 18 Jul 2019 03:36:10 +0000 (09:06 +0530)]
net/bnxt: fix HWRM messages for thor RSS config

Fully initialize hwrm messages for thor RSS configuration
to avoid hwrm duplicate sequence numbers.

Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
4 years agonet/bnxt: fix RSS table sizes
Lance Richardson [Thu, 18 Jul 2019 03:36:09 +0000 (09:06 +0530)]
net/bnxt: fix RSS table sizes

RSS table size is variable with BCM57500-based adapters. Use correct
size when allocating memory for RSS state.

Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix RSS disable for thor-based adapters
Santoshkumar Karanappa Rastapur [Thu, 18 Jul 2019 03:36:08 +0000 (09:06 +0530)]
net/bnxt: fix RSS disable for thor-based adapters

In bnxt_hwrm_vnic_rss_cfg_thor, we were exiting if hash_type is 0.
This was preventing RSS getting disabled. Fixing it by removing the
check for hash_type while configuring RSS.

Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers")

Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix lock release on getting NVM info
Kalesh AP [Thu, 18 Jul 2019 03:36:07 +0000 (09:06 +0530)]
net/bnxt: fix lock release on getting NVM info

HWRM response was parsed after releasing the spinlock.

Fixes: 19e6af01bb36 ("net/bnxt: support get/set EEPROM")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix return values to standard error codes
Kalesh AP [Thu, 18 Jul 2019 03:36:06 +0000 (09:06 +0530)]
net/bnxt: fix return values to standard error codes

Fixed the return values of few routines to return standard error code.
Also fixed few error logs to more meaningful one.

Fixes: 804e746c7b73 ("net/bnxt: add hardware resource manager init code")
Fixes: e3d8f1e6a665 ("net/bnxt: cache address of doorbell to subsequent access")
Fixes: 19e6af01bb36 ("net/bnxt: support get/set EEPROM")
Fixes: b7435d660a8c ("net/bnxt: add ntuple filtering support")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix error checking of FW commands
Kalesh AP [Thu, 18 Jul 2019 03:36:05 +0000 (09:06 +0530)]
net/bnxt: fix error checking of FW commands

HWRM_CHECK_RESULT() checks the return value of HWRM command and returns
in case the command fails. There is no need of return value check after
HWRM_CHECK_RESULT().

Fixes: 49947a13ba9e ("net/bnxt: support Tx loopback, set VF MAC and queues drop")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: retry IRQ callback deregistration
Lance Richardson [Thu, 18 Jul 2019 03:36:04 +0000 (09:06 +0530)]
net/bnxt: retry IRQ callback deregistration

rte_intr_callback_unregister() can fail if the handler happens to
be active at the time of the call. Add logic to retry a reasonable
number of times to help ensure that the callback is unregistered
on uninit.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix VNIC default completion ring
Lance Richardson [Thu, 18 Jul 2019 03:36:02 +0000 (09:06 +0530)]
net/bnxt: fix VNIC default completion ring

Use the completion ring associated with the default Rx ring
when configuring the default completion ring ID instead
of the async completion ring ID.

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

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: reset filters before registering interrupts
Kalesh AP [Thu, 18 Jul 2019 03:36:01 +0000 (09:06 +0530)]
net/bnxt: reset filters before registering interrupts

If interrupt registration fails during device init, driver invokes
uninit which in turn causes error messages while trying to free
vnic filters. Fix this by moving filter initialization call before
interrupt registration.

Fixes: 1b533790f44e ("net/bnxt: avoid invalid vnic id in set L2 Rx mask")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix device init error path
Kalesh AP [Thu, 18 Jul 2019 03:36:00 +0000 (09:06 +0530)]
net/bnxt: fix device init error path

1. bnxt_dev_init() invokes bnxt_dev_uninit() on failure. So there is
   no need to do individual function cleanups in failure path.
2. rearrange the check for primary process to remove an unwanted goto.
3. fix to invoke bnxt_hwrm_func_buf_unrgtr() in bnxt_dev_uninit() when
   it is needed.

Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix setting primary MAC address
Kalesh AP [Thu, 18 Jul 2019 03:35:59 +0000 (09:05 +0530)]
net/bnxt: fix setting primary MAC address

1. Default filter is tied to VNIC 0 at index 0. After finding the filter
   with mac_index 0 and set the new MAC address, looping through
   remaining filters is unnecessary.
2. Added a check for NULL MAC address.
3. bnxt_hwrm_set_l2_filter() clears the existing filter configuration
   first before applying new filter settings. Hence there is no need to
   invoke bnxt_hwrm_clear_l2_filter() explicitly in
   bnxt_set_default_mac_addr_op().

Fixes: d69851df12b2 ("net/bnxt: support multicast filter and set MAC addr")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix unconditional wait in link update
Kalesh AP [Thu, 18 Jul 2019 03:35:58 +0000 (09:05 +0530)]
net/bnxt: fix unconditional wait in link update

There is an unconditional delay in link update op.
Fixed it to wait only if wait for request completion is set.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
4 years agonet/bnxt: fix adding MAC address
Kalesh AP [Thu, 18 Jul 2019 03:35:57 +0000 (09:05 +0530)]
net/bnxt: fix adding MAC address

HWRM command to add MAC address can fail. Driver should check
the return value of HWRM command and do the house keeping properly.

Fixes: 778b759ba10e ("net/bnxt: add MAC address")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix check of address mapping
Kalesh AP [Thu, 18 Jul 2019 03:35:56 +0000 (09:05 +0530)]
net/bnxt: fix check of address mapping

rte_mem_virt2iova() function returns RTE_BAD_IOVA on failure, not zero.

Fixes: 62196f4e0941 ("mem: rename address mapping function to IOVA")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix error handling in port start
Kalesh AP [Thu, 18 Jul 2019 03:35:55 +0000 (09:05 +0530)]
net/bnxt: fix error handling in port start

1. during port start, if bnxt_init_chip() return error
   bnxt_dev_start_op() invokes bnxt_shutdown_nic() which in turn calls
   bnxt_free_all_hwrm_resources() to free up resources. Hence remove the
   bnxt_free_all_hwrm_resources() from bnxt_init_chip() failure path.
2. fix to check the return value of rte_intr_enable() as this call
   can fail.
3. set bp->dev_stopped to 0 only when port start succeeds.
4. handle failure cases in bnxt_init_chip() routine to do proper
   cleanup and return correct error value.

Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agodoc: fix ethernet addresses in flow API guide
Dekel Peled [Wed, 17 Jul 2019 19:44:18 +0000 (22:44 +0300)]
doc: fix ethernet addresses in flow API guide

Ethernet address examples contain 5 bytes only.
This patch changes the examples to valid 6 bytes Ethernet addresses.

Fixes: 4d73b6fb9907 ("doc: add generic flow API guide")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: be more restrictive with ethernet address format
Stephen Hemminger [Thu, 18 Jul 2019 18:35:44 +0000 (11:35 -0700)]
net: be more restrictive with ethernet address format

The current ether_unformat_addr code was based off of
BSD ether_aton. That version changed what was allowed
by the cmdline ether address parser.
For example, it allows dropping leading zeros.

Change the code to be more restrictive and only allow the fully
expanded standard formats.

Bugzilla ID: 324
Fixes: 596d31092d32 ("net: add function to convert string to ethernet address")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
4 years agonet/i40e: fix SFP X722 with FW4.16
Xiao Zhang [Fri, 19 Jul 2019 10:59:56 +0000 (18:59 +0800)]
net/i40e: fix SFP X722 with FW4.16

When NVM API version is 1.7 or above adminq operation to set TPID is
set as supported. This cause using adminq instead of registers.

For SFP X722 FW4.16, reported NVM API version is 1.8, and this cause
adminq operation to set as supported but it is not supported on FW4.16

Additional check added for SFP X722 to not enable adminq operation.

Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register setting")
Cc: stable@dpdk.org
Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
4 years agonet/i40e: fix MAC removal check
Herakliusz Lipiec [Thu, 18 Jul 2019 14:44:48 +0000 (15:44 +0100)]
net/i40e: fix MAC removal check

Add return value check for i40e_vsi_delete_mac call in
rte_pmd_i40e_remove_vf_mac_addr as per coverity issue.

Coverity issue: 277224
Fixes: e0cb96204b71 ("net/i40e: add support for representor ports")
Cc: stable@dpdk.org
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/ice: add flow IPv6 TC support
Ying A Wang [Thu, 18 Jul 2019 01:38:43 +0000 (09:38 +0800)]
net/ice: add flow IPv6 TC support

When set flow ipv6 tc rule, ice_get_flow_field will set error.
This patch fixes this issue.

Fixes: d76116a4678f ("net/ice: add generic flow API")

Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice: fix flow action validation
Ying A Wang [Thu, 18 Jul 2019 01:38:42 +0000 (09:38 +0800)]
net/ice: fix flow action validation

Action is a list. We should check each element of the action
rather than the first one.
This patch fixes this issue.

Fixes: d76116a4678f ("net/ice: add generic flow API")

Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: fix flow validation for void item type
Ying A Wang [Thu, 18 Jul 2019 01:38:41 +0000 (09:38 +0800)]
net/ice: fix flow validation for void item type

ice_get_flow_field should not set error if item->type is
RTE_FLOW_ITEM_TYPE_VOID.
This patch fixes this issue.

Fixes: d76116a4678f ("net/ice: add generic flow API")

Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/iavf: fix Rx bytes stats
Qi Zhang [Wed, 17 Jul 2019 04:31:00 +0000 (12:31 +0800)]
net/iavf: fix Rx bytes stats

Exclude 4 bytes CRC for rx bytes stats.
This also aligned Rx stats calculation with PF.

Fixes: f4a41a6953af ("net/avf: support stats")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/failsafe: skip devargs if not present in secondary
Stephen Hemminger [Fri, 21 Jun 2019 22:08:24 +0000 (15:08 -0700)]
net/failsafe: skip devargs if not present in secondary

When secondary process is run was noticing that the log always
contained complaints about unable to parse devargs.

It turns out that an empty devargs turns into "" and this
value is not parsable. Change the failsafe secondary to just
skip doing devargs if it empty.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
4 years agonet/bonding: use dynamic log type for error message
Stephen Hemminger [Tue, 16 Jul 2019 20:39:10 +0000 (13:39 -0700)]
net/bonding: use dynamic log type for error message

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Bonding driver was still using it in one place.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: add option to not start device
Stephen Hemminger [Tue, 16 Jul 2019 18:42:34 +0000 (11:42 -0700)]
app/testpmd: add option to not start device

Some configuration options can not be tested properly with testpmd
because it automatically starts all ports. This makes it harder
to test driver handling of configuration options:
(for example rx_deferred_start).

Add new command line flag --disable-device-start which skips
the device start. The port can then be started manually later.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/bnxt: check invalid VNIC id for firmware
Jay Ding [Wed, 17 Jul 2019 10:41:39 +0000 (16:11 +0530)]
net/bnxt: check invalid VNIC id for firmware

Add checking for vnic id before sending message to chimp in
bnxt_hwrm_vnic_plcmode_cfg().

Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")
Cc: stable@dpdk.org
Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
4 years agonet/bnxt: fix RxQ count if ntuple filtering is disabled
Qingmin Liu [Wed, 17 Jul 2019 10:41:38 +0000 (16:11 +0530)]
net/bnxt: fix RxQ count if ntuple filtering is disabled

If ntuple filtering is disabled, FW will return max_vnics=1.
Due to this only single Rxq is created.
Change to max_rx_rings = RTE_MIN(bp->max_rx_rings, bp->max_stat_ctx) to
fix it.

Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled")
Cc: stable@dpdk.org
Signed-off-by: Qingmin Liu <qingmin.liu@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
4 years agonet/bnxt: fix compiler warning
Ajit Khaparde [Wed, 17 Jul 2019 10:41:37 +0000 (16:11 +0530)]
net/bnxt: fix compiler warning

Compiler complains of an uninitialized variable.
Initializing it to avoid the issue.

Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
4 years agonet/bnxt: check invalid VNIC in cleanup path
Kalesh AP [Wed, 17 Jul 2019 10:41:36 +0000 (16:11 +0530)]
net/bnxt: check invalid VNIC in cleanup path

The cleanup/rollback operation post rte_eth_dev_start failure might end
up invoking an HWRM cmd even on an invalid vNIC resulting in error
messages being logged needlessly.
Fix to check for the same before issuing the HWRM cmd.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
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>
4 years agonet/bnxt: fix enabling/disabling interrupts
Kalesh AP [Wed, 17 Jul 2019 10:41:35 +0000 (16:11 +0530)]
net/bnxt: fix enabling/disabling interrupts

1. Disable interrupts in dev_stop_op()
2. Enable interrupts in dev_start_op()
3. Clean queue intr-vector mapping in dev_stop_op() and thus
   fix a possible memory leak.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
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>
4 years agonet/bnxt: avoid null pointer dereference
Lance Richardson [Wed, 17 Jul 2019 10:41:34 +0000 (16:11 +0530)]
net/bnxt: avoid null pointer dereference

Avoid null pointer dereference when allocating an insulated
completion ring by basing nq ring allocation on whether an
nq ring was requested instead of whether the device supports
nq rings.

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

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: cleanup NQ doorbell
Lance Richardson [Wed, 17 Jul 2019 10:41:33 +0000 (16:11 +0530)]
net/bnxt: cleanup NQ doorbell

Simplify nq doorbell handling code by removing redundant db
parameter and consolidating NQ doorbell macro into the inline
function that uses it.

Add "enable interrupt" variant of nq write. This will be used
in a subsequent commit.

When initializing nq doorbell, don't assume that only the
"disable interrupt" form will be used.

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

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: save the number of EM flow count
Ajit Khaparde [Wed, 17 Jul 2019 10:41:32 +0000 (16:11 +0530)]
net/bnxt: save the number of EM flow count

Save the number of EM flow count returned by the FW in HWRM_FUNC_QCFG
and use it to calculate the overall pool of L2 contexts supported by FW.

Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
4 years agonet/bnxt: fix doorbell register offset for Tx ring
Ajit Khaparde [Wed, 17 Jul 2019 10:41:31 +0000 (16:11 +0530)]
net/bnxt: fix doorbell register offset for Tx ring

For Tx-ring # 104 and higher, the doorbell register was incorrectly
configured due to which FW was not able to receive the notification
of packet to transmit.
With this fix, user can run traffic upto 256 rings.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix L4 checksum error indication in Rx
Rahul Gupta [Wed, 17 Jul 2019 10:41:30 +0000 (16:11 +0530)]
net/bnxt: fix L4 checksum error indication in Rx

Update ol_flags correctly for checksum errors in case of tunnel and
non-tunnel packet.

Fixes: 65ee636872eb ("net/bnxt: fix Rx checksum flags")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: reset Rx allocation state on port restart
Lance Richardson [Wed, 17 Jul 2019 10:41:29 +0000 (16:11 +0530)]
net/bnxt: reset Rx allocation state on port restart

Move call site of bnxt_rxq_vec_setup() to ensure that rxq->rxrearm_nb
and rxq->rxrearm_start are reinitialized correctly when a port is
restarted.

Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Christopher Reder <christopher.reder@broadcom.com>
4 years agonet/bnxt: fix Tx hang after port stop/start
Lance Richardson [Wed, 17 Jul 2019 10:41:28 +0000 (16:11 +0530)]
net/bnxt: fix Tx hang after port stop/start

Initialize the state of the completion valid indicator
when a completion ring is freed, otherwise completions may
not be processed when a new ring is allocated.

Fixes: 5735eb241947 ("net/bnxt: support Tx batching")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
4 years agonet/bnxt: fix VF probe when MAC address is zero
Kalesh AP [Wed, 17 Jul 2019 10:41:27 +0000 (16:11 +0530)]
net/bnxt: fix VF probe when MAC address is zero

VF driver should not fail probe if the host PF driver has not assigned
any MAC address for the VF. It should generate a random MAC address and
configure the MAC and then continue probing the device.

Fixes: be160484a48d ("net/bnxt: check if MAC address is all zeros")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix crash on probe failure
Kalesh AP [Wed, 17 Jul 2019 10:41:26 +0000 (16:11 +0530)]
net/bnxt: fix crash on probe failure

Fixed couple of possible segfaults due to NULL pointer
dereference in case of probe failure.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix extended port counter statistics
Kalesh AP [Wed, 17 Jul 2019 10:41:25 +0000 (16:11 +0530)]
net/bnxt: fix extended port counter statistics

1. refactor stats allocation code to new routine
2. check for extended statistics support depends on "hwrm_spec_code"
   which is set in bnxt_hwrm_ver_get called later. Hence we were never
   querying extended port stats as flags field was not updated. Fixed
   this by moving the stats allocation after the call to
   bnxt_hwrm_ver_get.
3. we were incorrectly passing the host address used for port
   statistics to PORT_QSTATS_EXT command. Fixed this by passing the
   correct extended stats address.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agoapp/testpmd: add device related commands
Nithin Dabilpuram [Wed, 17 Jul 2019 12:30:55 +0000 (18:00 +0530)]
app/testpmd: add device related commands

With the latest published interface of
rte_eal_hotplug_[add,remove](), and rte_eth_dev_close(),
rte_eth_dev_close() would cleanup all the data structures of
port's eth dev leaving the device common resource intact
if RTE_ETH_DEV_CLOSE_REMOVE is set in dev flags.

So a new command "detach device" (~hotplug remove) to work,
with device identifier like "port attach" is added
to be able to detach closed devices.

Also to display currently probed devices, another command
"show device info <identifier>|all" is also added as a
part of this change.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: add GRE key for raw encap/decap
Xiaoyu Min [Wed, 17 Jul 2019 12:27:10 +0000 (20:27 +0800)]
app/testpmd: add GRE key for raw encap/decap

GRE key (rte_flow_item_type_gre_key) is also needed in
raw encapsulation/decapsulation.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: support MPLS TC and S bits
Xiaoyu Min [Wed, 17 Jul 2019 12:27:09 +0000 (20:27 +0800)]
app/testpmd: support MPLS TC and S bits

Open the MPLS's TC and S bits of rte_flow_item_mpls in command line.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: support raw encap/decap actions
Xiaoyu Min [Wed, 17 Jul 2019 12:27:08 +0000 (20:27 +0800)]
app/testpmd: support raw encap/decap actions

This patch intend to support
action_raw_encap/decap [1] in a generic and convenient way.

Two new commands - set raw_encap, set raw_decap are introduced just
like the other commands for encap/decap, i.e. set vxlan.

These two commands have corresponding global buffers
which can be used by PMD as the input buffer for raw encap/decap.

The commands use the rte_flow pattern syntax to help user build the
raw buffer in a convenient way.

A common way to use it:

- encap matched egress packet with VxLAN tunnel:
testpmd> set raw_encap eth src is 10:11:22:33:44:55 / vlan tci is 1
 inner_type is 0x0800 / ipv4 / udp dst is 4789 / vxlan vni
 is 2 / end_set
testpmd> flow create 0 egress pattern eth / ipv4 / end actions
 raw_encap / end

- decap l2 header and encap GRE tunnel on matched egress packet:
testpmd> set raw_decap eth / end_set
testpmd> set raw_encap eth dst is 10:22:33:44:55:66 / ipv4 / gre
 protocol is 0x0800 / end_set
testpmd> flow create 0 egress pattern eth / ipv4 / end actions
 raw_decap / raw_encap / end

- decap VxLAN tunnel and encap l2 header on matched ingress packet:
testpmd> set raw_encap eth src is 10:11:22:33:44:55 type is 0x0800 /
 end_set
testpmd> set raw_decap eth / ipv4 / udp / vxlan / end_set
testpmd> flow create 0 ingress pattern eth / ipv4 / udp dst is 250 /
         vxlan vni is 0x1234 / ipv4 / end actions raw_decap /
         raw_encap / queue index 1 / mark id 0x1234 / end

[1] http://mails.dpdk.org/archives/dev/2018-October/116092.html

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: move VXLAN/NVGRE help in filters section
Xiaoyu Min [Wed, 17 Jul 2019 12:27:07 +0000 (20:27 +0800)]
app/testpmd: move VXLAN/NVGRE help in filters section

The help string of set vxlan*, set nvgre* are in "config" section.
But they actually do not alter NIC or testpmd's configuration and
they will be used by "flow" command later.

Put them in "filters" section along with "flow" command seems more
reasonable.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/pcap: remove Rx queue argument necessity
Aideen McLoughlin [Wed, 17 Jul 2019 08:08:46 +0000 (09:08 +0100)]
net/pcap: remove Rx queue argument necessity

Previously in the PCAP PMD queues has to be defined as RxQ and TxQ
pairs, even if the need is only Rx or only Tx:
 "--vdev net_pcap0,tx_pcap=tx.pcap,rx_pcap=rx.pcap"

Following commit enabled only providing Rx queue, and if Tx queue is
not provided PMD drops the Tx packets automatically:
Commit a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")
 "--vdev net_pcap0,rx_pcap=rx.pcap"

This commit enables same thing for Rx queue, user no more have to
provide a Rx queue (rx_iface or rx_pcap), for this case a dummy Rx
burst function is used which doesn't return any packet at all:
 "--vdev net_pcap0,tx_pcap=tx.pcap"

This makes only saving packets to a pcap file use case easy.

When both Rx and Tx queues are missing PMD will return an error.
(Single interface is still supported: "--vdev net_pcap0,iface=eth0")

Signed-off-by: Aideen McLoughlin <aideen.mcloughlin@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ena: fix admin CQ polling for 32-bit
David Harton [Fri, 12 Jul 2019 17:35:43 +0000 (13:35 -0400)]
net/ena: fix admin CQ polling for 32-bit

Recent modifications to admin command queue polling logic
did not support 32-bit applications.  Updated the driver to
work for 32 or 64 bit applications

Fixes: 3adcba9a8987 ("net/ena: update HAL to the newer version")
Cc: stable@dpdk.org
Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
4 years agoapp/testpmd: fix show port info routine
Viacheslav Ovsiienko [Tue, 16 Jul 2019 10:34:34 +0000 (10:34 +0000)]
app/testpmd: fix show port info routine

This patch updates "show port info [port_id]" command to display
the tx_desc_lim.nb_seg_max and tx_desc_lim.nb_mtu_seg_max fields
of rte_eth_dev_info structure.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
4 years agonet/mlx5: allow basic counter management fallback
Matan Azrad [Tue, 16 Jul 2019 14:34:56 +0000 (14:34 +0000)]
net/mlx5: allow basic counter management fallback

In case the asynchronous devx commands are not supported in RDMA core
fallback to use a basic counter management.

Here, the PMD counters cashe is redundant and the host thread doesn't
update it. hence, each counter operation will go to the FW and the
acceleration reduces.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
4 years agonet/mlx5: accelerate DV flow counter query
Matan Azrad [Tue, 16 Jul 2019 14:34:55 +0000 (14:34 +0000)]
net/mlx5: accelerate DV flow counter query

All the DV counters are cashed in the PMD memory and are contained in
pools which are contained in containers according to the counters
allocation type - batch or single.

Currently, the flow counter query is done synchronously in pool
resolution means that on the user request a FW command is triggered to
read all the counters in the pool.

A new feature of devX to asynchronously read batch of flow counters
allows to accelerate the user query operation.

Using the DPDK host thread, the PMD periodically triggers asynchronous
query in pool resolution for all the counter pools and an interrupt is
triggered by the FW when the values are updated.
In the interrupt handler the pool counter values raw data is replaced
using a double buffer algorithm (very fast).
In the user query, the PMD just returns the last query values from the
PMD cache - no system-calls and FW commands are triggered from the user
control thread on query operation!

More synchronization is added with the host thread:
        Container resize uses double buffer algorithm.
        Pools growing in container uses atomic operation.
        Pool query buffer replace uses a spinlock.
        Pool minimum devX counter ID uses atomic operation.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
4 years agonet/mlx5: resize a full counter container
Matan Azrad [Tue, 16 Jul 2019 14:34:54 +0000 (14:34 +0000)]
net/mlx5: resize a full counter container

When the counter countainer has no more space to store more counter
pools try to resize the container to allow more pools to be created.

So, the only limitation for the maximum counter number is the memory.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
4 years agonet/mlx5: accelerate DV flow counter transactions
Matan Azrad [Tue, 16 Jul 2019 14:34:53 +0000 (14:34 +0000)]
net/mlx5: accelerate DV flow counter transactions

The DevX interface exposes a new feature to the PMD that can allocate a
batch of counters by one FW command. It can improve the flow
transaction rate (with count action).

Add a new counter pools mechanism to manage HW counters in the PMD.
So, for each flow with counter creation the PMD will try to find a free
counter in the PMD pools container and only if there is no a free
counter, it will allocate a new DevX batch counters.

Currently we cannot support batch counter for a group 0 flow, so
create a 2 container types, one which allocates counters one by
one and one which allocates X counters by the batch feature.

The allocated counters objects are never released back to the HW
assuming the flows maximum number will be close to the actual value of
the flows number.
Later, it can be updated, and dynamic release mechanism can be added.

The counters are contained in pools, each pool with 512 counters.
The pools are contained in counter containers according to the
allocation resolution type - single or batch.
The cache memory of the counters statistics is saved as raw data per
pool.
All the raw data memory is allocated for all the container in one
memory allocation and is managed by counter_stats_mem_mng structure
which registers all the raw memory to the HW.
Each pool points to one raw data structure.

The query operation is in pool resolution which updates all the pool
counter raw data by one operation.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
4 years agonet/ifc: add devargs pointer check
Xiao Wang [Tue, 16 Jul 2019 11:31:07 +0000 (19:31 +0800)]
net/ifc: add devargs pointer check

We need to check devargs pointer before dereference it, if no devargs
specified then this driver just skips the device.

Fixes: 40ef35f4a504 ("net/ifc: detect if VDPA mode is specified")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ena: update version to 2.0.1
Michal Krawczyk [Tue, 16 Jul 2019 11:13:32 +0000 (13:13 +0200)]
net/ena: update version to 2.0.1

In 2.0.1 ENA, there were patches for:
  * assigning NUMA node to the IO queue
    commit 4217cb0b7d2c ("net/ena: fix assigning NUMA node to IO queue")
  * statistics counters (Rx checksum errors and per-queue number of the
    Tx packets)
    commit ef74b5f7b69b ("net/ena: fix Rx checksum errors statistics")
    commit 5673e285a633 ("net/ena: fix Tx statistics")
  * SMP support
    commit 117ba4a60488 ("net/ena: get device info statically")
  * setting Rx checksum support
    commit ef538c1a7f56 ("net/ena: fix checksum feature flag")

Signed-off-by: Michal Krawczyk <mk@semihalf.com>