dpdk.git
4 years agonet/i40e/base: decouple MIB change event from DCB init
Xiaolong Ye [Mon, 13 Jan 2020 02:39:16 +0000 (10:39 +0800)]
net/i40e/base: decouple MIB change event from DCB init

There is a need to enable MIB change event, not at the same time as
init_dcb. This patch will serve this requirement.

Modify the i40e_init_dcb to return the correct error when LLDP or DCBX
is not in operational state.

Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: fix buffer address
Xiaolong Ye [Mon, 13 Jan 2020 02:39:15 +0000 (10:39 +0800)]
net/i40e/base: fix buffer address

The high 32-bits were being set incorrectly in the 'Set Local LLDP MIB'
AQ command (0x0A08). Change it to use the right macro to get the correct
bits.

Fixes: 1fa6324ad30b ("i40e/base: add new interfaces")
Cc: stable@dpdk.org
Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: increase max VSI count for VFs
Xiaolong Ye [Mon, 13 Jan 2020 02:39:14 +0000 (10:39 +0800)]
net/i40e/base: increase max VSI count for VFs

For historical reasons, we allowed 3 VSIs per VF, but never used more
than one. Now with ADq, we can use up to 4 VSIs per VF, so change this
value to match.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e/base: support NVM feature flags
Xiaolong Ye [Mon, 13 Jan 2020 02:39:13 +0000 (10:39 +0800)]
net/i40e/base: support NVM feature flags

Extend NVM Update API to support reporting of features
available for the tools.

This change is needed by NVM Update to determine if driver
supports changing NVM layout from structured to flat.

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/octeontx2: fix getting supported packet types
Harman Kalra [Thu, 12 Dec 2019 17:58:56 +0000 (17:58 +0000)]
net/octeontx2: fix getting supported packet types

Setting up supported ptypes using testpmd command is failing
because supported_ptypes_get callback will never return ptypes
supported, as NIX_RX_OFFLOAD_PTYPE_F bit in rx_offload_flags
is zero by default in testpmd.

Fixes: d2706e15e6fb ("net/octeontx2: support reduced set of packet types")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/qede: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:52 +0000 (14:51 -0600)]
net/qede: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.

(Not sure if the previous code is checking for true/false condition.
Recommend careful review on this patch.)

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/fm10k: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:51 +0000 (14:51 -0600)]
net/fm10k: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
4 years agonet/e1000: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:50 +0000 (14:51 -0600)]
net/e1000: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/bnx2x: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:49 +0000 (14:51 -0600)]
net/bnx2x: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/vmxnet3: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:48 +0000 (14:51 -0600)]
net/vmxnet3: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.
Remove 'typedef char Bool' and use 'bool' instead.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Yong Wang <yongwang@vmware.com>
4 years agonet/cxgbe: remove local bool type
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:47 +0000 (14:51 -0600)]
net/cxgbe: remove local bool type

Replace 'typedef int bool' with 'stdbool.h' to avoid possible
multiple definitions of 'bool'.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ixgbe: avoid multiple definitions of bool
Dharmik Thakkar [Fri, 10 Jan 2020 20:51:46 +0000 (14:51 -0600)]
net/ixgbe: avoid multiple definitions of bool

Compilation issue arises due to multiple definitions of 'bool'
in 'ixgbe_ethdev.h'.

Error:
'/dpdk/drivers/net/ixgbe/ixgbe_ethdev.c: In function
‘ixgbe_dev_setup_link_alarm_handler’:
/dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:4075:43:
error: passing argument 3 of ‘ixgbe_get_link_capabilities’ from
incompatible pointer type [-Werror=incompatible-pointer-types]
   ixgbe_get_link_capabilities(hw, &speed, &autoneg);
                                           ^
In file included from /dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:41:0:
/dpdk/drivers/net/ixgbe/base/ixgbe_api.h:63:5: note: expected
‘bool * {aka int *}’ but argument is of type ‘_Bool *’'

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/octeontx2: improve performance in vector Rx
Jerin Jacob [Tue, 10 Dec 2019 12:08:44 +0000 (17:38 +0530)]
net/octeontx2: improve performance in vector Rx

Use scalar loads instead of vector loads for fields
that don't need any vector operations.

Signed-off-by: Andrew Pinski <apinski@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
4 years agonet/octeontx2: fix VF configuration
Harman Kalra [Mon, 2 Dec 2019 14:41:15 +0000 (14:41 +0000)]
net/octeontx2: fix VF configuration

Returning -ENOTSUP only in case loopback mode is enabled and
device is VF or SDP.

Fixes: c2c0aa75cd01 ("net/octeontx2: fix loopback config return for VF")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/mlx5: support IPv4/IPv6 DSCP rewrite action
Suanming Mou [Tue, 7 Jan 2020 07:24:02 +0000 (09:24 +0200)]
net/mlx5: support IPv4/IPv6 DSCP rewrite action

This commit add the IPv4/IPv6 DSCP rewrite actions to the PMD code.

