dpdk.git
6 years agoexamples/ip_pipeline: add symmetric crypto example
Fan Zhang [Fri, 28 Sep 2018 12:26:14 +0000 (13:26 +0100)]
examples/ip_pipeline: add symmetric crypto example

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoexamples/ip_pipeline: add CLI for symmetric crypto
Fan Zhang [Fri, 28 Sep 2018 12:26:13 +0000 (13:26 +0100)]
examples/ip_pipeline: add CLI for symmetric crypto

This patch updates the cli parsing of ip_pipeline application
with extra symmetric crypto, port, session, and action support.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoexamples/ip_pipeline: support symmetric crypto action
Fan Zhang [Fri, 28 Sep 2018 12:26:12 +0000 (13:26 +0100)]
examples/ip_pipeline: support symmetric crypto action

This patch adds symmetric crypto action support to ip_pipeline
application.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoexamples/ip_pipeline: configure crypto port
Fan Zhang [Fri, 28 Sep 2018 12:26:11 +0000 (13:26 +0100)]
examples/ip_pipeline: configure crypto port

This patch adds symmetric crypto port configuration to ip_pipeline
sample application.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoexamples/ip_pipeline: add cryptodev
Fan Zhang [Fri, 28 Sep 2018 12:26:10 +0000 (13:26 +0100)]
examples/ip_pipeline: add cryptodev

This patch adds symmetric crypto device abstraction to ip_pipeline
sameple application.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agopipeline: add symmetric crypto table action
Fan Zhang [Fri, 28 Sep 2018 12:26:09 +0000 (13:26 +0100)]
pipeline: add symmetric crypto table action

This patch adds the symmetric crypto action support to pipeline
library. The symmetric crypto action works as the shim layer
between pipeline and DPDK cryptodev and is able to interact with
cryptodev with the control path requests such as session
creation/deletion and data path work to assemble the crypto
operations for received packets.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoport: add symmetric crypto
Fan Zhang [Mon, 1 Oct 2018 10:02:23 +0000 (11:02 +0100)]
port: add symmetric crypto

This patch adds the symmetric crypto support to port library.
The crypto port acts as a shim layer to DPDK cryptodev library and
supports in-place crypto workload processing.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agonet/softnic: support flow meter action
Jasvinder Singh [Wed, 26 Sep 2018 13:08:54 +0000 (14:08 +0100)]
net/softnic: support flow meter action

Implement flow rules with meter action.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: read meter statistics
Jasvinder Singh [Wed, 26 Sep 2018 13:08:53 +0000 (14:08 +0100)]
net/softnic: read meter statistics

Implement meter object stats read function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: update policer actions
Jasvinder Singh [Wed, 26 Sep 2018 13:08:52 +0000 (14:08 +0100)]
net/softnic: update policer actions

Implement meter object policer actions function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: update DSCP table
Jasvinder Singh [Wed, 26 Sep 2018 13:08:51 +0000 (14:08 +0100)]
net/softnic: update DSCP table

Implement meter object dscp table update.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: update meter profile
Jasvinder Singh [Wed, 26 Sep 2018 13:08:50 +0000 (14:08 +0100)]
net/softnic: update meter profile

Implement meter profile update function

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: destroy meter object
Jasvinder Singh [Wed, 26 Sep 2018 13:08:49 +0000 (14:08 +0100)]
net/softnic: destroy meter object

Implement meter object destroy function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: create meter object
Jasvinder Singh [Wed, 26 Sep 2018 13:08:48 +0000 (14:08 +0100)]
net/softnic: create meter object

implement meter object create function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: delete meter profile
Jasvinder Singh [Wed, 26 Sep 2018 13:08:47 +0000 (14:08 +0100)]
net/softnic: delete meter profile

Implement meter profile delete function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add meter profile
Jasvinder Singh [Wed, 26 Sep 2018 13:08:46 +0000 (14:08 +0100)]
net/softnic: add meter profile

Implement meter profile add function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: support metering and policing
Jasvinder Singh [Wed, 26 Sep 2018 13:08:45 +0000 (14:08 +0100)]
net/softnic: support metering and policing

Enable metering and policing support for softnic.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: parse raw flow item
Reshma Pattan [Tue, 11 Sep 2018 14:20:45 +0000 (15:20 +0100)]
net/softnic: parse raw flow item

Added support for parsing raw flow item.
flow_item_raw_preprocess() is added for the same.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: support flow query
Reshma Pattan [Tue, 11 Sep 2018 14:20:44 +0000 (15:20 +0100)]
net/softnic: support flow query

Added pmd_flow_query() API, for flow query
support.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: support flow destroy
Reshma Pattan [Tue, 11 Sep 2018 14:20:43 +0000 (15:20 +0100)]
net/softnic: support flow destroy

pmd_flow_destroy() API is added to destroy the
created flow.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: support flow create
Reshma Pattan [Tue, 11 Sep 2018 14:20:42 +0000 (15:20 +0100)]
net/softnic: support flow create

pmd_flow_create API is added to support
rte flow create.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: map flow action to table action
Reshma Pattan [Tue, 11 Sep 2018 14:20:41 +0000 (15:20 +0100)]
net/softnic: map flow action to table action

Added validation and mapping of flow rule action
with table action profile.

Added flow_rule_action_get() to do the same.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: map flow match to hash table
Reshma Pattan [Tue, 11 Sep 2018 14:20:40 +0000 (15:20 +0100)]
net/softnic: map flow match to hash table

Support for validating and mapping flow rule with HASH
table match is added.

