dpdk.git
4 years agonet/netvsc: handle Tx completions based on burst size
Stephen Hemminger [Tue, 31 Mar 2020 17:14:02 +0000 (10:14 -0700)]
net/netvsc: handle Tx completions based on burst size

If tx_free_thresh is quite low, it is possible that we need to
cleanup based on burst size.

Fixes: fc30efe3a22e ("net/netvsc: change Rx descriptor setup and sizing")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: remove process event optimization
Stephen Hemminger [Tue, 31 Mar 2020 17:14:01 +0000 (10:14 -0700)]
net/netvsc: remove process event optimization

Remove unlocked check for data in receive ring.
This check is not safe because of missing barriers etc.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: fix memory free on device close
Stephen Hemminger [Tue, 31 Mar 2020 17:14:00 +0000 (10:14 -0700)]
net/netvsc: fix memory free on device close

The netvsc PMD was putting the mac address in private data but the
core rte_ethdev doesn't allow that it. It has to be in rte_malloc'd
memory or a message will be printed on shutdown/close.
 EAL: Invalid memory

Fixes: f8279f47dd89 ("net/netvsc: fix crash in secondary process")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: split send buffers from Tx descriptors
Stephen Hemminger [Tue, 31 Mar 2020 17:13:59 +0000 (10:13 -0700)]
net/netvsc: split send buffers from Tx descriptors

The VMBus has reserved transmit area (per device) and transmit
descriptors (per queue). The previous code was always having a 1:1
mapping between send buffers and descriptors.
This can lead to one queue starving another and also buffer bloat.

Change to working more like FreeBSD where there is a pool of transmit
descriptors per queue. If send buffer is not available then no
aggregation happens but the queue can still drain.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: handle Rx packets during multi-channel setup
Stephen Hemminger [Tue, 31 Mar 2020 17:13:58 +0000 (10:13 -0700)]
net/netvsc: handle Rx packets during multi-channel setup

It is possible for a packet to arrive during the configuration
process when setting up multiple queue mode. This would cause
configure to fail; fix by just ignoring receive packets while
waiting for control commands.

Use the receive ring lock to avoid possible races between
oddly behaved applications doing rx_burst and control operations
concurrently.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: propagate descriptor limits from VF
Stephen Hemminger [Tue, 31 Mar 2020 17:13:57 +0000 (10:13 -0700)]
net/netvsc: propagate descriptor limits from VF

If application cares about descriptor limits, the netvsc device
values should reflect those of the VF as well.

Fixes: dc7680e8597c ("net/netvsc: support integrated VF")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agoapp/testpmd: enhance GTP support
Dekel Peled [Wed, 25 Mar 2020 08:12:31 +0000 (10:12 +0200)]
app/testpmd: enhance GTP support

This patch adds CLI option to enter the v_pt_rsv_flags value for GTP
flow pattern item.
It also adds GTP as valid item in raw_encap and raw_decap setting.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/ice: redirect switch rule to new VSI
Beilei Xing [Fri, 3 Apr 2020 04:46:09 +0000 (12:46 +0800)]
net/ice: redirect switch rule to new VSI

After VF reset, VF's VSI number may be changed,
the switch rule which forwards packet to the old
VSI number should be redirected to the new VSI
number.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: enable flow redirect on switch
Beilei Xing [Fri, 3 Apr 2020 04:46:08 +0000 (12:46 +0800)]
net/ice: enable flow redirect on switch

Enable flow redirect on switch, currently only
support VSI redirect.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix input set of VLAN item
Wei Zhao [Fri, 3 Apr 2020 04:46:07 +0000 (12:46 +0800)]
net/ice: fix input set of VLAN item

The input set for inner type of vlan item should
be ICE_INSET_ETHERTYPE, not ICE_INSET_VLAN_OUTER.
This mac vlan filter is also part of DCF switch filter.

Fixes: 47d460d63233 ("net/ice: rework switch filter")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: add more flow support for permission stage
Wei Zhao [Fri, 3 Apr 2020 04:46:06 +0000 (12:46 +0800)]
net/ice: add more flow support for permission stage

This patch add switch filter permission stage support
for more flow pattern in pf only pipeline mode.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: support IPv6 NAT-T
Wei Zhao [Fri, 3 Apr 2020 04:46:05 +0000 (12:46 +0800)]
net/ice: support IPv6 NAT-T

This patch add switch filter support for IPv6 NAT-T packets,
it enable switch filter to direct IPv6 packets with
NAT-T payload to specific action.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: support PFCP
Wei Zhao [Fri, 3 Apr 2020 04:46:04 +0000 (12:46 +0800)]
net/ice: support PFCP

This patch add switch filter support for PFCP packets,
it enable switch filter to direct IPv4/IPv6 packets with
PFCP session or node payload to specific action.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: support ESP/AH/L2TP
Wei Zhao [Fri, 3 Apr 2020 04:46:03 +0000 (12:46 +0800)]
net/ice: support ESP/AH/L2TP

This patch add support for ESP/AH/L2TP packets,
it enable switch filter to direct IPv6 packets with
ESP/AH/L2TP payload to specific action.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: add action number check for switch
Wei Zhao [Fri, 3 Apr 2020 04:46:02 +0000 (12:46 +0800)]
net/ice: add action number check for switch