Supported actions:
RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP
RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agoethdev: add IPv4/IPv6 DSCP rewrite action
Suanming Mou [Tue, 7 Jan 2020 07:24:01 +0000 (09:24 +0200)]
ethdev: add IPv4/IPv6 DSCP rewrite action

For some overlay network, such as VXLAN, the DSCP field in the new outer
IP header after VXLAN decapsulation may need to be updated accordingly.

This commit introduce the DSCP modify action for IPv4 and IPv6.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agovhost: fix socket initial value
Xiao Wang [Fri, 3 Jan 2020 18:36:21 +0000 (13:36 -0500)]
vhost: fix socket initial value

By default, a vhost socket is created without attaching VDPA device,
this patch fixes the initial value of vdpa_dev_id.

Fixes: b4953225cea4 ("vhost: add APIs for datapath configuration")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
4 years agonet/virtio-user: check file descriptor before closing
Stephen Hemminger [Mon, 6 Jan 2020 19:18:37 +0000 (11:18 -0800)]
net/virtio-user: check file descriptor before closing

Valgrind complains that virtio_user is calling close(-1).
Fix this by adding check in virtio that is similar to existing code.

Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
4 years agonet/vhost: check creation failure
Yunjian Wang [Tue, 7 Jan 2020 03:25:48 +0000 (11:25 +0800)]
net/vhost: check creation failure

The function eth_dev_vhost_create() could return errors,
the return value need to be checked.

Fixes: ee584e9710b9 ("vhost: add driver on top of the library")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
4 years agovhost: add dynamic logging system
Adrian Moreno [Wed, 4 Dec 2019 15:07:29 +0000 (16:07 +0100)]
vhost: add dynamic logging system

Currently there are a couple of limitations on the logging system: Most
of the logs are compiled out and both datapath and controlpath logs
share the same loglevel.

This patch tries to help fix that situation by:
- Splitting control plane and data plane logs
- Making control plane logs dynamic while keeping data plane logs
  compiled out by default for log levels lower than the INFO.

As a result, two macros are introduced:
- VHOST_LOG_CONFIG(LEVEL, ...): Config path logging. Level can be
  dynamically controlled by "lib.vhost.config"

- VHOST_LOG_DATA(LEVEL, ...): Data path logging. Level can be
  dynamically controlled by "lib.vhost.data". Every log macro with a
  level lower than RTE_LOG_DP_LEVEL (which defaults to RTE_LOG_INFO)
  will be compiled out.

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Acked-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agoexamples/vhost_blk: check unused value on init
Jin Yu [Wed, 27 Nov 2019 12:16:58 +0000 (20:16 +0800)]
examples/vhost_blk: check unused value on init

Add the assert to handle error.

Coverity issue: 350592
Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
Cc: stable@dpdk.org
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/af_xdp: fix redundant check for wakeup need
Xiao Wang [Mon, 6 Jan 2020 14:09:40 +0000 (09:09 -0500)]
net/af_xdp: fix redundant check for wakeup need

Function kick_tx() has built-in detection on NEED_WAKEUP flag, so just
call it directly, like elsewhere in the driver.

Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
4 years agonet/axgbe: add xstats
Chandu Babu N [Fri, 20 Dec 2019 12:43:21 +0000 (18:13 +0530)]
net/axgbe: add xstats

Implements eth dev ops xstats_get, xstats_reset, xstats_get_names,
xstats_get_names_by_id, xstats_get_by_id

Signed-off-by: Chandu Babu N <chandu@amd.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
4 years agonet/ena: support Rx offset
Maciej Bielski [Fri, 13 Dec 2019 13:32:16 +0000 (14:32 +0100)]
net/ena: support Rx offset

Allow the data in the first buffer to be shifted by `pkt_offset` after
the header room. The offset value is provided by `ena_rx_ctx`.

As part of this update, the version of the ENA was upgraded to v2.0.3.

Signed-off-by: Maciej Bielski <mba@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
4 years agonet/ena/base: upgrade HAL for new HW features
Michal Krawczyk [Thu, 9 Jan 2020 15:39:12 +0000 (16:39 +0100)]
net/ena/base: upgrade HAL for new HW features

This version of the HAL allows to use the latest HW features, like
rx offsets.

Driver was adjusted to the new version to fix the build.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Signed-off-by: Maciej Bielski <mba@semihalf.com>
4 years agomaintainers: update for flow API
Ori Kam [Sun, 29 Dec 2019 08:56:58 +0000 (08:56 +0000)]
maintainers: update for flow API

I volunteer to be co-maintainer for the rte_flow lib.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ice/base: clean up
Qi Zhang [Mon, 6 Jan 2020 03:38:51 +0000 (11:38 +0800)]
net/ice/base: clean up

Couple minor code clean include:
1. Improve debug message format.
2. Add missing macro and comment.
3. Remove unnecessary compile options.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice: support 1/10G device IDs
Qi Zhang [Mon, 6 Jan 2020 03:38:50 +0000 (11:38 +0800)]
net/ice: support 1/10G device IDs