As part of this, below helper functions are added.
flow_rule_match_hash_get()
hash_key_mask_is_same()

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: parse flow match for ACL table
Reshma Pattan [Tue, 11 Sep 2018 14:20:39 +0000 (15:20 +0100)]
net/softnic: parse flow match for ACL table

Added flow protocol parsing for IPV4/IPV6 and
TCP/UDP/SCTP for ACL table rule match.

Added below helper functions for doing the same.
port_mask_to_range()
ipv6_mask_to_depth()
ipv4_mask_to_depth()
mask_to_depth()

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: map flow match to ACL table
Reshma Pattan [Tue, 11 Sep 2018 14:20:38 +0000 (15:20 +0100)]
net/softnic: map flow match to ACL table

Support for validating and mapping rte flow rule with
ACL table match is added.

As part of this support below utility functions
been added
flow_rule_match_get()
flow_rule_match_acl_get()
flow_item_skip_disabled_protos()
flow_item_proto_preprocess()
flow_item_is_proto()
flow_item_raw_preprocess()

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: support flow validate
Reshma Pattan [Tue, 11 Sep 2018 14:20:37 +0000 (15:20 +0100)]
net/softnic: support flow validate

Start adding flow api operations.

Started with flow validate api support by adding
below basic infrastructure.

flow_pipeline_table_get()
pmd_flow_validate()

Additional flow validate changes will be
added in next patches.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: get eth device
Reshma Pattan [Tue, 11 Sep 2018 14:20:36 +0000 (15:20 +0100)]
net/softnic: get eth device

Add utility function to get the rte_eth_dev from
a given softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: add table and port helper functions
Reshma Pattan [Tue, 11 Sep 2018 14:20:35 +0000 (15:20 +0100)]
net/softnic: add table and port helper functions

Added utility function to freeup the
pipeline tables.

Added utility functions to find the pipeline
output port.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: replace pointers with arrays
Reshma Pattan [Tue, 11 Sep 2018 14:20:34 +0000 (15:20 +0100)]
net/softnic: replace pointers with arrays

Change dev_name, action_profile_name and key_mask
from char* type to arary type of structures
softnic_port_in_params, softnic_port_out_params
and softnic_table_hash_params.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: add flow attribute option
Reshma Pattan [Tue, 11 Sep 2018 14:20:33 +0000 (15:20 +0100)]
net/softnic: add flow attribute option

Added new cli by which user can specify to softnic
which rte flow group and direction has to mapped to
which pipeline and table.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: map flow attribute to pipeline table
Reshma Pattan [Tue, 11 Sep 2018 14:20:32 +0000 (15:20 +0100)]
net/softnic: map flow attribute to pipeline table

Added mapping support from rte_flow attributes
to softnic pipeline and table.

So added flow attribute map set and get functions
definition to new file rte_eth_sofnic_flow.c.

Added pmd flow internals with ingress and egress
flow attribute maps.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: add flow API
Reshma Pattan [Tue, 11 Sep 2018 14:20:31 +0000 (15:20 +0100)]
net/softnic: add flow API

Add rte_flow infra structure for flow api support.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: use table library headers
Kevin Laatz [Tue, 25 Sep 2018 15:32:30 +0000 (16:32 +0100)]
net/softnic: use table library headers

This commit modifies SoftNIC to make use of the new header files in
librte_table.

As we are now using the new header files in librte_table in SoftNIC, we no
longer need the old header files so they can be removed.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoexamples/ip_pipeline: use table library headers
Kevin Laatz [Tue, 25 Sep 2018 15:32:29 +0000 (16:32 +0100)]
examples/ip_pipeline: use table library headers

This commit modifies the IP Pipeline application to use the new header
files in librte_table.

As we are now using the new header files, we can remove the old ones from
the application directory.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agolib/librte_table: add hash function headers
Kevin Laatz [Tue, 25 Sep 2018 15:32:28 +0000 (16:32 +0100)]
lib/librte_table: add hash function headers

This commit adds rte_table_hash_func.h and rte_table_hash_func_arm64.h to
librte_table. This reduces code duplication by removing duplicate header
files within two folders and consolidating them into a single one. This
also adds a scalar implementation of the x86_64 intrinsic for crc32 as a
generic fallback.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoexamples/ip_pipeline: support VXLAN encap
Cristian Dumitrescu [Fri, 7 Sep 2018 15:58:51 +0000 (16:58 +0100)]
examples/ip_pipeline: support VXLAN encap

Add CLI support for VXLAN encap.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agopipeline: add VXLAN encap table action
Cristian Dumitrescu [Fri, 7 Sep 2018 15:58:50 +0000 (16:58 +0100)]
pipeline: add VXLAN encap table action

Add support for VXLAN as part of the encap table action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoapp/testpmd: add TM commands to mark packets
Krzysztof Kanas [Fri, 17 Aug 2018 11:39:19 +0000 (13:39 +0200)]
app/testpmd: add TM commands to mark packets

Add following testpmd run-time commands to support test of TM packet
marking:

set port tm mark ip_ecn   <port_id> <green> <yellow> <red>
set port tm mark ip_dscp  <port_id> <green> <yellow> <red>
set port tm mark vlan_dei <port_id> <green> <yellow> <red>

Signed-off-by: Krzysztof Kanas <krzysztof.kanas@caviumnetworks.com>
6 years agoapp/testpmd: fix metering and policing commands
Jasvinder Singh [Mon, 1 Oct 2018 10:46:04 +0000 (11:46 +0100)]
app/testpmd: fix metering and policing commands

Fixes bad arguments error for cli commands related to adding meter
profile for srtcm_rfc2697, trtcm_rfc2698 and trtcm_rfc4115.