The action number can only be one for DCF or PF
switch filter, not support multiple actions.

Fixes: 47d460d63233 ("net/ice: rework switch filter")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: change default tunnel type
Wei Zhao [Fri, 3 Apr 2020 04:46:01 +0000 (12:46 +0800)]
net/ice: change default tunnel type

The default tunnel type for switch filter change to new
definition of ICE_SW_TUN_AND_NON_TUN in order that the rule
will be apply to more packet type.

Fixes: 47d460d63233 ("net/ice: rework switch filter")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: support MAC VLAN rule
Wei Zhao [Fri, 3 Apr 2020 04:46:00 +0000 (12:46 +0800)]
net/ice: support MAC VLAN rule

This patch add support for MAC VLAN rule,
it enable switch filter to direct packet base on
mac address and VLAN id.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: change switch parser to support flexible mask
Wei Zhao [Fri, 3 Apr 2020 04:45:59 +0000 (12:45 +0800)]
net/ice: change switch parser to support flexible mask

DCF need to make configuration of flexible mask, that is to say
some input set mask may be not 0xFFFF type all one bit. In order
to direct L2/IP multicast packets, the mask for source IP maybe
0xF0000000, this patch enable switch filter parser for it.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: support more PPPoE input set
Wei Zhao [Fri, 3 Apr 2020 04:45:58 +0000 (12:45 +0800)]
net/ice: support more PPPoE input set

This patch add more support for PPPoE packet,
it enable switch filter to direct PPPoE packet base on
session id and PPP protocol type.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: enable switch flow on DCF
Wei Zhao [Fri, 3 Apr 2020 04:45:57 +0000 (12:45 +0800)]
net/ice: enable switch flow on DCF

DCF on CVL is a control plane VF which take the responsibility to
configure all the PF/global resources, this patch add support DCF
on to program forward rule to direct packets to VFs.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/octeontx2: support custom L2 header
Satheesh Paul [Mon, 6 Apr 2020 06:43:03 +0000 (12:13 +0530)]
net/octeontx2: support custom L2 header

This patch adds SDP packet parsing support with custom L2 header,
adds support to include a field from custom header for flow tag
generation.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: fix device configuration sequence
Pavan Nikhilesh [Sat, 4 Apr 2020 15:19:50 +0000 (20:49 +0530)]
net/octeontx2: fix device configuration sequence

When an application invokes rte_eth_dev_configure consecutively without
setting up Rx/Tx queues, it will incorrectly return error while trying
to restore Rx/Tx queue configuration.

Fix configuration sequence by checking if any Rx/Tx queues are
previously configured before trying to restore them.

Fixes: 548b5839a32b ("net/octeontx2: add device configure operation")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: add TM capability
Krzysztof Kanas [Sun, 5 Apr 2020 21:16:57 +0000 (02:46 +0530)]
net/octeontx2: add TM capability

Add Traffic Management capability callbacks to provide
global, level and node capabilities. This patch also
adds documentation on Traffic Management Support.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: add Tx queue rate limit
Krzysztof Kanas [Fri, 3 Apr 2020 08:52:15 +0000 (14:22 +0530)]
net/octeontx2: add Tx queue rate limit

Add Tx queue ratelimiting support. This support is mutually
exclusive with TM support i.e when TM is configured, tx queue
ratelimiting config is no more valid.

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: support TM debug
Nithin Dabilpuram [Fri, 3 Apr 2020 08:52:14 +0000 (14:22 +0530)]
net/octeontx2: support TM debug

Add debug support to TM to dump configured topology
and registers. Also enable debug dump when sq flush fails.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
4 years agonet/octeontx2: add TM dynamic topology update
Nithin Dabilpuram [Fri, 3 Apr 2020 08:52:13 +0000 (14:22 +0530)]
net/octeontx2: add TM dynamic topology update

Add dynamic parent and shaper update callbacks that
can be used to change RR Quantum or PIR/CIR rate dynamically
post hierarchy commit. Dynamic parent update callback only
supports updating RR quantum of a given child with respect to
its parent. There is no support yet to change priority or parent
itself.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
4 years agonet/octeontx2: add TM stats and shaper profile
Nithin Dabilpuram [Fri, 3 Apr 2020 08:52:12 +0000 (14:22 +0530)]
net/octeontx2: add TM stats and shaper profile

Add TM support for stats read and private shaper
profile addition or deletion.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
4 years agonet/octeontx2: add TM hierarchy commit
Nithin Dabilpuram [Fri, 3 Apr 2020 08:52:11 +0000 (14:22 +0530)]
net/octeontx2: add TM hierarchy commit

Add TM hierarchy commit callback to support enabling
newly created topology.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
4 years agonet/octeontx2: add TM node suspend/resume
Krzysztof Kanas [Fri, 3 Apr 2020 08:52:10 +0000 (14:22 +0530)]
net/octeontx2: add TM node suspend/resume

Add TM support to suspend and resume nodes post hierarchy
commit.

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: support TM node add/delete
Nithin Dabilpuram [Fri, 3 Apr 2020 08:52:09 +0000 (14:22 +0530)]
net/octeontx2: support TM node add/delete