Add support for 1/10G devices.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: support adding MAC rules on specific port
Qi Zhang [Mon, 6 Jan 2020 03:38:49 +0000 (11:38 +0800)]
net/ice/base: support adding MAC rules on specific port

ice_add_mac_rule allow user to add rule to port based on
hw->port_info->lport number. Function in some case should
allow user to add filter rule on different port, write
another function which implemented that behaviour.
The same situation is which removing mac function.

Add new API function which allow user to choose port on which
rule going to be added. Leave add mac rule function that always
add rule on hw->port_info->lport to avoid changes in components
which don't need to choose different port. Also add function to
remove rule from specific port.

Alloc more switch_info structs to track separately rules for each
port. Choose switch_info struct basing on logic port number
because in FW added rules are connected with port.

Signed-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: rework flow director desc preparation
Qi Zhang [Mon, 6 Jan 2020 03:38:48 +0000 (11:38 +0800)]
net/ice/base: rework flow director desc preparation

Change internal implementation of how FD filter programming desc
is prepared. This is to minimize the amount of code needed to prep
the FD filter programming desc (avoid memcpy, etc...) and just use
predefined shifts and mask. This type of change are needed to expedite
FD setup during data path (ADQ uses this codepath during initial
flow setup) and it will also be useful when adding side-band
flow-director filter.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: increase PF reset wait timeout
Qi Zhang [Mon, 6 Jan 2020 03:38:47 +0000 (11:38 +0800)]
net/ice/base: increase PF reset wait timeout

Increase the maximum time that the driver will wait for a PF reset
from 200 milliseconds to 300 milliseconds, to account for possibility
of a slightly longer than expected PF reset.

Fixes: 453d087ccaff ("net/ice/base: add common functions")
Cc: stable@dpdk.org
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: fix loop limit
Qi Zhang [Mon, 6 Jan 2020 03:38:46 +0000 (11:38 +0800)]
net/ice/base: fix loop limit

In ice_prot_type_to_id routine, correct the loop limit check
to use ARRAY_SIZE instead of looking for the array element to
have a specific value.

Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")
Cc: stable@dpdk.org
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: enable clearing of HW tables
Qi Zhang [Mon, 6 Jan 2020 03:38:45 +0000 (11:38 +0800)]
net/ice/base: enable clearing of HW tables

Enable the code to clear the HW tables.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: allow flexbytes matching on header
Qi Zhang [Mon, 6 Jan 2020 03:38:44 +0000 (11:38 +0800)]
net/ice/base: allow flexbytes matching on header

Change the extraction sequence generated by flow director flexbytes to
use package mac protocol. Without this change data in packet headers
cannot be used for flexbyte matching. The old extraction for flex bytes
started at the beginning of the payload which is after the header.

Signed-off-by: Henry Tieman <henry.w.tieman@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: cleanup format of static const declarations
Qi Zhang [Mon, 6 Jan 2020 03:38:43 +0000 (11:38 +0800)]
net/ice/base: cleanup format of static const declarations

Use a format consistent with the rest of the code.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: do not wait for PE unit to load
Qi Zhang [Mon, 6 Jan 2020 03:38:42 +0000 (11:38 +0800)]
net/ice/base: do not wait for PE unit to load