error log:
testpmd> add port meter profile trtcm_rfc2698 2 0 3125000000
3125000000 2500000 2500000
Bad arguments

Fixes: 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agosched: allocate memory on the given socket id
Jasvinder Singh [Thu, 27 Sep 2018 17:10:45 +0000 (18:10 +0100)]
sched: allocate memory on the given socket id

Replace rte_zmalloc() with rte_zmalloc_socket() to allocate
memory on the socket id provided by the application.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoethdev: expand queue threshold size of RED parameters
Rosen Xu [Thu, 16 Aug 2018 01:14:16 +0000 (09:14 +0800)]
ethdev: expand queue threshold size of RED parameters

There's very commonly that more than 4G DDR memory in NIC for HQoS,
so right now the queue threshold size of RED needs to expand to
uint64_t. This patch fixes it.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
6 years agoeal: use correct data type for bitmap slab operations
Vivek Sharma [Tue, 25 Sep 2018 09:53:06 +0000 (09:53 +0000)]
eal: use correct data type for bitmap slab operations

Currently, slab operations use unsigned long data type for 64-bit slab
related operations. On target 'i686-native-linuxapp-gcc', unsigned long
is 32-bit and thus, slab operations breaks on this target. Changing slab
operations to use unsigned long long for correct functioning on
all targets.

Fixes: de3cfa2c9823 ("sched: initial import")
Fixes: 693f715da45c ("remove extra parentheses in return statement")
Cc: stable@dpdk.org
Signed-off-by: Vivek Sharma <vivek.sharma@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agonet/sfc: allow to query RSS key and HF when RSS is disabled
Ivan Malov [Thu, 11 Oct 2018 14:51:13 +0000 (15:51 +0100)]
net/sfc: allow to query RSS key and HF when RSS is disabled

If global RSS is not enabled in the multiqueue mode setting,
it will not be possible to change RSS configuration. However,
querying default RSS settings should be possible in any case since
it may be needed by RTE flow API users to find out what RSS settings
will be used by default for a flow rule with RSS action if custom
RSS key and hash function choice are not specified.

Fixes: 63ab5e0c8fda ("net/sfc: use zero RSS channels as disabled RSS indicator")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc: allow to query RSS key and HF in isolated mode
Ivan Malov [Thu, 11 Oct 2018 14:51:12 +0000 (15:51 +0100)]
net/sfc: allow to query RSS key and HF in isolated mode

Isolated mode prevents global RSS from being enabled and configured.
However, an application may need to query default RSS key and hash
functions when a flow rule with RSS action is added which does not
contain custom RSS key or hash function choice. In this case
global RSS key and hash functions will be used to handle the rule,
and there should be some way for the application to query these
global default settings to clarify expectations on the traffic
distribution.

Fixes: 84a9b48128c1 ("net/sfc: support flow API isolated mode")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc: do not skip RSS configuration step on reconfigure
Ivan Malov [Thu, 11 Oct 2018 14:49:30 +0000 (15:49 +0100)]
net/sfc: do not skip RSS configuration step on reconfigure

Earlier a patch was made to support change of Rx queue
number. That patch added goto label in wrong place
because reconfiguration with the same number of queues
results in skipping not only queue init but also RSS
settings. If a user configures device with RSS multiqueue
mode and then wants to stop it and reconfigure without RSS,
this change will be ignored and RSS will continue working.

Move the label in the right place and rename it to describe it.

Fixes: 55a539003f1a ("net/sfc: support changing the number of receive queues")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/ifc: invoke ifcvf HW init function in probe
Xiaolong Ye [Wed, 10 Oct 2018 13:22:35 +0000 (21:22 +0800)]
net/ifc: invoke ifcvf HW init function in probe

As ifcvf_init_hw is independent with ifcvf_vfio_setup, it's better to
invoke it directly in probe func.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
6 years agonet/ifc: fix address translation function name
Xiao Wang [Tue, 25 Sep 2018 03:10:01 +0000 (11:10 +0800)]
net/ifc: fix address translation function name

The address translation from user virtual address to guest physical
address should not be named as qva_to_gpa.

Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
6 years agonet/e1000: enable MSI-x for linkup and other events in 82574
Luca Boccassi [Fri, 27 Jul 2018 18:13:17 +0000 (19:13 +0100)]
net/e1000: enable MSI-x for linkup and other events in 82574

Linux supports 82574 MSI-x interrupt for linkup and other link
conditions. Enable the same feature in the e1000 PMD in order to
allow this card to work properly, as it requires interrupt
handling for link negotiations among other things.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
6 years agonet/e1000: do not error out if Rx drop enable is set
Luca Boccassi [Fri, 27 Jul 2018 17:26:07 +0000 (18:26 +0100)]
net/e1000: do not error out if Rx drop enable is set

rx_drop_en is an optimization that does nothing on single-queue
devices like e1000. Do not force applications that do not care to
select per-devices optimizations flags by returning an error, just
log it and carry on.

Fixes: 805803445a02 ("e1000: support EM devices (also known as e1000/e1000e)")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
6 years agonet/mlx5: rewrite IP address UDP/TCP port by E-Switch
Xiaoyu Min [Thu, 11 Oct 2018 13:22:06 +0000 (13:22 +0000)]
net/mlx5: rewrite IP address UDP/TCP port by E-Switch

Offload the following rte_flow actions by inserting accordingly
E-Switch rules via TC Flower driver

 - RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC
 - RTE_FLOW_ACTION_TYPE_SET_IPV4_DST
 - RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC
 - RTE_FLOW_ACTION_TYPE_SET_IPV6_DST
 - RTE_FLOW_ACTION_TYPE_SET_TP_SRC
 - RTE_FLOW_ACTION_TYPE_SET_TP_DST