Adds support to Traffic Management callbacks "node_add"
and "node_delete". These callbacks doesn't support
dynamic node addition or deletion post hierarchy commit.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
4 years agonet/octeontx2: support dynamic topology update
Nithin Dabilpuram [Fri, 3 Apr 2020 08:52:08 +0000 (14:22 +0530)]
net/octeontx2: support dynamic topology update

Modify resource allocation and freeing logic to support
dynamic topology commit while to traffic is flowing.
This patch also modifies SQ flush to timeout based on minimum shaper
rate configured. SQ flush is further split to pre/post
functions to adhere to HW spec of 96XX C0.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
4 years agonet/octeontx2: restructure TM helper functions
Nithin Dabilpuram [Fri, 3 Apr 2020 08:52:07 +0000 (14:22 +0530)]
net/octeontx2: restructure TM helper functions

Restructure traffic manager helper function by splitting to
multiple sets of register configurations like shaping, scheduling
and topology config.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
4 years agonet/octeontx2: setup link config based on BP level
Nithin Dabilpuram [Fri, 3 Apr 2020 08:52:06 +0000 (14:22 +0530)]
net/octeontx2: setup link config based on BP level

Configure NIX_AF_TL3_TL2X_LINKX_CFG using schq at
level based on NIX_AF_PSE_CHANNEL_LEVEL[BP_LEVEL].

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
4 years agonet/octeontx2: support configuring link attributes
Harman Kalra [Tue, 31 Mar 2020 16:24:24 +0000 (21:54 +0530)]
net/octeontx2: support configuring link attributes

Adding support to configure link attributes like speed,
duplex, negotiation.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx2: enable error and RAS interrupt in configure
Vamsi Attunuru [Fri, 3 Apr 2020 02:20:16 +0000 (07:50 +0530)]
net/octeontx2: enable error and RAS interrupt in configure

Patch adds routines to set/clear nix lf error & ras interrupt enable
registers. These nix lf error interrupts get triggered if there are
any failures during nix lf configuration. This interrupts are enabled
before any hardware configurations initiated on the allocated nix lf.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Andrzej Ostruszka <aostruszka@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx: support Rx/Tx checksum offload
Harman Kalra [Mon, 16 Mar 2020 09:33:44 +0000 (15:03 +0530)]
net/octeontx: support Rx/Tx checksum offload

This patch implements rx/tx checksum offload. In case of
wrong checksum received (inner/outer l3/l4) it reports the
corresponding layer which has bad checksum and also corrects
it if hw checksum is enabled on tx side.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
4 years agonet/octeontx: support flow control
Vamsi Attunuru [Mon, 16 Mar 2020 09:33:43 +0000 (15:03 +0530)]
net/octeontx: support flow control

Patch adds ethdev flow control set/get callback ops,
pmd enables modifying flow control attributes like
rx_pause, tx_pause, high & low water mark.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
4 years agonet/octeontx: support set link up/down
Harman Kalra [Mon, 16 Mar 2020 09:33:42 +0000 (15:03 +0530)]
net/octeontx: support set link up/down

Adding support for setting link up/down eth operation.
It is used to enable disable lmac.  Also implemented a
poll function for getting the link status at regular
intervals.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
4 years agonet/octeontx: support VLAN filter offload
Vamsi Attunuru [Mon, 16 Mar 2020 09:33:41 +0000 (15:03 +0530)]
net/octeontx: support VLAN filter offload

Patch adds support for vlan filter offload support.
MBOX messages for vlan filter on/off and vlan filter
entry add/rm are added to configure PCAM entries to
filter out the vlan traffic on a given port.

Patch also defines rx_offload_flag for vlan filtering.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
4 years agonet/octeontx: support MTU
Harman Kalra [Mon, 16 Mar 2020 09:33:40 +0000 (15:03 +0530)]
net/octeontx: support MTU

Adding support for mtu eth operation which configures mtu based
on max pkt len.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
4 years agonet/octeontx: support fast mbuf free
Harman Kalra [Mon, 16 Mar 2020 09:33:39 +0000 (15:03 +0530)]
net/octeontx: support fast mbuf free

This patch adds capability to fast release of mbuf
following successful transmission.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
4 years agonet/octeontx: add framework for Rx/Tx offloads
Harman Kalra [Mon, 16 Mar 2020 09:33:38 +0000 (15:03 +0530)]
net/octeontx: add framework for Rx/Tx offloads

Adding macro based framework to hook rx/tx burst function
pointers to the appropriate function based on rx/tx offloads.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
4 years agonet/octeontx: support multi segment
Harman Kalra [Mon, 16 Mar 2020 09:33:37 +0000 (15:03 +0530)]
net/octeontx: support multi segment

Adding multi segment support to the octeontx PMD. Also
adding the logic to share rx/tx ofloads with the eventdev
code.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
4 years agonet/octeontx2: offload bad L2/L3/L4 UDP lengths detection
Kiran Kumar K [Sat, 7 Mar 2020 09:56:53 +0000 (15:26 +0530)]
net/octeontx2: offload bad L2/L3/L4 UDP lengths detection

Octeontx2 HW has support for detecting the bad L2/L3/L4 UDP lengths.
Since DPDK does not have specific error flag for this, exposing it
as bad checksum failure in mbuff:ol_flags to leverage this feature.

These errors will be propagated to the ol_flags as follows.