When RDMA is not enabled, when checking for completion of a CORER or
GLOBR do not wait for the PE unit to be loaded (indicated by GLNVM_ULD
register's PE_DONE bit being set) since that does not happen and will
cause issues such as failing to initialize the device.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: support MAC/VLAN with TCP/UDP in switch
Qi Zhang [Mon, 6 Jan 2020 03:38:41 +0000 (11:38 +0800)]
net/ice/base: support MAC/VLAN with TCP/UDP in switch

Add a feature to allow user to add switch filter using input like
MAC + VLAN (C-tag only) + L4 (TCP/UDP) port. API "ice_add_adv_rule"
is extended to handle this filter type.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: whitelist register for NVM access
Qi Zhang [Mon, 6 Jan 2020 03:38:40 +0000 (11:38 +0800)]
net/ice/base: whitelist register for NVM access

Allow tools to access register offset 0xB8188 (GLGEN_RSTAT) for
NVMUpdate operations.  This is a read-only register, so risk of other
issues stemming from this change is low. Even so, update the write
command to prevent and reject any commands which attempt to write to
this register, just like we do for GL_HICR_EN.

Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agoapp/testpmd: call cleanup on exit
Stephen Hemminger [Tue, 7 Jan 2020 18:59:42 +0000 (10:59 -0800)]
app/testpmd: call cleanup on exit

The rte_eal_cleanup code is not exercised by testpmd which
is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can
be checked with tools like valgrind.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
4 years agonet/hns3: remove unused constants
Hao Chen [Sat, 21 Dec 2019 10:32:53 +0000 (18:32 +0800)]
net/hns3: remove unused constants

This patch removed some unused macros defined in hns3_rss.h,
these macros are used to set tuples for abandoned RTE_ETH_FILTER_HASH
in hns3_dev_filter_ctrl().

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: remove unnecessary assignments in Tx
Wei Hu (Xavier) [Sat, 21 Dec 2019 10:32:52 +0000 (18:32 +0800)]
net/hns3: remove unnecessary assignments in Tx

This patch removes the unnecessary assignment in the '.tx_pkt_burst' ops
implementation function to avoid performance loss.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
4 years agonet/hns3: remove useless variable initializations
Wei Hu (Xavier) [Sat, 21 Dec 2019 10:32:51 +0000 (18:32 +0800)]
net/hns3: remove useless variable initializations

This patch removes the redundant initialization of the variable
named ret.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: remove redundant stats reset
Hao Chen [Sat, 21 Dec 2019 10:32:50 +0000 (18:32 +0800)]
net/hns3: remove redundant stats reset

This patch removes the redundant statement calling hns3_stats_reset()
to clear statistical information explicitly in the initialization of
VF device, because hardware has been reset by FLR in the initialization
and the initial hardware and software statistics values are 0.

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: optimize default RSS algorithm
Hao Chen [Sat, 21 Dec 2019 10:32:49 +0000 (18:32 +0800)]
net/hns3: optimize default RSS algorithm

This patch changed the default algorithm of RSS from simle_xor to
toeplitz because toeplitz is used more frequently by upper applications
such as ceph.

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: remove custom macro for minimum length
Huisong Li [Sat, 21 Dec 2019 10:32:48 +0000 (18:32 +0800)]
net/hns3: remove custom macro for minimum length

This patch replaces custom macro named HNS3_MIN_FRAME_LEN for ethernet
minimum frame length with the macro named RTE_ETHER_MIN_LEN that defined
in DPDK framework.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: modify return value of enable MSI-X
Wei Hu (Xavier) [Sat, 21 Dec 2019 10:32:47 +0000 (18:32 +0800)]
net/hns3: modify return value of enable MSI-X

This patch replaces the return value "-1" with "-ENXIO".

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: get link state change through mailbox
Hongbo Zheng [Sat, 21 Dec 2019 10:32:46 +0000 (18:32 +0800)]
net/hns3: get link state change through mailbox

Currently, firmware adds the function of sending message to PF driver
through mailbox when the link status is changed, hns3 PMD driver can
usually recognize link state change faster through the message.

And in some extreme cases, this way is not faster than existing method
regularly updating link status by issuing the command every second in PF
driver, because of the parallel processing of mailbox and command
messages in firmware. So we reserve updating link status using timers in
PF driver, and add querying link status by issuing command to the
firmware in '.link_update' ops implementation function named
hns3_dev_link_update to solve the out of date link status.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
4 years agonet/hns3: support Rx interrupt
Hao Chen [Sat, 21 Dec 2019 10:32:45 +0000 (18:32 +0800)]
net/hns3: support Rx interrupt

This patch adds supports of receive packets through interrupt mode for
hns3 PF/VF driver. The following ops functions should be implemented
defined in the struct eth_dev_ops:
rx_queue_intr_enable
rx_queue_intr_disable

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/mlx5: fix crash when meter action conf is null
Tonghao Zhang [Fri, 13 Dec 2019 14:21:34 +0000 (22:21 +0800)]
net/mlx5: fix crash when meter action conf is null

When offloading the meter, should check the action
conf and make sure it is valid.

Fixes: f46bf7488705 ("net/mlx5: support meter flow action")
Cc: stable@dpdk.org
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-by: Suanming Mou <suanmingm@mellanox.com>
4 years agonet/bnxt: fix overwriting error message
Ajit Khaparde [Sat, 21 Dec 2019 02:42:18 +0000 (18:42 -0800)]
net/bnxt: fix overwriting error message

In some cases when flow creation fails, we overwrite the specific
error message with a generic error message. This patch fixes it.

Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
4 years agonet/bnxt: support flow mark action
Ajit Khaparde [Sat, 21 Dec 2019 02:38:49 +0000 (18:38 -0800)]
net/bnxt: support flow mark action

Add support for RTE_FLOW_ACTION_TYPE_MARK.
Use the flow_id provided by FW during flow creation to lookup the
mark id provided by the application.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
4 years agonet/bnxt: fix reusing L2 filter
Somnath Kotur [Sat, 21 Dec 2019 02:29:41 +0000 (18:29 -0800)]
net/bnxt: fix reusing L2 filter

The software L2 filter was being released back to the free pool,
though it was created in HW and the filter corresponding to an actual
'flow' would have reference to the HW L2 filter.
But if this 'flow were to be deleted, then this HW L2 filter also
would be gone.
Fix this by storing the L2 filter created originally either for an
n-tuple flow or otherwise as part of the vnic's filter list.
This would require the filter_info struct to have a backptr to the
vnic which it came from.
Now that L2 filters can be re-used for an n-tuple filter(s), delete
L2 filter as well so the reference count of an L2 filter (if reused)
can be decremented appropriately.

Fixes: 5c1171c97216 ("net/bnxt: refactor filter/flow")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix non matching flow hitting filter rule
Santoshkumar Karanappa Rastapur [Sat, 21 Dec 2019 02:29:40 +0000 (18:29 -0800)]
net/bnxt: fix non matching flow hitting filter rule

As part of ntuple filter, we were creating L2 filter with the ntuple
redirect queue resulting in any L2 matching flow getting steered to
this queue. For ntuple filters, we need to create the L2 filter with
default queue. The user specified redirect queue will be set while
creating the ntuple filter in hardware.

Fixes: 5c1171c97216 ("net/bnxt: refactor filter/flow")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix flow flush to sync with flow destroy
Somnath Kotur [Sat, 21 Dec 2019 02:29:39 +0000 (18:29 -0800)]
net/bnxt: fix flow flush to sync with flow destroy

Sync flow flush routine with flow destroy so that the operations
performed per flow during a flush are the same as that are done for an
individual flow destroy by having a common function to call for both.
One of the things that was missed in the flow flush routine was the
deletion of the L2 filter that would have been created as part of an
n-tuple filter.
Also, decrement the l2_ref_cnt for a filter in the case of a filter
update as it would've bumped up previously in validate_and_parse_flow()

Fixes: 89278c59d97c ("net/bnxt: fix flow flush handling")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
4 years agonet/bnxt: fix Tx queue profile selection
Somnath Kotur [Sat, 21 Dec 2019 02:29:37 +0000 (18:29 -0800)]
net/bnxt: fix Tx queue profile selection

In the case when CoS classification is disabled, driver was iterating
looking for only lossy profiles as that is what is expected to be used
for regular NIC operations. But in certain custom profiles, there were
no lossy profiles configured, only lossless profiles instead.
To handle such cases, it is better to fallback to using the first valid
profile.

Fixes: 698aa7e95325 ("net/bnxt: add code to determine the Tx COS queue")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix link during port toggle
Santoshkumar Karanappa Rastapur [Sat, 21 Dec 2019 02:29:35 +0000 (18:29 -0800)]
net/bnxt: fix link during port toggle

We need to wait for up to 500ms to receive async event notification
after forcing link down. Similarly we need to wait for up to 10s for
link to come up after configuring the hardware for link up.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/ixgbe: set fixed flag for exact link speed
Guinan Sun [Tue, 3 Dec 2019 16:59:28 +0000 (16:59 +0000)]
net/ixgbe: set fixed flag for exact link speed

Setting exact link speed makes sense if auto-negotiation is
disabled. Fixed flag is required to disable auto-negotiation.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Ting Xu <ting.xu@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/i40e: set fixed flag for exact link speed
Guinan Sun [Tue, 3 Dec 2019 16:59:27 +0000 (16:59 +0000)]
net/i40e: set fixed flag for exact link speed

Setting exact link speed makes sense if auto-negotiation is
disabled. Fixed flag is required to disable auto-negotiation.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Ting Xu <ting.xu@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/i40e: fix Tx when TSO is enabled
Xiaoyun Li [Thu, 26 Dec 2019 06:45:44 +0000 (14:45 +0800)]
net/i40e: fix Tx when TSO is enabled

Hardware limits that max buffer size per tx descriptor should be
(16K-1)B. So when TSO enabled, the mbuf data size may exceed the
limit and cause malicious behavior to the NIC. This patch fixes
this issue by using more tx descs for this kind of large buffer.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
4 years agonet/iavf: fix virtual channel return
Yahui Cao [Tue, 24 Dec 2019 04:13:13 +0000 (12:13 +0800)]
net/iavf: fix virtual channel return

In iavf_handle_virtchnl_msg(), it is not appropriate for _clear_cmd()
to be used as a notification to foreground thread. So introduce
_notify_cmd() to fix this error. In addition, since _notify_cmd()
contains rte_wmb(), rte_compiler_barrier() is not necessary.

Sending msg from VF to PF is mainly by calling iavf_execute_vf_cmd(),
the whole virtchnl msg process is like,

iavf_execute_vf_cmd() will call iavf_aq_send_msg_to_pf() to send
msg and then polling the cmd done flag as "if (vf->pend_cmd ==
VIRTCHNL_OP_UNKNOWN)"