The example testpmd command is:

    flow create 0 transfer ingress
         pattern eth / ipv4 / udp dst is 7000 / end
 actions set_ipv4_src ipv4_addr 172.168.0.1 /
 set_ipv4_dst ipv4_addr 172.168.10.1 /
 set_tp_dst port 9000 /
 set_tp_src port 700 /
 port_id id 1 / end

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: support e-switch TCP-flags flow filter
Moti Haimovsky [Thu, 11 Oct 2018 10:48:39 +0000 (10:48 +0000)]
net/mlx5: support e-switch TCP-flags flow filter

This patch adds support for offloading flow rules with TCP-flags
filter to mlx5 eswitch Hardwrae.

With mlx5 it is possible to offload a limited set of flow rules to
the mlxsw (or e-switch) using the DPDK flow commands using the
"transfer" attribute. This set of flow rules also supports filtering
according to the values found in the TCP flags.
This patch implements this offload capability in the mlx5 PMD under
transfer attribute.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
6 years agonet/mlx5: allow flow rule with attribute egress
Dekel Peled [Sun, 7 Oct 2018 14:01:05 +0000 (17:01 +0300)]
net/mlx5: allow flow rule with attribute egress

This patch complements [1], adding to MLX5 PMD the option to set
flow rule for egress traffic.

[1] "net/mlx5: support metadata as flow rule criteria"
    http://mails.dpdk.org/archives/dev/2018-September/113275.html

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: always use representor ifindex for ioctl
Shahaf Shuler [Mon, 8 Oct 2018 06:28:17 +0000 (09:28 +0300)]
net/mlx5: always use representor ifindex for ioctl

In the current code, on some cases the representor ethdev is using the
PF interface to query some link status information or pause parameters.

It was done because in previous kernel versions there was no support
from the kernel for the representor info.

Using the PF i/f for such ioctl is error prone and not always working
because:
 * On some cases there is no PF at all, only representors (e.g Bluefield
   with host representors)
 * Query the up/down status from representor and link status from PF
   is in-consist
 * PF link is down doesn't necessarily means representor is down.
 * setting different pause configuration for the PF and the
   representors will result on undefined behaviour

Making the code cleaner and more robust by using only the representor
i/f for the ioctl. whatever the kernel will provide on this query will
be used. No need to do W.A. for kernel missing functionality.

Note:
 1. Setting pause parameters will obviously won't work on representors
 2. Old kernel will not report all the possible representor info

Fixes: 2b7302638898 ("net/mlx5: probe all port representors")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/mlx5: add representor specific statistics
Shahaf Shuler [Sun, 7 Oct 2018 12:55:25 +0000 (15:55 +0300)]
net/mlx5: add representor specific statistics

Representor ports has a different set of extended statistics (as those are
logical ports which cannot count all that the PF can).

Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/mlx5: support missing counter in extended statistics
Shahaf Shuler [Mon, 17 Sep 2018 09:46:34 +0000 (12:46 +0300)]
net/mlx5: support missing counter in extended statistics

The current code would fail if one of the counters DPDK counters was not
found on the device counters.

As representors and PF port has different counters the both cannot work
together.

Addressing this issue by making the counter init more flexible to
contain all the counter found and skipping the error.

Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agoapp/testpmd: add noisy neighbour forwarding mode
Jens Freimann [Wed, 3 Oct 2018 18:57:11 +0000 (20:57 +0200)]
app/testpmd: add noisy neighbour forwarding mode

This adds a new forwarding mode to testpmd to simulate
more realistic behavior of a guest machine engaged in receiving
and sending packets performing Virtual Network Function (VNF).

The goal is to enable a simple way of measuring performance impact on
cache and memory footprint utilization from various VNF co-located on
the same host machine. For this it does:

* Buffer packets in a FIFO:

Create a fifo to buffer received packets. Once it flows over put
those packets into the actual tx queue. The fifo is created per tx
queue and its size can be set with the --noisy-tx-sw-buffer-flushtime
commandline parameter.

A second commandline parameter is used to set a timeout in
milliseconds after which the fifo is flushed.

--noisy-tx-sw-buffer-size [packet numbers]
Keep the mbuf in a FIFO and forward the over flooding packets from the
FIFO. This queue is per TX-queue (after all other packet processing).

--noisy-tx-sw-buffer-flushtime [delay]
Flush the packet queue if no packets have been seen during
[delay]. As long as packets are seen, the timer is reset.

Add several options to simulate route lookups (memory reads) in tables
that can be quite large, as well as route hit statistics update.
These options simulates the while stack traversal and
will trash the cache. Memory access is random.

* simulate route lookups:

Allocate a buffer and perform reads and writes on it as specified by
commandline options:

--noisy-lkup-memory [size]
Size of the VNF internal memory (MB), in which the random
read/write will be done, allocated by rte_malloc (hugepages).

--noisy-lkup-num-writes [num]
Number of random writes in memory per packet should be
performed, simulating hit-flags update. 64 bits per write,
all write in different cache lines.

--noisy-lkup-num-reads [num]
Number of random reads in memory per packet should be
performed, simulating FIB/table lookups. 64 bits per read,
all write in different cache lines.

--noisy-lkup-num-reads-writes [num]
Number of random reads and writes in memory per packet should
be performed, simulating stats update. 64 bits per read-write, all
reads and writes in different cache lines.

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agoapp/testpmd: fix duplicate exit
Brian Archbold [Wed, 22 Aug 2018 06:05:06 +0000 (07:05 +0100)]
app/testpmd: fix duplicate exit