L2 length error ==> (PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD).
Both Outer and Inner L3 length error ==> PKT_RX_IP_CKSUM_BAD.
Outer L4 UDP length/port error ==> PKT_RX_OUTER_L4_CKSUM_BAD.
Inner L4 UDP length/port error ==> PKT_RX_L4_CKSUM_BAD.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/octeontx: fix meson build for disabled drivers
Amit Gupta [Wed, 4 Mar 2020 05:47:04 +0000 (11:17 +0530)]
net/octeontx: fix meson build for disabled drivers

Add a condition to check if octeontx drivers are disabled.
octeontx drivers are built only if dependent drivers i.e.
ethdev, mempool and common/octeontx are enabled.

Bugzilla ID: 387
Fixes: 7f615033d64f ("drivers/net: build Cavium NIC PMDs with meson")
Cc: stable@dpdk.org
Signed-off-by: Amit Gupta <agupta3@marvell.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
4 years agocommon/octeontx2: upgrade mbox definition to version 5
Nithin Dabilpuram [Fri, 6 Mar 2020 13:44:05 +0000 (19:14 +0530)]
common/octeontx2: upgrade mbox definition to version 5

Sync mail box data structures to version 0x0005 to
that of kernel AF driver.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/tap: remove unused assert
Yunjian Wang [Wed, 25 Mar 2020 03:04:56 +0000 (11:04 +0800)]
net/tap: remove unused assert

The assert checks is not necessary, the gso_ctx is always non-NULL.

Fixes: 050316a88313 ("net/tap: support TSO (TCP Segment Offload)")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/sfc: add Xilinx copyright
Andrew Rybchenko [Mon, 30 Mar 2020 10:27:26 +0000 (11:27 +0100)]
net/sfc: add Xilinx copyright

Xilinx acquired Solarflare in 2019.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: James Fox <jamesfox@xilinx.com>
4 years agonet/sfc: check actual all multicast unknown unicast filters
Igor Romanov [Mon, 30 Mar 2020 10:25:45 +0000 (11:25 +0100)]
net/sfc: check actual all multicast unknown unicast filters

Check that unknown unicast and unknown multicast filters are
applied and return an error if they are not applied. The error
is used in promiscuous and all multicast mode enable and disable
callbacks.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agonet/sfc/base: add API to get currently operating filters
Igor Romanov [Mon, 30 Mar 2020 10:25:44 +0000 (11:25 +0100)]
net/sfc/base: add API to get currently operating filters

Unknown unicast filter creation may fail because of insufficient
permissions on VF. This failure is handled internally in libefx MAC
reconfiguration without any way for a user to know if it happened.
Making the MAC reconfiguration forward error code of filter
reconfiguration would be too destructive to the existing code
that may rely on the function never returning that error.

Add an API for getting the status of current unknown unicast and
all multicast filters since user must know that requested
filters are actually applied.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agonet/sfc/base: refactor multicast filters reconfiguration
Igor Romanov [Mon, 30 Mar 2020 10:25:43 +0000 (11:25 +0100)]
net/sfc/base: refactor multicast filters reconfiguration

Refactor the multicast filter reconfiguration stage of the reconfigure
function to make it clearer and allow for more convenient further
changes.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agonet/sfc/base: refactor unicast filters reconfiguration
Igor Romanov [Mon, 30 Mar 2020 10:25:42 +0000 (11:25 +0100)]
net/sfc/base: refactor unicast filters reconfiguration

Refactor the unicast filter reconfiguration stage of the reconfigure
function to make it clearer and allow for more convenient further
changes.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agonet/sfc/base: refactor filters mark in reconfigure
Igor Romanov [Mon, 30 Mar 2020 10:25:41 +0000 (11:25 +0100)]
net/sfc/base: refactor filters mark in reconfigure

Refactor the filters mark stage of the reconfigure function
to make it clearer and allow for more convenient further changes.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agonet/sfc/base: refactor filters cleanup in reconfigure
Igor Romanov [Mon, 30 Mar 2020 10:25:40 +0000 (11:25 +0100)]
net/sfc/base: refactor filters cleanup in reconfigure

Refactor the filters cleanup stage of the reconfigure function
to make it clearer and allow for more convenient further changes.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agonet/nfb: check array size before access
Martin Spinler [Wed, 1 Apr 2020 06:38:01 +0000 (08:38 +0200)]
net/nfb: check array size before access

The driver wrongly assumed the presence of at least one rxmac in every
firmware and accessed to non-existing unit

Signed-off-by: Martin Spinler <spinler@cesnet.cz>
Acked-by: Jakub Neruda <neruda@netcope.com>
4 years agonet/vmxnet3: support MTU set
Eduard Serra [Wed, 25 Mar 2020 19:18:51 +0000 (12:18 -0700)]
net/vmxnet3: support MTU set