When reply msg is returned by pf, iavf_handle_virtchnl_msg() in
isr will read msg return value by "vf->cmd_retval = msg_ret" and
immediately set the cmd done flag by calling _clear_cmd() to
notify the iavf_execute_vf_cmd().

iavf_execute_vf_cmd() find the cmd done flag is set and then
check whether command return value vf->cmd_retval is success or
not.

However _clear_cmd() also resets the vf->cmd_retval to success,
overwriting the actual return value which is used for diagnosis.
So iavf_execute_vf_cmd() will always find vf->cmd_retval is
success and then return success.

Fixes: 22b123a36d07 ("net/avf: initialize PMD")
Cc: stable@dpdk.org
Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ipn3ke: fix line side statistics register read
Andy Pei [Tue, 31 Dec 2019 06:53:47 +0000 (14:53 +0800)]
net/ipn3ke: fix line side statistics register read

To read line side statistics register, eth_group_sel
args in function ipn3ke_indirect_mac_read should be 0.
When eth_group_sel is 1, the nic side register is read.

Fixes: 5a6d883878db ("net/ipn3ke: implement statistics")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
4 years agonet/ice: fix VSI context
Beilei Xing [Sat, 14 Dec 2019 06:14:17 +0000 (14:14 +0800)]
net/ice: fix VSI context