In interactive mode, when the "quit" command is issued, pmd_test_exit()
is being called twice, once through the "quit" command and the other
after termination of prompt.

Remove duplicated exit routine by removing call from "quit" command.

Steps to reproduce:
- Run testpmd in interactive mode.
- type "quit".

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Brian Archbold <brian.archbold@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agoapp/testpmd: add new command for show port info
Emma Finn [Tue, 25 Sep 2018 10:32:45 +0000 (11:32 +0100)]
app/testpmd: add new command for show port info

existing testpmd command "show port info" is too verbose.
Added a new summary command to print brief information on ports.

console output:
testpmd> show port summary all
Number of available ports: 2
Port MAC Address       Name          Driver   Status Link
0    11:22:33:44:55:66 0000:07:00.0  net_i40e  up    40000Mbps
1    66:55:44:33:22:11 0000:07:00.1  net_i40e  up    40000Mbps

Signed-off-by: Emma Finn <emma.finn@intel.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agoapp/testpmd: fix printf format in event callback
Herakliusz Lipiec [Tue, 25 Sep 2018 11:23:00 +0000 (12:23 +0100)]
app/testpmd: fix printf format in event callback

change PRIu8 -> PRIu16 for port_id in eth_event_callback
(portid_t is uint16_t)

Fixes: 76ad4a2d82d4 ("app/testpmd: add generic event handler")
Cc: stable@dpdk.org
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agoapp/testpmd: display devargs in port info output
Ferruh Yigit [Wed, 10 Oct 2018 11:42:22 +0000 (12:42 +0100)]
app/testpmd: display devargs in port info output

Devargs may affect how device works but currently we don't have a
way to observe provided devargs.

Add ability to print device argument as part of port info,

For example, for "--vdev net_pcap0,iface=lo" output will be

"
********************* Infos for port 1  *********************
MAC address: 02:70:63:61:70:00
Device name: net_pcap0
Driver name: net_pcap
Devargs: iface=lo
....
"

or for "-w0000:86:00.1,queue-num-per-vf=8",

"
********************* Infos for port 0  *********************
MAC address: 3C:FD:FE:AB:B4:41
Device name: 0000:86:00.1
Driver name: net_i40e
Devargs: queue-num-per-vf=8
....
"

`Devargs` line may not be printed at all if devargs is not provided for
that device.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agodrivers/net: fix log type string
Ferruh Yigit [Tue, 9 Oct 2018 17:38:37 +0000 (18:38 +0100)]
drivers/net: fix log type string

Syntax for log type string is "pmd.<subsystem>.<driver>[.<pmd_local>]"

Fixes: 3e92fd4e4ec0 ("net/bnxt: use dynamic log type")
Fixes: d7f4562ab10a ("net/bonding: convert to dynamic logging")
Fixes: 6086ab3bb3d2 ("net/vdev_netvsc: introduce Hyper-V platform driver")
Fixes: 7db274b9ada2 ("doc: describe dynamic logging format")
Fixes: a10a988a0ba6 ("net/dpaa2: support dynamic logging")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
6 years agodoc: add VFIO in ENA guide
Rafal Kozik [Wed, 10 Oct 2018 12:08:15 +0000 (14:08 +0200)]
doc: add VFIO in ENA guide

Add instruction how to bind ENA to VFIO-PCI driver.

Fixes: cf8a122c296a ("ena: introduce documentation")
Cc: stable@dpdk.org
Signed-off-by: Zorik Machulsky <zorik@amazon.com>
Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
6 years agonet/mlx5: fix errno values for flow engine
Yongseok Koh [Mon, 8 Oct 2018 18:02:19 +0000 (18:02 +0000)]
net/mlx5: fix errno values for flow engine

Fixes: af689f1f04c2 ("net/mlx5: support flow Ethernet item along with drop action")
Fixes: 919d53ad78d2 ("net/mlx5: fix count query when flow has not counter")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
6 years agonet/mlx5: add missing VLAN action constraints
Yongseok Koh [Mon, 8 Oct 2018 18:02:17 +0000 (18:02 +0000)]
net/mlx5: add missing VLAN action constraints

1) VLAN modify isn't supported by driver.

2) FW syndrome (0xA9C090):
set_flow_table_entry: push vlan action fte in fdb can ONLY be
forward to the uplink.

3) FW syndrome (0x294609):
set_flow_table_entry: modify/pop/push actions in fdb flow table are
supported only while forwarding to vport.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agoapp/testpmd: collect bad outer L4 checksum for csum engine
Jerin Jacob [Tue, 9 Oct 2018 14:18:18 +0000 (14:18 +0000)]
app/testpmd: collect bad outer L4 checksum for csum engine

Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD
errors.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agoapp/testpmd: support outer UDP HW checksum
Jerin Jacob [Tue, 9 Oct 2018 14:18:14 +0000 (14:18 +0000)]
app/testpmd: support outer UDP HW checksum

Added outer-udp Tx HW checksum support for csum forward engine
if device supports DEV_TX_OFFLOAD_OUTER_UDP_CKSUM.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agoethdev: add Tx offload outer UDP checksum definition
Jerin Jacob [Tue, 9 Oct 2018 14:18:09 +0000 (14:18 +0000)]
ethdev: add Tx offload outer UDP checksum definition

Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and
PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer UDP
checksum offload.

To use hardware Tx outer UDP checksum offload, the user needs to,

- enable following in mbuf:
a) fill outer_l2_len and outer_l3_len in mbuf
b) set the PKT_TX_OUTER_UDP_CKSUM flag
c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6

- configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoethdev: add Rx offload outer UDP checksum definition
Jerin Jacob [Tue, 9 Oct 2018 14:18:04 +0000 (14:18 +0000)]
ethdev: add Rx offload outer UDP checksum definition

Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
PKT_RX_OUTER_L4_CKSUM_* mbuf ol_flags to detect outer UDP checksum
status.

- To use hardware Rx outer UDP checksum offload, the user needs to
configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.

- Driver updates checksum status in mbuf ol_flag as
PKT_RX_OUTER_L4_CKSUM_* flags.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/failsafe: use prefix for function
Stephen Hemminger [Mon, 8 Oct 2018 22:31:40 +0000 (15:31 -0700)]
net/failsafe: use prefix for function

All other visible functions in failsafe driver have 'failsafe_'
prefix.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agoethdev: add flow action to swap MAC addresses
Rahul Lakkireddy [Sat, 6 Oct 2018 15:45:34 +0000 (21:15 +0530)]
ethdev: add flow action to swap MAC addresses

This action is useful for offloading loopback mode, where the hardware
will swap source and destination MAC addresses in the outermost Ethernet
header before looping back the packet. This action can be used in
conjunction with other rewrite actions to achieve MAC layer transparent
NAT where the MAC addresses are swapped before either the source or
destination MAC address is rewritten and NAT is performed.

Must be used with a valid RTE_FLOW_ITEM_TYPE_ETH flow pattern item.
Otherwise, RTE_FLOW_ERROR_TYPE_ACTION error should be returned by the
PMDs.

Original work by Shagun Agrawal

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/cxgbe: add flow actions to modify IP and TCP/UDP port
Rahul Lakkireddy [Tue, 9 Oct 2018 08:44:38 +0000 (14:14 +0530)]
net/cxgbe: add flow actions to modify IP and TCP/UDP port

Query firmware for the new filter work request to offload flows with
actions to modify IP and TCP/UDP port addresses. When available,
translate IP and TCP/UDP port address modify actions to internal
hardware specification and offload the flow to hardware.

Original work by Shagun Agrawal

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agoethdev: add flow API actions to modify TCP/UDP port numbers
Rahul Lakkireddy [Tue, 9 Oct 2018 08:44:37 +0000 (14:14 +0530)]
ethdev: add flow API actions to modify TCP/UDP port numbers

Add actions:
- SET_TP_SRC - set a new TCP/UDP source port number.
- SET_TP_DST - set a new TCP/UDP destination port number.

Original work by Shagun Agrawal

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoethdev: add flow API actions to modify IP addresses
Rahul Lakkireddy [Tue, 9 Oct 2018 08:44:36 +0000 (14:14 +0530)]
ethdev: add flow API actions to modify IP addresses

Add actions:
- SET_IPV4_SRC - set a new IPv4 source address.
- SET_IPV4_DST - set a new IPv4 destination address.
- SET_IPV6_SRC - set a new IPv6 source address.
- SET_IPV6_DST - set a new IPv6 destination address.

Original work by Shagun Agrawal

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/pcap: support physical interface MAC address
Juhamatti Kuusisaari [Sat, 6 Oct 2018 00:49:59 +0000 (01:49 +0100)]
net/pcap: support physical interface MAC address

At the moment, PCAP interfaces use dummy MAC by default. This change
adds support for selecting PCAP physical interface MAC with phy_mac=1
devarg. This allows to setup packet flows using the physical interface
MAC.

Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/sfc: support Tx descriptor status on EF10 datapath
Igor Romanov [Fri, 5 Oct 2018 14:47:03 +0000 (15:47 +0100)]
net/sfc: support Tx descriptor status on EF10 datapath

The implementation is shared by ef10 and ef10_simple datapaths.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc: support TSO in EF10 Tx datapath
Igor Romanov [Fri, 5 Oct 2018 14:47:02 +0000 (15:47 +0100)]
net/sfc: support TSO in EF10 Tx datapath

Implementation includes following limitations:

1) Packet's header length must be less than 256 (SFC_TSOH_STD_LEN);
2) Offset of the TCP header must be less than 208
   (EF10_TCP_HEADER_OFFSET_LIMIT);
3) Number of Tx descriptors must be not less than number of descriptors
   needed for TSO settings plus header plus one data segment.

If above conditions are not met, the packet is dropped.

If the maximum descriptor space is insufficient to hold entire TSO packet,
only a part of the packet is sent.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc: put generalised TSO declarations in a header
Igor Romanov [Fri, 5 Oct 2018 14:47:01 +0000 (15:47 +0100)]
net/sfc: put generalised TSO declarations in a header

Move general TSO declarations in a separate header to be able to use
them in other datapaths (not only EFX). Also update the function that
prepares TSO header to make it useful in other datapaths.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agodoc: clarify L4 Tx checksum prerequisite
Jerin Jacob [Fri, 5 Oct 2018 04:46:05 +0000 (10:16 +0530)]
doc: clarify L4 Tx checksum prerequisite

Based on PKT_TX_[TCP|UDP|SCTP]_CKSUM definition the user needs
to fill l2_len and l3_len mbuf fields before issuing HW Tx
checksum request.

Fixes: dad1ec72a377 ("doc: document NIC features")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agodoc: clarify L3 Tx checksum prerequisite
Jerin Jacob [Fri, 5 Oct 2018 04:46:04 +0000 (10:16 +0530)]
doc: clarify L3 Tx checksum prerequisite

Based on PKT_TX_IP_CKSUM definition the user needs
to fill l2_len and l3_len mbuf fields before issuing
HW Tx checksum request.