(Picked up from @Charles Myers patch
https://patchwork.dpdk.org/patch/57771/)

When the mtu_set() function is not implemented, rte_eth_dev_set_mtu()
fails with -ENOTSUP and mtu is not stored in the mtu field in the
rte_eth_dev_data.  This causes the mtu in Vmxnet3_MiscConf which is
shared with hypervisor to always be set to 1500.

This may cause issues receiving jumbo frames on Enhanced Data Path
N-VDS.

Signed-off-by: Eduard Serra <eserra@vmware.com>
Acked-by: Yong Wang <yongwang@vmware.com>
4 years agonet/i40e: enable VF to program MAC address
Guinan Sun [Tue, 24 Mar 2020 04:36:46 +0000 (04:36 +0000)]
net/i40e: enable VF to program MAC address

Due to the restriction of the flag I40E_FLAG_VF_MAC_BY_PF,
VF cannot program the MAC address.
In order to solve this inflexibility, the use of I40E_FLAG_VF_MAC_BY_PF
has been deleted in the code implementation to ensure that
VF can flexibly program the MAC address.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: check memory pointer before copying
Haiyue Wang [Tue, 31 Mar 2020 06:50:34 +0000 (14:50 +0800)]
net/ice/base: check memory pointer before copying

The ice_memdup doesn't check the new allocated memory pointer, it calls
the rte_memcpy directly. It should check it.

Fixes: 5f0978e96220 ("net/ice/base: add OS specific implementation")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agodoc: update ixgbe features list
Qi Zhang [Mon, 23 Mar 2020 10:54:31 +0000 (18:54 +0800)]
doc: update ixgbe features list

Remove vector path feature list, if a feature only be supported
in non-vector path, use "P" to represent.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agodoc: update iavf features list
Qi Zhang [Mon, 23 Mar 2020 10:54:30 +0000 (18:54 +0800)]
doc: update iavf features list

Remove vector path feature list, if a feature only be supported
in non-vector path, use "P" to represent.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agodoc: update ice features list
Qi Zhang [Mon, 23 Mar 2020 10:54:29 +0000 (18:54 +0800)]
doc: update ice features list

Remove vector path feature list, if a feature only be supported
in non-vector path, use "P" to represent.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agodoc: update i40e features list
Qi Zhang [Mon, 23 Mar 2020 10:54:28 +0000 (18:54 +0800)]
doc: update i40e features list

Remove vector path feature list, if a feature only be supported
in non-vector path, use "P" to represent.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: enable RSS for PFCP/L2TP/ESP/AH
Qi Zhang [Mon, 30 Mar 2020 11:45:38 +0000 (19:45 +0800)]
net/ice/base: enable RSS for PFCP/L2TP/ESP/AH

Add support for PFCP, L2TP, ESP and AH RSS enabling.

Signed-off-by: Ting Xu <ting.xu@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 binary order for GTPU filter
Qi Zhang [Mon, 30 Mar 2020 11:45:37 +0000 (19:45 +0800)]
net/ice/base: fix binary order for GTPU filter

Take network order for gtpu fdir filter.

Fixes: b5c274f4e2ad ("net/ice/base: support FDIR for GTPU QFI field")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@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: change function to static
Qi Zhang [Mon, 30 Mar 2020 11:45:36 +0000 (19:45 +0800)]
net/ice/base: change function to static

Change ice_set_fd_desc_val to static, since it only be used
internally.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@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 PFCP and NAT-T of switch
Qi Zhang [Mon, 30 Mar 2020 11:45:35 +0000 (19:45 +0800)]
net/ice/base: support PFCP and NAT-T of switch

This patch add support switch rule for PFCP and NAT-T
packet base on profile rule, PFCP and NAT-T packet will not
be matched on any packet fields, but instead matches
the profile that the packet hits in the switch block.

Signed-off-by: Wei Zhao <wei.zhao1@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: move some macros
Qi Zhang [Mon, 30 Mar 2020 11:45:34 +0000 (19:45 +0800)]
net/ice/base: move some macros

Move some macro from ice_switch.c to ice_switch.h. Currently this
is only required by kernel driver, DPDK just to sync the code.

Signed-off-by: Xiao Zhang <xiao.zhang@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: group case statements
Qi Zhang [Mon, 30 Mar 2020 11:45:33 +0000 (19:45 +0800)]
net/ice/base: group case statements

ICE_BLK_FD and ICE_BLK_RSS are executing the same code so group the case
statements together instead of duplicating code for each block.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@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: handle critical FW error
Qi Zhang [Mon, 30 Mar 2020 11:45:32 +0000 (19:45 +0800)]
net/ice/base: handle critical FW error

A race condition between FW and SW can occur between admin queue setup
and the first command sent. A link event may occur and FW attempts to
notify a non-existent queue. FW will set the critical error bit and
disable the queue. When this happens retry queue setup.

Signed-off-by: Evan Swanson <evan.swanson@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: improve GTPU extend header handle
Qi Zhang [Mon, 30 Mar 2020 11:45:31 +0000 (19:45 +0800)]
net/ice/base: improve GTPU extend header handle

A GTPU header can stack with a extend header or not, while
current implementation does not allow HDR bit sets like below:

ICE_FLOW_SEG_HDR_GTPU_IP | ICE_FLOW_SEG_HDR_GTPU_EH
ICE_FLOW_SEG_HDR_GTPU_IP | ICE_FLOW_SEG_HDR_GTPU_UP
ICE_FLOW_SEG_HDR_GTPU_IP | ICE_FLOW_SEG_HDR_GTPU_DWN

Which is not convenient for upper layer flow parser to
generate correct HDR bit.

but it could be if we have below assumptions:

ICE_FLOW_SEG_HDR_GTPU_DWN -- for GTPU with extend header down link
ICE_FLOW_SEG_HDR_GTPU_UP  -- for GTPU with extend header up link
ICE_FLOW_SEG_HDR_GTPU_EH  -- for GTPU with any extend header
ICE_FLOW_SEG_HDR_GTPU_IP  -- for any GTPU header, but when it combined
                             with any above it downgrade to a dummy one.

And handle from specific case to generic case will hit all the cases
as expected.

if else (hdr & ICE_FLOW_SEG_HDR_GTPU_DWN) {
...
} else if (hdr & ICE_FLOW_SEG_HDR_GTPU_UP) {
...
} else if (hdr & ICE_FLOW_SEG_HDR_GTPU_EH) {
...
} else if (hdr & ICE_FLOW_SEG_HDR_GTPU_IP {
...
}

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: allow profile based switch rules
Qi Zhang [Mon, 30 Mar 2020 11:45:30 +0000 (19:45 +0800)]
net/ice/base: allow profile based switch rules

Switch rules usually match packet fields to take actions. Add capability
to add a switch rule that does not match any packet fields, but instead
matches the profile that the packet hits in the switch block.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Wei Zhao <wei.zhao1@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: add default DCB parameters
Qi Zhang [Mon, 30 Mar 2020 11:45:29 +0000 (19:45 +0800)]
net/ice/base: add default DCB parameters

Added new value for cmd_flag:
Persistently set the DCB configuration mode for the current port.
Added new value for valid_flags: represent bit#1 of command flag

Signed-off-by: Sharon Haroni <sharon.haroni@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 adding MAC VLAN filter on port
Qi Zhang [Mon, 30 Mar 2020 11:45:28 +0000 (19:45 +0800)]
net/ice/base: allow adding MAC VLAN filter on port

Add new API function to allow user to choose port
on which mac vlan rule going to be added.

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: refactor flow control function
Qi Zhang [Mon, 30 Mar 2020 11:45:27 +0000 (19:45 +0800)]
net/ice/base: refactor flow control function

We will remove the logic of configuring the flow control out of the
ice_set_fc(...) function. The goal is to enable any driver to combine
all PHY related flow logic, without repeatedly call ice_aq_set_phy_cfg.

Signed-off-by: Chinh T Cao <chinh.t.cao@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: add ethertype check for dummy packet
Qi Zhang [Mon, 30 Mar 2020 11:45:26 +0000 (19:45 +0800)]
net/ice/base: add ethertype check for dummy packet

In order to support switch rule for ethertype filter
with ipv6 ethertype id, it has to check ethertype
then find a proper dummy packet.

Signed-off-by: Wei Zhao <wei.zhao1@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: ignore EMODE when setting PHY config
Qi Zhang [Mon, 30 Mar 2020 11:45:25 +0000 (19:45 +0800)]
net/ice/base: ignore EMODE when setting PHY config

When setting the PHY cfg (CQ cmd 0x0601), if the firmware responds
with an EMODE error, software will ignore the error as it simply
means that manageability (ex: BMC) is in control of the link and that
the new setting may not be applied.

Signed-off-by: Chinh T Cao <chinh.t.cao@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: reduce scope of variables
Qi Zhang [Mon, 30 Mar 2020 11:45:24 +0000 (19:45 +0800)]
net/ice/base: reduce scope of variables

The scope of these variables can be reduced, so do so. This also
eliminates the need for the extra wrapping/braces.

Also, compact a line since it can fit within 80 columns

Signed-off-by: Tony Nguyen <anthony.l.nguyen@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: add more macros for FDID priority
Qi Zhang [Mon, 30 Mar 2020 11:45:23 +0000 (19:45 +0800)]
net/ice/base: add more macros for FDID priority

Add macro for FDID  priority 0 and 3, also adjust the
fdid_prio position to sync with kernel driver.

Signed-off-by: Beilei Xing <beilei.xing@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/mlx5: fix imissed counter overflow
Jiawei Wang [Mon, 30 Mar 2020 03:02:10 +0000 (06:02 +0300)]
net/mlx5: fix imissed counter overflow

The Hw counters is defined as 32bit unsigned value and read from
the sysfs. Firstly read the base value while application start,
then fetch the new value while do query and minus the base value.
If the new value is less than base value, will result in a
negative value and convert to the big value as unsigned 64bit.

PMD add xstats field to store the last successfully read counter,
use it if failed to read hw counter from sysfs.
PMD also record the last output value to handle the wrap around case,
if overflow happened, increase the wrap count by 1 and save into the
higher 32bit, and update the new value into lower 32bit, finally
return the 64bit counter value.

Fixes: ce9494d76c47 ("net/mlx5: report imissed statistics")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: introduce buffer size parameter for hairpin
Bing Zhao [Tue, 24 Mar 2020 12:59:01 +0000 (20:59 +0800)]
net/mlx5: introduce buffer size parameter for hairpin

When creating a hairpin queue, the total data size and the maximal
number of packets are interrelated. The differ is the stride size.
Larger buffer size means big packet like jumbo could be supported,
but in the meanwhile, it will introduce more cache misses and have a
side effect on the performance.
Now a new device parameter "hp_buf_log_sz" is introduced for
applications to set the total data buffer size (the logarithm value).
Then the maximal number of packets will also be calculated
automatically by this value.
Applications could also change this value to a larger one in order
to support larger packets in hairpin case. A smaller value will be
beneficial for memory consumption.
If it is not set, the default value will be used.

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/thunderx: use dynamic log type
Stephen Hemminger [Tue, 31 Mar 2020 04:41:56 +0000 (21:41 -0700)]
net/thunderx: use dynamic log type

The PMD static logtype is original DPDK legacy and should not be used.

Fixes: 43362c6a7647 ("net/thunderx: support RSS and RETA query and update")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/dpaa: use dynamic log type
Stephen Hemminger [Tue, 31 Mar 2020 04:41:55 +0000 (21:41 -0700)]
net/dpaa: use dynamic log type

The static PMD logtype should not be used by drivers.
Instead, use existing log macros in this driver.

Also use standard rte_ether routine to format ether address.

Fixes: 37f9b54bd3cf ("net/dpaa: support Tx and Rx queue setup")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/bnxt: do not use PMD log type
Stephen Hemminger [Tue, 31 Mar 2020 04:41:54 +0000 (21:41 -0700)]
net/bnxt: do not use PMD log type

Accidental use of PMD logtype rather than per-driver logtype.

Fixes: 14255b351537 ("net/bnxt: fix queue start/stop operations")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/pfe: do not use PMD log type
Stephen Hemminger [Tue, 31 Mar 2020 04:41:53 +0000 (21:41 -0700)]
net/pfe: do not use PMD log type

The PMD logtype is a legacy from original DPDK logging.
All drivers must use their own dynamic log type.

Fixes: b1bc1afa4a0e ("net/pfe: support dynamic logging")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/tap: do not use PMD log type
Stephen Hemminger [Tue, 31 Mar 2020 04:41:52 +0000 (21:41 -0700)]
net/tap: do not use PMD log type

The PMD logtype is legacy and drivers should use their own logtype.

Fixes: 050316a88313 ("net/tap: support TSO (TCP Segment Offload)")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/virtio: do not use PMD log type
Stephen Hemminger [Tue, 31 Mar 2020 04:41:51 +0000 (21:41 -0700)]
net/virtio: do not use PMD log type

Virtio driver has its own logtype and should not use legacy
PMD logtype.

Fixes: 32c118fd0059 ("virtio: free mbuf's with threshold")
Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx")
Fixes: 1c8489da561b ("net/virtio-user: fix multi-process support")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mvneta: do not use PMD log type
Stephen Hemminger [Tue, 31 Mar 2020 04:41:50 +0000 (21:41 -0700)]
net/mvneta: do not use PMD log type

The PMD logtype is legacy and should not be used.

Fixes: 3378383dceab ("net/mvneta: support statistics reset")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoexamples/vmdq: fix output of pools/queues
Junyu Jiang [Mon, 2 Mar 2020 06:41:21 +0000 (06:41 +0000)]
examples/vmdq: fix output of pools/queues

To match the pools/queues configuration, the pools/queues output
should start from VMDQ base queue. This patch fixed the issue.

Fixes: 6bb97df521aa ("examples/vmdq: new app")
Cc: stable@dpdk.org
Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Tested-by: Yingya Han <yingyax.han@intel.com>
4 years agonet/ice: support flow ops thread safe
Beilei Xing [Mon, 30 Mar 2020 17:38:53 +0000 (01:38 +0800)]
net/ice: support flow ops thread safe

For DCF, flow ops may be executed in different threads,
so an thread safe option for generic flow APIs is needed.

Signed-off-by: Beilei Xing <beilei.xing@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 flow redirect
Beilei Xing [Mon, 30 Mar 2020 17:38:52 +0000 (01:38 +0800)]
net/ice: support flow redirect

Add a new ops "redirect" to flow engine, it's used to implement the
function that redirect a flow's destination. Currently only support
VSI-Redirect which will be used by DCF for handling VF-VSI mapping
table change.
A new API "ice_flow_redirect" is exposed, current usage is: it could
be called when there's VF-VSI mapping table change caused by VF reset.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agocommon/mlx5: fix RSS key copy to TIR context
Dekel Peled [Sun, 29 Mar 2020 09:18:27 +0000 (12:18 +0300)]
common/mlx5: fix RSS key copy to TIR context

In function mlx5_devx_cmd_create_tir(), the 40 bytes of RSS key are
copied in 10 iterations, 4 bytes each time using the MLX5_SET macro.
As result the RSS key is copied into TIR context in swapped byte order.
This patch fixes the issue, using memcpy() to copy the RSS key as is.
The struct member mlx5_devx_tir_attr.rx_hash_toeplitz_key is updated
to byte array type.

Fixes: c3aea272eed8 ("net/mlx5: create advanced Rx object 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: check device status before creating flow
Bing Zhao [Tue, 24 Mar 2020 15:34:00 +0000 (15:34 +0000)]
net/mlx5: check device status before creating flow

By default, flows are categorized into two types of a mlx5 device.
  1. The PMD driver will create some default flows to enable the
     traffic and give some default behaviors on the packets. And
     this is transparent to the upper layer application.
  2. Other flows will be created in the application based on its
     needs.
When in the old cached mode for application flows, it is allowed
to created the flow before the device is started. And when
starting the device, all the flows will be applied to the hardware
and take effect. The cached flows will be also applied in the same
time.
In non-cached mode, all the flows will never be cached when stopping
a device. So it makes no sense to insert any flow into the device
before it is started. Default flows owned by PMD driver are not
affected in this case.

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: separate the flow handle resource
Bing Zhao [Tue, 24 Mar 2020 15:33:59 +0000 (15:33 +0000)]
net/mlx5: separate the flow handle resource

Only the members of flow handle structure will be used when trying
to destroy a flow. Other members of mlx5 device flow resource will
only be used for flow creating, and they could be reused for different
flows.
So only the device flow handle structure needs to be saved for further
usage. This could be separated from the whole mlx5 device flow and
stored with a list for each rte flow.
Other members will be pre-allocated with an array, and an index will
be used to help to apply each device flow to the hardware.
The flow handle sizes of Verbs and DV mode will be different, and
some calculation could be done before allocating a verbs handle.
Then the total memory consumption will less for Verbs when there is
no inbox driver being used.

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: reorganize flow structures
Bing Zhao [Tue, 24 Mar 2020 15:33:58 +0000 (15:33 +0000)]
net/mlx5: reorganize flow structures

Common structures used for mlx5 flow creating and destroying are
reorganized in order to separating the parts only for destroying
from all the items.
The "mlx5_flow" will contain the common items of DV and Verbs flow,
specific items for DV / Verbs only. These items will only be used
when creating a flow.
At the end of "mlx5_flow", a nested structure "mlx5_flow_handle"
located. It contains all the items used both for creating and
destroying a flow. Also, it consists of common items, and DV / Verbs
specific items.

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: change operations for non-cached flows
Bing Zhao [Tue, 24 Mar 2020 15:33:57 +0000 (15:33 +0000)]
net/mlx5: change operations for non-cached flows

When stopping a mlx5 device, all the flows inserted will be flushed
since they are with non-cached mode. And no more action will be done
for these flows in the device closing stage.
If the device restarts after stopped, no flow with non-cached mode
will be re-inserted.
The flush operation through rte interface will remain the same, and
all the flows will be flushed actively.

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix zero value validation for metadata
Wisam Jaddo [Thu, 26 Mar 2020 10:22:00 +0000 (10:22 +0000)]
net/mlx5: fix zero value validation for metadata

MARK and META items are interrelated with datapath -
they might move from/to the applications in mbuf.

zero value for these items has the special meaning -
it means "no metadata are provided", not zero values
are treated by applications and PMD as valid ones.

Moreover in the flow engine domain the value zero is
acceptable to match and set, and we should allow to
specify zero values as rte_flow parameters for the
META and MARK items and actions. In the same time
zero mask has no meaning and should be rejected
on validation stage.

Fixes: fcc8d2f716fd ("net/mlx5: extend flow metadata support")
Fixes: e554b672aa05 ("net/mlx5: support flow tag")
Fixes: 55deee1715f0 ("net/mlx5: extend flow mark support")
Cc: stable@dpdk.org
Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: fix call to modify action without init item
Asaf Penso [Wed, 25 Mar 2020 19:53:18 +0000 (19:53 +0000)]
net/mlx5: fix call to modify action without init item

The item is being set according to the attribute value, whether it is
udp/tcp or ipv4/6.
Also, there are two condition calls.

If the attribute is neither udp/tcp or ipv4/6 the item is not
initialized at all, but the call to the flow_dv_convert_modify_action is
still being done.
Also, even if the attribute is tcp/udp or ipv4/6, we still have two
conditions.

This patch changes the conditions, so the item will always be set.
By doing this, there is also a save in the number of condition calls.

Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs")
Cc: stable@dpdk.org
Signed-off-by: Asaf Penso <asafp@mellanox.com>
Reviewed-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: update VLAN and encap actions validation
Dekel Peled [Tue, 24 Mar 2020 12:58:11 +0000 (14:58 +0200)]
net/mlx5: update VLAN and encap actions validation

Flow rule in NIC table on VF representor should not contain VLAN pop
or push actions, and encap or decap actions. Using these actions in
NIC table on VF representor is not a valid use case.
This patch updates the various validation functions to reject such
rules.

Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Jack Min <jackmin@mellanox.com>
4 years agonet/mlx5: prefetch CQEs for a faster decompression
Alexander Kozyrev [Tue, 24 Mar 2020 14:45:30 +0000 (16:45 +0200)]
net/mlx5: prefetch CQEs for a faster decompression

Invalidation of consumed CQEs incurs a performance penalty
due to many cache misses caused by a non-sequential CQEs access.
Prefetch CQEs to get a better data locality and speed up the
decompression of CQEs. Prefetching reduces CPI rate of the
rxq_cq_decompress_v() function from 1 to 0.85 in my environment,
resulting in 2% boost in mpps for 64B frames single core test.

Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix metadata for compressed Rx CQEs
Viacheslav Ovsiienko [Tue, 24 Mar 2020 12:15:18 +0000 (12:15 +0000)]
net/mlx5: fix metadata for compressed Rx CQEs

If packets with the same metadata are received with compressed CQE
the metadata value is not copied from the title packet in vectorized
rx_burst routines, it causes wrong metadata values seeing by
applications.

Fixes: a18ac6113331 ("net/mlx5: add metadata support to Rx datapath")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>