There'll always be a MDD event triggered when adding
a FDIR rule. The root cause is 'LAN enable' is not
configured during control VSI setup.
Besides, correct FDIR fields for both main VSI and
control VSI.

Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
4 years agonet/iavf/base: update version info
Qi Zhang [Tue, 3 Dec 2019 07:03:18 +0000 (15:03 +0800)]
net/iavf/base: update version info

Update base code version info in readme.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf: move device state flag
Qi Zhang [Tue, 3 Dec 2019 07:03:17 +0000 (15:03 +0800)]
net/iavf: move device state flag

Move device state flag from ice_hw to ice_adapter since it should
not be a part of base code.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: fix adminq return
Qi Zhang [Tue, 3 Dec 2019 07:03:16 +0000 (15:03 +0800)]
net/iavf/base: fix adminq return

When send a adminq, if get IAVF_AQ_RC_BUSY, we should return
IAVF_ERR_NOT_READY.

Fixes: e5b2a9e957e7 ("net/avf/base: add base code for avf PMD")
Cc: stable@dpdk.org
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: update copyright date
Qi Zhang [Tue, 3 Dec 2019 07:03:15 +0000 (15:03 +0800)]
net/iavf/base: update copyright date

Update copyright date to cover 2019.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: support more link speeds
Qi Zhang [Tue, 3 Dec 2019 07:03:14 +0000 (15:03 +0800)]
net/iavf/base: support more link speeds

Add 2.5G and 5G link speed support.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: update FW API version for X722
Qi Zhang [Tue, 3 Dec 2019 07:03:13 +0000 (15:03 +0800)]
net/iavf/base: update FW API version for X722

Update FW API version from 1.5 to 1.6 for X722
Also added NVM update related APIs.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: fix command buffer memory leak
Qi Zhang [Tue, 3 Dec 2019 07:03:12 +0000 (15:03 +0800)]
net/iavf/base: fix command buffer memory leak

Allocated resources were not freed in the event of failure in
iavf_init_asq function. This patch gracefully handles all failures.

Fixes: e5b2a9e957e7 ("net/avf/base: add base code for avf PMD")
Cc: stable@dpdk.org
Signed-off-by: Pandi Kumar Maharajan <pandi.maharajan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: increase max VSI count for VFs
Qi Zhang [Tue, 3 Dec 2019 07:03:11 +0000 (15:03 +0800)]
net/iavf/base: increase max VSI count for VFs

Change max VSI per VF from 3 to 4.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: adjust indentation
Qi Zhang [Tue, 3 Dec 2019 07:03:10 +0000 (15:03 +0800)]
net/iavf/base: adjust indentation

Adjust the indent in function and macro definition.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: update virtual channel
Qi Zhang [Tue, 3 Dec 2019 07:03:09 +0000 (15:03 +0800)]
net/iavf/base: update virtual channel

Update virtual channel API to align with latest spec.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: rename functions
Qi Zhang [Tue, 3 Dec 2019 07:03:08 +0000 (15:03 +0800)]
net/iavf/base: rename functions

Rename iavf_parse_hw_config to iavf_vf_parse_hw_config.
Rename iavf_reset to iavf_vf_reset.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: remove unnecessary compile option
Qi Zhang [Tue, 3 Dec 2019 07:03:07 +0000 (15:03 +0800)]
net/iavf/base: remove unnecessary compile option

Remove compile option INTEGRATED_VF.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: remove unused code
Qi Zhang [Tue, 3 Dec 2019 07:03:06 +0000 (15:03 +0800)]
net/iavf/base: remove unused code

Remove unused APIs in iavf_prototype.h, iavf_adminq_cmd.h
iavf_type.h, iavf_adminq.h and iavf_common.c

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: update device IDs
Qi Zhang [Tue, 3 Dec 2019 07:03:05 +0000 (15:03 +0800)]
net/iavf/base: update device IDs

Add all supported device id.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: rename register macro
Qi Zhang [Tue, 3 Dec 2019 07:03:04 +0000 (15:03 +0800)]
net/iavf/base: rename register macro