Fixes: dad1ec72a377 ("doc: document NIC features")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoapp/testpmd: fix displaying RSS hash functions
Ferruh Yigit [Thu, 4 Oct 2018 19:24:44 +0000 (20:24 +0100)]
app/testpmd: fix displaying RSS hash functions

Command shouldn't ask RSS hash functions as argument to get supported
RSS hash function, those values will be overwritten by PMD anyway.

To display configured RSS hash functions
"show port (port_id) rss-hash"

To display configured RSS hash functions and hash key
"show port (port_id) rss-hash key"

Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash commands")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agoapp/testpmd: clarify flow types in port info
Ferruh Yigit [Thu, 4 Oct 2018 18:44:08 +0000 (19:44 +0100)]
app/testpmd: clarify flow types in port info

In "show port info #" cmd output, "Supported flow types:" part is
not clear what flow types are listed.

Those are flow types that hash calculation offload supported by NIC.
Updated command output as "Supported RSS offload flow types:"

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agombuf: clarify QinQ flag usage
Ferruh Yigit [Wed, 3 Oct 2018 15:19:12 +0000 (16:19 +0100)]
mbuf: clarify QinQ flag usage

Update implementation that when PKT_RX_QINQ_STRIPPED mbuf ol_flags
set by PMD, PKT_RX_QINQ, PKT_RX_VLAN_STRIPPED & PKT_RX_VLAN
should be also set.

Clarify mbuf documentations that when PKT_RX_QINQ set PKT_RX_VLAN also
should be set.

So that appllication can rely on PKT_RX_QINQ flag to access both
mbuf.vlan_tci & mbuf.vlan_tci_outer

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agonet/mlx5: support externally allocated static memory
Yongseok Koh [Mon, 24 Sep 2018 18:36:47 +0000 (18:36 +0000)]
net/mlx5: support externally allocated static memory

When MLX PMD registers memory for DMA, it accesses the global memseg list
of DPDK to maximize the range of registration so that LKey search can be
more efficient. Granularity of MR registration is per page.

Externally allocated memory shouldn't be used for DMA because it can't be
searched in the memseg list and free event can't be tracked by DPDK. If it
is used, the following error will occur:

net_mlx5: port 0 unable to find virtually contiguous chunk for
address (0x5600017587c0). rte_memseg_contig_walk() failed.

There's a pending patchset [1] which enables externally allocated memory.
Once it is merged, users can register their own memory out of EAL then that
will resolve this issue.

Meanwhile, if the external memory is static (allocated on startup and never
freed), such memory can also be registered by little tweak in the code.

[1] http://patches.dpdk.org/project/dpdk/list/?series=1415

This patch is not a bug fix but needs to be included in stable versions.

Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx4: support externally allocated static memory
Yongseok Koh [Mon, 24 Sep 2018 18:36:45 +0000 (18:36 +0000)]
net/mlx4: support externally allocated static memory

When MLX PMD registers memory for DMA, it accesses the global memseg list
of DPDK to maximize the range of registration so that LKey search can be
more efficient. Granularity of MR registration is per page.

Externally allocated memory shouldn't be used for DMA because it can't be
searched in the memseg list and free event can't be tracked by DPDK. If it
is used, the following error will occur:

net_mlx5: port 0 unable to find virtually contiguous chunk for
address (0x5600017587c0). rte_memseg_contig_walk() failed.

There's a pending patchset [1] which enables externally allocated memory.
Once it is merged, users can register their own memory out of EAL then that
will resolve this issue.

Meanwhile, if the external memory is static (allocated on startup and never
freed), such memory can also be registered by little tweak in the code.

[1] http://patches.dpdk.org/project/dpdk/list/?series=1415

This patch is not a bug fix but needs to be included in stable versions.

Fixes: 9797bfcce1c9 ("net/mlx4: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix representor port xstats
Xueming Li [Wed, 19 Sep 2018 07:55:26 +0000 (15:55 +0800)]
net/mlx5: fix representor port xstats

This patch fixes the issue that representor port shows xstats of PF.

Fixes: 2b7302638898 ("net/mlx5: probe all port representors")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix representor port link status
Xueming Li [Wed, 19 Sep 2018 08:27:37 +0000 (16:27 +0800)]
net/mlx5: fix representor port link status

Current code uses PF links status for representor port, not the
representor interface itself.
This caused wrong representor port link status when toggling
interface up or down.

Fixes: 2b7302638898 ("net/mlx5: probe all port representors")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add Linux TC flower driver for E-Switch flow
Yongseok Koh [Mon, 24 Sep 2018 19:55:17 +0000 (19:55 +0000)]
net/mlx5: add Linux TC flower driver for E-Switch flow

Flows having 'transfer' attribute have to be inserted to E-Switch on the
NIC and the control path uses Linux TC flower interface via Netlink
socket.
This patch adds the flow driver on top of the new flow engine.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: remove Netlink flow driver
Yongseok Koh [Mon, 24 Sep 2018 19:55:16 +0000 (19:55 +0000)]
net/mlx5: remove Netlink flow driver

Netlink based E-Switch flow engine will be migrated to the new flow
engine.
nl_flow will be renamed to flow_tcf as it goes through Linux TC flower
interface.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add abstraction for multiple flow drivers
Yongseok Koh [Mon, 24 Sep 2018 19:55:14 +0000 (19:55 +0000)]
net/mlx5: add abstraction for multiple flow drivers

Flow engine has to support multiple driver paths. Verbs/DV for NIC flow
steering and Linux TC flower for E-Switch flow steering. In the future,
another flow driver could be added (devX).

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add runtime parameter to enable Direct Verbs
Ori Kam [Mon, 24 Sep 2018 23:17:54 +0000 (23:17 +0000)]
net/mlx5: add runtime parameter to enable Direct Verbs

DV flow API is based on new kernel API and is
missing some functionality like counter but add other functionality
like encap.

In order not to affect current users even if the kernel supports
the new DV API it should be enabled only manually.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add Direct Verbs final functions
Ori Kam [Mon, 24 Sep 2018 23:17:52 +0000 (23:17 +0000)]
net/mlx5: add Direct Verbs final functions

This commits add the missing function which are apply, remove, and
destroy.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add Direct Verbs driver to glue
Ori Kam [Mon, 24 Sep 2018 23:17:51 +0000 (23:17 +0000)]
net/mlx5: add Direct Verbs driver to glue

This commit adds all Direct Verbs required functions to the glue lib.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add Direct Verbs translate actions
Ori Kam [Mon, 24 Sep 2018 23:17:49 +0000 (23:17 +0000)]
net/mlx5: add Direct Verbs translate actions

In this commit we add the translation of flow actions.
Unlike the Verbs API actions are separeted from the items and are passed
to the API in array structure.
Since the target action like RSS require the QP information those
actions are handled both in the translate action and in the apply.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add Direct Verbs translate items
Ori Kam [Mon, 24 Sep 2018 23:17:47 +0000 (23:17 +0000)]
net/mlx5: add Direct Verbs translate items

This commit handles the translation of the requested flow into Direct
Verbs API.

The Direct Verbs introduce the matcher object which acts as shared mask
for all flows that are using the same mask. So in this commit we
translate the item and get in return a matcher and the value that should
be matched.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add Direct Verbs prepare function
Ori Kam [Mon, 24 Sep 2018 23:17:45 +0000 (23:17 +0000)]
net/mlx5: add Direct Verbs prepare function

This function allocates the Direct Verbs device flow, and
introduce the relevant PRM structures.

This commit also adds the matcher object. The matcher object acts as a
mask and should be shared between flows. For example all rules that
should match source IP with full mask should use the same matcher. A
flow that should match dest IP or source IP but without full mask should
have a new matcher allocated.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add Direct Verbs validation function
Ori Kam [Mon, 24 Sep 2018 23:17:43 +0000 (23:17 +0000)]
net/mlx5: add Direct Verbs validation function

This is commit introduce the Direct Verbs driver API.
The Direct Verbs is an API adds new features like encapsulation, match
on metatdata.
In this commit the validation function was added, most of the validation
is done with functions that are also in use for the Verbs API.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add flow translate function
Ori Kam [Mon, 24 Sep 2018 23:17:39 +0000 (23:17 +0000)]
net/mlx5: add flow translate function

This commit modify the conversion of the input parameters into Verbs
spec, in order to support all previous changes.

Some of those changes are:
removing the use of the parser,
storing each flow in its own flow structure.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add flow prepare function
Ori Kam [Mon, 24 Sep 2018 23:17:37 +0000 (23:17 +0000)]
net/mlx5: add flow prepare function

In current implementation the calculation of the flow size is done
during the validation stage, and the same function is also used to
translate the input parameters into verbs spec.  This is hard to
maintain and error prone.
Another issue is dev-flows (flows that are created implicitly in order
to support the requested flow for example when the user request RSS on
UDP 2 rules need to be created one for IPv4 and one for IPv6).
In current implementation the dev-flows are created on the same
memory allocation. This will be harder to implement in future drivers.

The commits extract the calculation and creation of the dev-flow from
the translation part (the part that converts the parameters into the
format required by the driver). This results in that the prepare
function only function is to allocate the dev-flow.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: split flow validation to dedicated function
Ori Kam [Mon, 24 Sep 2018 23:17:35 +0000 (23:17 +0000)]
net/mlx5: split flow validation to dedicated function

In current implementation the validation logic reside in the same
function that calculates the size of the verbs spec and also create the
verbs spec.
This approach results in hard to maintain code which can't be shared.
also in current logic there is a use of parser entity that holds the
information between function calls. The main problem with this parser is
that it assumes the connection between different functions. For example
it assumes that the validation function was called and relevant values
were set.
This may result in an issue if and when we only call the validation
function, or call the apply function without the validation (Currently
according to RTE flow we must call validation before creating flow, but
if we want to change that to save time during flow creation, for example
the user validated some rule and just want to change the IP there is no
true reason the validate the rule again).

This commit address both of those issues by extracting the validation
logic into detected functions and remove the use of the parser object.
The side effect of those changes is that in some cases there will be a
need to traverse the item list again.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/enic: add AVX2 based vectorized Rx handler
Hyong Youb Kim [Wed, 3 Oct 2018 20:09:28 +0000 (13:09 -0700)]
net/enic: add AVX2 based vectorized Rx handler

Add the vectorized version of the no-scatter Rx handler. It aims to
process 8 descriptors per loop using AVX2 SIMD instructions. This
handler is in its own file enic_rxtx_vec_avx2.c, and makefile and
meson.build are modified to compile it when the compiler supports
AVX2. Under ideal conditions, the vectorized handler reduces
cycles/packet by more than 30%, when compared against the no-scatter
Rx handler. Most implementation ideas come from i40e's AVX2 based
handler, so credit goes to its authors.

At this point, the new handler is meant for field trials, and is not
selected by default. So add a new devarg enable-avx2-rx to allow the
user to request the use of the new handler. When enable-avx2-rx=1, the
driver will consider using the new handler.

Also update the guide doc and introduce the vectorized handler.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>