Rename all register macro to align with kernel driver's implementation.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: rename error code enum
Qi Zhang [Tue, 3 Dec 2019 07:03:03 +0000 (15:03 +0800)]
net/iavf/base: rename error code enum

Rename iavf_status_code to iavf_status to align with kernel
driver's implementation.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/iavf/base: remove unnecessary header file
Qi Zhang [Tue, 3 Dec 2019 07:03:02 +0000 (15:03 +0800)]
net/iavf/base: remove unnecessary header file

Delete iavf_hmc.h and iavf_lan_hmc.h since its not necessary.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ixgbe: support VF MAC address add/remove
Guinan Sun [Tue, 24 Dec 2019 03:23:57 +0000 (03:23 +0000)]
net/ixgbe: support VF MAC address add/remove

Ixgbe PMD PF host code needs to support ixgbevf MAC address
add and remove. For this purpose, a response was added
between PF and VF to update the MAC address.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/i40e: enable multi-queue Rx interrupt for VF
Lunyuan Cui [Tue, 3 Dec 2019 11:43:39 +0000 (11:43 +0000)]
net/i40e: enable multi-queue Rx interrupt for VF

Current implementation is that only one Rx queue can support interrupt,
because all queues are mapped in the same vector id in
vfio_enable_msix(). So VF can not support multi-queue Rx interrupt in
the interrupt mode.

In this patch, if the packet I/O interrupt on datapath is enabled
(rte_intr_dp_is_en(intr_handle) is true), we map different interrupt
vectors to each queue and send this map to PF. After PF sets the map to
the register, all Rx queue interrupts will be received.

In addition, vector id should less than the maximum vector value. When
queue number is more than vector value, we set up a loop of interrupt
vectors map.

Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agoethdev: fix flow API doxygen comment
Stephen Hemminger [Wed, 18 Dec 2019 01:12:40 +0000 (17:12 -0800)]
ethdev: fix flow API doxygen comment

Missing asterisk so that comment is not seen by doxygen.

Fixes: 9a2f44c76207 ("ethdev: add flow tag")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/ixgbe: enable jumbo frame for VF
Junyu Jiang [Mon, 2 Dec 2019 20:03:27 +0000 (20:03 +0000)]
net/ixgbe: enable jumbo frame for VF

Enable jumbo frame for VF by configuring DPDK PF.

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ice: add device IDs for C822N
Ting Xu [Wed, 18 Dec 2019 12:41:58 +0000 (12:41 +0000)]
net/ice: add device IDs for C822N

This patch added new device IDs for C822N.

Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/mlx5: fix item flag on GENEVE item validation
Dekel Peled [Wed, 18 Dec 2019 15:09:55 +0000 (17:09 +0200)]
net/mlx5: fix item flag on GENEVE item validation

On validation of GENEVE item, the wrong flag is used.
This patch sets the correct bit in item_flags bitmap.

Fixes: e59a5dbcfd07 ("net/mlx5: add flow match on GENEVE item")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: support RSS on src or dst fields only
Dekel Peled [Wed, 18 Dec 2019 10:05:47 +0000 (12:05 +0200)]
net/mlx5: support RSS on src or dst fields only

This patch implements the feature described in RFC [1], adding
support of RSS action on L3 and/or L4 source or destination only.

[1] http://mails.dpdk.org/archives/dev/2019-December/152796.html

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix setting of Rx hash fields
Dekel Peled [Wed, 18 Dec 2019 10:05:46 +0000 (12:05 +0200)]
net/mlx5: fix setting of Rx hash fields

Rx hash fields were copied from input parameter into TIR attributes
directly, with no translation. As result the copied value was wrong.

This patch adds translation of value from input bitmap to the
appropriate format.

Fixes: dc9ceff73c99 ("net/mlx5: create advanced RxQ via DevX")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: add define of LRO segment chunk size
Dekel Peled [Wed, 18 Dec 2019 07:51:39 +0000 (09:51 +0200)]
net/mlx5: add define of LRO segment chunk size

Maximal size of coalesced LRO segment is set in TIR attributes as
number of chunks of size 256 bytes each.
Current implementation uses the hardcoded value 256 in several places.

This patch adds a definition for this value, and uses this definition
in all relevant places.
A debug message is added to clearly notify the actual configured size.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: remove redundant define of LRO masks
Dekel Peled [Wed, 18 Dec 2019 07:49:36 +0000 (09:49 +0200)]
net/mlx5: remove redundant define of LRO masks

Bit-masks MLX5_FLOW_LAYER_IPV4_LRO and MLX5_FLOW_LAYER_IPV6_LRO were
added during work on LRO.
They are not used anywhere in current code.

This patch removes these redundant definitions.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/bnxt: add a field for FW capabilities
Kalesh AP [Tue, 10 Dec 2019 15:05:29 +0000 (20:35 +0530)]
net/bnxt: add a field for FW capabilities

The purpose of this patch is used to add a new field "fw_cap"
in bnxt structure. The new "fw_cap" field store all the capabilities
reported by the FW. This information will help us to determine
the device capabilities when registering feature support with FW.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: reset filter indices on free
Kalesh AP [Tue, 10 Dec 2019 15:05:28 +0000 (20:35 +0530)]
net/bnxt: reset filter indices on free

Fix bnxt_free_filter() to ensure that the filter indices
are reset correctly when a filter is freed.

This change helps in avoiding few duplicate code as well.

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: remove unnecessary macro for unused variables
Kalesh AP [Tue, 10 Dec 2019 15:05:27 +0000 (20:35 +0530)]
net/bnxt: remove unnecessary macro for unused variables

Remove "__rte_unused" instances that are not required.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: fix request for hot reset support
Kalesh AP [Tue, 10 Dec 2019 15:05:26 +0000 (20:35 +0530)]
net/bnxt: fix request for hot reset support

During the registration process, the drivers must publish
"HOT_RESET_SUPPORTED" capability to the core firmware only
if core firmware is capable of Hot Reset.

Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")
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>
4 years agonet/bnxt: restore VLAN filters during reset recovery
Kalesh AP [Tue, 10 Dec 2019 15:05:25 +0000 (20:35 +0530)]
net/bnxt: restore VLAN filters during reset recovery

Older Firmware could have state information such as
MAC Filters, VLAN settings etc configured by user.
But new Firmware is unaware of this state information
and as a result driver should restore these settings
during reset recovery.

This patch restores the user configured vlan settings
prior to hot FW upgrade or FW error.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: restore MAC filters during reset recovery
Kalesh AP [Tue, 10 Dec 2019 15:05:24 +0000 (20:35 +0530)]
net/bnxt: restore MAC filters during reset recovery

Older Firmware could have state information such as
MAC Filters, VLAN settings etc configured by user.
But new Firmware is unaware of this state information
and as a result driver should restore these settings
during reset recovery.

This patch restores the user configured mac addresses
prior to hot FW upgrade or FW error.

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/mlx5: fix multiple flow table hash list
Xiaoyu Min [Mon, 16 Dec 2019 09:27:41 +0000 (11:27 +0200)]
net/mlx5: fix multiple flow table hash list

The eth devices which share one ibv device only need one hash list of
flow table.

Currently, flow table hash list is created per each eth device
whatever whether they share one ibv device or not.

If the devices share one ibv device, the previously created hash list
will become dangle because the pointer point to (sh->flow_tbls) is
overwritten by the later created hast list.

To fix this, just don't create hash list if it is already created.

Fixes: 54534725d2f3 ("net/mlx5: fix flow table hash list conversion")
Cc: stable@dpdk.org
Reported-by: Zhike Wang <wangzhike@jd.com>
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: clean up redundant assignment
Tonghao Zhang [Wed, 27 Nov 2019 14:18:42 +0000 (22:18 +0800)]
net/mlx5: clean up redundant assignment

The type of txq has been assigned in mlx5_txq_hairpin_new.

Fixes: ae18a1ae9692 ("net/mlx5: support Tx hairpin queues")
Cc: stable@dpdk.org
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/mlx5: fix crash when setting hairpin queues
Tonghao Zhang [Wed, 27 Nov 2019 14:18:41 +0000 (22:18 +0800)]
net/mlx5: fix crash when setting hairpin queues

If configuring the number of tx/rx queue with rte_eth_dev_configure
to nr_queues + hairpin_nr_queues, and setting tx/rx queues to
nr_queues with rte_eth_tx/rx_queue_setup. But not configuring the
hairpin queues via rte_eth_tx/rx_hairpin_queue_setup.

When starting the netdev, there is a crash because of NULL accessing.

Fixes: cf5516696d77 ("ethdev: add hairpin queue")
Cc: stable@dpdk.org
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/i40e: re-program promiscuous mode on VF interface
Eelco Chaudron [Tue, 19 Nov 2019 13:45:21 +0000 (08:45 -0500)]
net/i40e: re-program promiscuous mode on VF interface

During a kernel PF reset, this event is propagated to the VF.
The DPDK VF PMD will execute the reset task before the PF is done
with his. This results in the admin queue message not being responded
to leaving the port in "promiscuous" mode.

This patch makes sure the promiscuous mode is configured independently
of the current admin state.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Reviewed-by: Xiao Zhang <xiao.zhang@intel.com>
4 years agonet/ixgbe: fix link up in FreeBSD
Lunyuan Cui [Mon, 16 Dec 2019 02:24:18 +0000 (02:24 +0000)]
net/ixgbe: fix link up in FreeBSD

In FreeBSD environment, nic_uio drivers do not support interrupts,
rte_intr_callback_register() will fail to register interrupts.
We cannot make link status to change from down to up by interrupt
callback. So we need to wait for the controller to acquire link
when ports start. Through multiple tests, 5s should be enough.

Fixes: b9bd0f09fa15 ("ethdev: fix link status query")
Cc: stable@dpdk.org
Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>