dpdk.git
5 years agoexamples/vm_power: add command to query CPU frequency
Marcin Hajkowski [Fri, 27 Sep 2019 12:16:01 +0000 (13:16 +0100)]
examples/vm_power: add command to query CPU frequency

Add command and related logic to query CPU frequencies
either for specified CPU or all cores.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agoexamples/vm_power: add mechanism to disable queries
Marcin Hajkowski [Fri, 27 Sep 2019 12:16:00 +0000 (13:16 +0100)]
examples/vm_power: add mechanism to disable queries

Add new command which gives possibility to enable/disable queries
form VM guest.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agoexamples/vm_power: process CPU frequency query
Marcin Hajkowski [Fri, 27 Sep 2019 12:15:59 +0000 (13:15 +0100)]
examples/vm_power: process CPU frequency query

On query received from VM guest send CPUs frequencies.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agopower: extend guest channel for frequency query
Marcin Hajkowski [Fri, 27 Sep 2019 12:15:58 +0000 (13:15 +0100)]
power: extend guest channel for frequency query

Extend incoming packet reading API with new packet
type which carries CPU frequencies.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agoexamples/vm_power: fix build without i40e
David Hunt [Thu, 24 Oct 2019 14:26:10 +0000 (15:26 +0100)]
examples/vm_power: fix build without i40e

channel_monitor.c was dependent on i40e driver being available.
This is only necessary for the TRAFFIC policy, so use #ifdef's
to not call these when i40e not available.

Fixes: f14791a8126e ("examples/vm_power_mgr: add policy to channels")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/vm_power: send confirmation cmd to guest
Marcin Hajkowski [Fri, 27 Sep 2019 08:42:16 +0000 (09:42 +0100)]
examples/vm_power: send confirmation cmd to guest

Use new guest channel API to send confirmation
message for received power command.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agoexamples/vm_power: process incoming confirmation cmds
Marcin Hajkowski [Fri, 27 Sep 2019 08:42:15 +0000 (09:42 +0100)]
examples/vm_power: process incoming confirmation cmds

Extend vm_power_guest to check incoming confirmations
of messages previously sent to host.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agopower: extend guest channel API for reading
Marcin Hajkowski [Fri, 27 Sep 2019 08:42:14 +0000 (09:42 +0100)]
power: extend guest channel API for reading

Added new experimental API rte_power_guest_channel_receive_msg
which gives possibility to receive messages send to guest.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agopower: fix socket indicator value
Marcin Hajkowski [Fri, 27 Sep 2019 08:42:13 +0000 (09:42 +0100)]
power: fix socket indicator value

Currently 0 is being used for not connected slot indication.
This is not consistent with linux doc which identifies 0 as valid
(connected) slot, thus modification was done to change it.

Fixes: cd0d5547 ("power: vm communication channels in guest")
Cc: stable@dpdk.org
Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoexamples/l3fwd-power: fix Rx interrupt disabling
Xiao Zhang [Tue, 10 Sep 2019 16:10:14 +0000 (00:10 +0800)]
examples/l3fwd-power: fix Rx interrupt disabling

Interrupt will not be received when disabling RX interrupt without
synchronization mechanism sometimes which leads to wake up issue.
Add spinlock to fix it.

Fixes: b736d64787 ("examples/l3fwd-power: disable Rx interrupt when waking up")
Cc: stable@dpdk.org
Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Marvin Liu <yong.liu@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agoexamples/l3fwd: prefetch the content of the next packet
Feifei Wang [Wed, 14 Aug 2019 08:54:30 +0000 (16:54 +0800)]
examples/l3fwd: prefetch the content of the next packet

The cache-misses problem is very serious when the function
lpm_cb_parse_ptype is called to read the content of packets. That is
because the contents of packages previously stored in the cache are
overwritten by the following instructions or variables.
Thus the prefetch order can be used to prefetch the next packet into
the cache to avoid CPU spending too much time on it.

On Octeon TX platform with built-in NIC, 12% performance gain was
measured by running RFC2544 NDR test with l3fwd. Furthermore, the
cache-misses event of the function lpm_cb_parse_ptype was reduced by
20%, and the CPU task-clock of it dropped from 16.49% to 11.3%, based
on the forwarding test for one minute with the 64B packet.
On the dpaa2 platform, no performance improvement nor drop were seen
with this patch by running RFC2544 NDR test with l3fwd.
On the x86 platform, 15.7% performance gain was measured by running
RFC2544 NDR test with l3fwd.

Signed-off-by: Feifei Wang <feifei.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
5 years agonet: remove ethernet packing and set two-byte alignment
Bruce Richardson [Thu, 10 Oct 2019 10:46:23 +0000 (11:46 +0100)]
net: remove ethernet packing and set two-byte alignment

The ether header does not need to be packed since that makes no sense for
structures with only bytes in them, but it should be aligned to a two-byte
boundary to simplify access to it from code. Other packed structures that
use this also need to be updated to take account of the change, either by
removing packing - where it is clearly unneeded - or by explicitly giving
those structures 2-byte alignment also.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agodoc: add IOAT sample app guide
Marcin Baran [Mon, 7 Oct 2019 11:08:09 +0000 (12:08 +0100)]
doc: add IOAT sample app guide

Added guide for IOAT sample app usage and code description.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/ioat: print statistics
Marcin Baran [Mon, 7 Oct 2019 11:08:08 +0000 (12:08 +0100)]
examples/ioat: print statistics

Added printing stats of ports each second.  The stats printing is done
using master core.  The information provided informs about packets
received, dropped and send as well as statistics of rawdev devices.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/ioat: add two threads configuration
Pawel Modrak [Mon, 7 Oct 2019 11:08:07 +0000 (12:08 +0100)]
examples/ioat: add two threads configuration

Added possibility to use two lcores: first for packet receiving and
copying, second for packets sending.

Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/ioat: add rawdev copy mode
Marcin Baran [Mon, 7 Oct 2019 11:08:06 +0000 (12:08 +0100)]
examples/ioat: add rawdev copy mode

Added support for copying packets using rawdev device. Each port's Rx queue
is assigned DMA channel for copy.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/ioat: add software copy mode
Marcin Baran [Mon, 7 Oct 2019 11:08:05 +0000 (12:08 +0100)]
examples/ioat: add software copy mode

Added support for copying packets using software copy mode and MAC address
changing. The copies are processed using one lcore.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/ioat: add new sample app for ioat driver
Pawel Modrak [Mon, 7 Oct 2019 11:08:04 +0000 (12:08 +0100)]
examples/ioat: add new sample app for ioat driver

A new sample app demonstrating use of driver for CBDMA.  The app receives
packets, performs software or hardware copy, changes packets' MAC addresses
(if enabled) and forwards them. The change covers ports initialization,
closing connection and argument parsing.

Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/vm_power: add guest cli to meson
Bruce Richardson [Tue, 22 Oct 2019 15:43:10 +0000 (16:43 +0100)]
examples/vm_power: add guest cli to meson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agoexamples/vm_power: fix type of cmdline token in cli
Bruce Richardson [Tue, 22 Oct 2019 15:43:09 +0000 (16:43 +0100)]
examples/vm_power: fix type of cmdline token in cli

Building the example with clang gives the error:

  error: expression which evaluates to zero treated as a null pointer
  constant of type 'const char *' [-Werror,-Wnon-literal-null-conversion]
                        lcore_id, UINT8);
                                  ^~~~~

This error is due to the wrong data type being given for the
cmd_set_cpu_freq_core_num value - it was specified as string rather than
numeric type.

Fixes: f5e5c3347ae3 ("examples/vm_power: cli in guest")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agoexamples/server_node_efd: add server binary to meson build
Bruce Richardson [Tue, 22 Oct 2019 15:43:08 +0000 (16:43 +0100)]
examples/server_node_efd: add server binary to meson build

When adding to the build, add in two missing includes that prevented build
on freebsd, rather than just duplicating the makefile restriction.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/server_node_efd: add node binary to meson build
Bruce Richardson [Tue, 22 Oct 2019 15:43:07 +0000 (16:43 +0100)]
examples/server_node_efd: add node binary to meson build

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/performance-thread: add pthread shim to meson
Bruce Richardson [Tue, 22 Oct 2019 15:43:06 +0000 (16:43 +0100)]
examples/performance-thread: add pthread shim to meson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/performance-thread: add l3fwd-thread to meson
Bruce Richardson [Tue, 22 Oct 2019 15:43:05 +0000 (16:43 +0100)]
examples/performance-thread: add l3fwd-thread to meson

Limited to x86_64 systems, as it fails to compile on any others and is
disabled in the examples makefile for non-x86_64 systems.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/performance-thread: remove warning disabling
Bruce Richardson [Tue, 22 Oct 2019 15:43:04 +0000 (16:43 +0100)]
examples/performance-thread: remove warning disabling

The warnings about functions not returning values can be removed from the
code by just adding an attribute to the function to specifies it doesn't
return. The GCC bug referenced in the makefile which prevents this from
working has been fixed for >10 years according to bugzilla.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/ethtool: build as part of meson build
Bruce Richardson [Tue, 22 Oct 2019 15:43:03 +0000 (16:43 +0100)]
examples/ethtool: build as part of meson build

Since the code for the ethtool example was contained in subdirectories the
compilation of this example is different from most of the other apps, and
it had not been abled when the user requests a build with "-Dexamples=all".

To simplify the build with meson, the separate ethtool library is not build
separately, rather the app is built as a single entity.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/bpf: remove from list of examples to build
Bruce Richardson [Tue, 22 Oct 2019 15:43:02 +0000 (16:43 +0100)]
examples/bpf: remove from list of examples to build

The examples/bpf directory does not contain an example app, but rather
example code for use with testpmd's BPF support. Therefore, we should not
attempt to build it when the user requests "examples=all". This also
synchronises the meson behaviour with make which similarly doesn't compile
up the code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoport: fix pcap support with meson
Bruce Richardson [Tue, 24 Sep 2019 12:04:14 +0000 (13:04 +0100)]
port: fix pcap support with meson

The meson build was missing the define to enable pcap port support if
libpcap (development) package was found on the build platform. Rather than
duplicating the checks for libpcap found in the pcap net PMD build file, we
can move the checks to the top-level config directory and reference the
RTE_PCAP_PORT setting elsewhere in the build.

Bugzilla ID: 351
Fixes: 5b9656b157d3 ("lib: build with meson")
Cc: stable@dpdk.org
Reported-by: Cristian Bidea <cristian.bidea@keysight.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Cristian Bidea <cristian.bidea@keysight.com>
5 years agobitrate: use common macro RTE_DIM
Pavan Nikhilesh [Thu, 17 Oct 2019 12:10:00 +0000 (17:40 +0530)]
bitrate: use common macro RTE_DIM

Use RTE_DIM instead of re-defining ARRAY_SIZE.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agotest: use common macro RTE_DIM
Pavan Nikhilesh [Thu, 17 Oct 2019 12:09:59 +0000 (17:39 +0530)]
test: use common macro RTE_DIM

Use RTE_DIM instead of re-defining ARRAY_SIZE.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Gage Eads <gage.eads@intel.com>
5 years agoraw/ioat: fix initial ring size check
Ciara Power [Thu, 10 Oct 2019 12:36:03 +0000 (13:36 +0100)]
raw/ioat: fix initial ring size check

When running the ioat_rawdev_autotest, the ring size was initially required
to be 0. This prevented the test being run multiple times, as the ring size
is modified to a non-zero value when running the first test.

A global variable is now used to track the expected ring size, and is used
in the initial value check.  This enables the test to be run more than
once.

Fixes: 849470d522ed ("raw/ioat: add configure, start and stop functions")
Cc: stable@dpdk.org
Reported-by: Yinan Wang <yinan.wang@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoraw/ioat: fix device state after test
Ciara Power [Thu, 10 Oct 2019 12:36:02 +0000 (13:36 +0100)]
raw/ioat: fix device state after test

The ioat rawdev was initially started during the test, however was never
stopped. This would cause issues when running the test again, as the device
cannot be configured when in a running state.

The device is now stopped after the test has completed, or if the test is
terminated due to error.

Fixes: 849470d522ed ("raw/ioat: add configure, start and stop functions")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/ntb: add return code checks
Xiaoyun Li [Fri, 25 Oct 2019 07:01:01 +0000 (15:01 +0800)]
examples/ntb: add return code checks

This patch adds return value checking and error handling for
rte_rawdev_en/dequeue_buffers() and rte_eth_link_get().

Coverity issue: 350247, 350250, 350251, 350252, 350253, 350254
Fixes: 5194299d6ef5 ("examples/ntb: support more functions")

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
5 years agobuild: support building ABI versioned files twice
Bruce Richardson [Mon, 7 Oct 2019 15:45:50 +0000 (16:45 +0100)]
build: support building ABI versioned files twice

Any file with ABI versioned functions needs different macros for shared and
static builds, so we need to accommodate that. Rather than building
everything twice, we just flag to the build system which libraries need
that handling, by setting use_function_versioning in the meson.build files.

To ensure we don't get silent errors at build time due to this meson flag
being missed, we add an explicit error to the function versioning header
file if a known C macro is not defined. Since "make" builds always only
build one of shared or static libraries, this define can be always set, and
so is added to the global CFLAGS. For meson, the build flag - and therefore
the C define - is set for the three libraries that need the function
versioning: "distributor", "lpm" and "timer".

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Andrzej Ostruszka <amo@semihalf.com>
Reviewed-by: Andrzej Ostruszka <amo@semihalf.com>
5 years agoeal: split compat header file
Bruce Richardson [Mon, 7 Oct 2019 15:45:49 +0000 (16:45 +0100)]
eal: split compat header file

The compat.h header file provided macros for two purposes:
1. it provided the macros for marking functions as rte_experimental
2. it provided the macros for doing function versioning

Although these were in the same file, #1 is something that is for use by
public header files, which #2 is for internal use only. Therefore, we can
split these into two headers, keeping #1 in rte_compat.h and #2 in a new
file rte_function_versioning.h. For "make" builds, since internal objects
pick up the headers from the "include/" folder, we need to add the new
header to the installation list, but for "meson" builds it does not need to
be installed as it's not for public use.

The rework also serves to allow the use of the function versioning macros
to files that actually need them, so the use of experimental functions does
not need including of the versioning code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Andrzej Ostruszka <amo@semihalf.com>
5 years agoapp/procinfo: use strlcpy for copying string
Ciara Power [Thu, 26 Sep 2019 15:11:59 +0000 (16:11 +0100)]
app/procinfo: use strlcpy for copying string

Replaced strncpy and strcpy with strlcpy.
Also replaced snprintf with strlcpy where applicable.
Using strlcpy is safe practice when copying strings, as it will include
a null terminator.

Fixes: 2deb6b5246d7 ("app/procinfo: add collectd format and host id")
Fixes: 8a37f37fc243 ("app/procinfo: add --show-port")
Cc: stable@dpdk.org
Reported-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agokni: add ability to set min/max MTU
Igor Ryzhov [Fri, 25 Oct 2019 18:30:58 +0000 (19:30 +0100)]
kni: add ability to set min/max MTU

Starting with kernel version 4.10, there are new min/max MTU values in
net_device structure, which are set to ETH_MIN_MTU and ETH_DATA_LEN by
default. We should be able to change these values to allow MTU more than
1500 to be set on KNI.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agovhost: fix build on RHEL 7.6 for Power
David Christensen [Wed, 14 Aug 2019 18:36:41 +0000 (13:36 -0500)]
vhost: fix build on RHEL 7.6 for Power

Use of %llx print formatting causes meson build error on Power systems with
RHEL 7.6 and gcc 4.8.5.  Replace with PRIx64 macro.

Fixes: 9b62e2da1844 ("vhost: register new regions with userfaultfd")
Cc: stable@dpdk.org
Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agoconfig: fix build on RHEL 7.6 for Power9
David Christensen [Wed, 14 Aug 2019 18:36:40 +0000 (13:36 -0500)]
config: fix build on RHEL 7.6 for Power9

gcc 4.8.5 used on RHEL 7.6 can identify a Power 9 CPU but cannot generate
Power 9 code when the "-mcpu=native" command line argument is used. Test
whether the compiler can generate Power 9 code and adjust the machine
setting appropriately.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
5 years agoethdev: bump library version
David Marchand [Sun, 27 Oct 2019 06:14:05 +0000 (07:14 +0100)]
ethdev: bump library version

Let's stick to the current model of per library ABI version until the
new model is in place.

The ABI changed in the incriminated commit.
The release notes were updated accordingly but the compiled version
number has been missed.

Fixes: 4f25d7d2252f ("ethdev: add return code to device info get function")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodoc: announce global logs struct removal from ABI
David Marchand [Fri, 25 Oct 2019 13:56:11 +0000 (15:56 +0200)]
doc: announce global logs struct removal from ABI

New accessor has been introduced to provide the hidden information.
This symbol can now be kept internal.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
5 years agoeal: make the global configuration private
David Marchand [Fri, 25 Oct 2019 13:56:10 +0000 (15:56 +0200)]
eal: make the global configuration private

Now that all elements of the rte_config structure have (deinlined)
accessors, we can hide it.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoeal: factorize lcore role code
David Marchand [Fri, 25 Oct 2019 13:56:09 +0000 (15:56 +0200)]
eal: factorize lcore role code

This code belongs to the lcore API, move the prototype to the right
header, then factorize the code into the common code.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoeal: deinline lcore APIs
David Marchand [Fri, 25 Oct 2019 13:56:08 +0000 (15:56 +0200)]
eal: deinline lcore APIs

Those functions are used to setup or take control decisions.
Move them into the EAL common code and put them directly in the stable
ABI.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agotest/mem: remove dependency on EAL internals
David Marchand [Fri, 25 Oct 2019 13:56:07 +0000 (15:56 +0200)]
test/mem: remove dependency on EAL internals

Rather than dereference the mem_config internal structure, we can rely
on the rte_memzone_walk API and count memzones.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agolog: add log stream accessor
David Marchand [Fri, 25 Oct 2019 13:56:06 +0000 (15:56 +0200)]
log: add log stream accessor

Define an accessor so that users can write their debug message to the
same stream than the rte_log infrastructure.
Use it in the qat infrastructure.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
5 years agopci: remove deprecated functions
David Marchand [Fri, 25 Oct 2019 13:56:05 +0000 (15:56 +0200)]
pci: remove deprecated functions

Those functions have been deprecated since 17.11 and have 1:1
replacement.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agonet/bonding: use non deprecated PCI API
David Marchand [Fri, 25 Oct 2019 13:56:04 +0000 (15:56 +0200)]
net/bonding: use non deprecated PCI API

rte_eal_compare_pci_addr has been deprecated since v17.11.
Convert to rte_pci_addr_cmp.

Fixes: c848b518bbc7 ("net/bonding: support bifurcated driver in eal")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agomem: hide internal heap header
David Marchand [Fri, 25 Oct 2019 13:56:03 +0000 (15:56 +0200)]
mem: hide internal heap header

Let's avoid exporting structures without an identified usecase.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoeal: remove deprecated malloc virt2phys function
David Marchand [Fri, 25 Oct 2019 13:56:02 +0000 (15:56 +0200)]
eal: remove deprecated malloc virt2phys function

Remove rte_malloc_virt2phy as announced previously.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoeal: remove deprecated CPU flags check function
David Marchand [Fri, 25 Oct 2019 13:56:01 +0000 (15:56 +0200)]
eal: remove deprecated CPU flags check function

Remove rte_cpu_check_supported as announced previously.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoeal: make lcore config private
Stephen Hemminger [Fri, 25 Oct 2019 13:56:00 +0000 (15:56 +0200)]
eal: make lcore config private

The internal structure of lcore_config does not need to be part of
visible API/ABI. Make it private to EAL.

Rearrange the structure so it takes less memory (and cache footprint).

Since we change the ABI, bump the library version.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoexamples/load_balancer: remove example
Ciara Power [Fri, 25 Oct 2019 09:56:08 +0000 (10:56 +0100)]
examples/load_balancer: remove example

This example can be removed because DPDK now has a range
of libraries, especially rte_eventdev, that did not exist
previously for load balancing, making this less relevant.
Also, modern NIC cards have greater ability to do load balancing,
e.g. using RSS, over a wider range of fields than earlier cards did.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoexamples/netmap-compat: remove example
Ciara Power [Fri, 25 Oct 2019 09:56:07 +0000 (10:56 +0100)]
examples/netmap-compat: remove example

Rather than providing a shim layer on top of netmap,
we should instead encourage users to create apps using
the DPDK APIs directly.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoexamples/quota-watermark: remove example
Ciara Power [Fri, 25 Oct 2019 09:56:06 +0000 (10:56 +0100)]
examples/quota-watermark: remove example

Original DPDK rings code had explicit support for a
single watermark per-ring, but more recent releases of
DPDK had a more general mechanism where each enqueue
or dequeue call could return the remaining elements/free-slots
in the ring.
Therefore, this example is not as relevant as before and can be removed.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoexamples/l3fwd-vf: remove example
Bruce Richardson [Fri, 25 Oct 2019 09:56:05 +0000 (10:56 +0100)]
examples/l3fwd-vf: remove example

The main l3fwd app should work with both PF and VF devices, so remove the
VF-only l3fwd example.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoexamples/exception_path: remove example
Bruce Richardson [Fri, 25 Oct 2019 09:56:04 +0000 (10:56 +0100)]
examples/exception_path: remove example

The example app shows the use of TUN/TAP with DPDK, but DPDK has a built-in
TAP PMD, so this example is obsolete and so can be removed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agodoc: remove unnecessary sample app guide table
Ciara Power [Fri, 25 Oct 2019 09:56:03 +0000 (10:56 +0100)]
doc: remove unnecessary sample app guide table

The table of examples in the sample application guide is now removed,
as it was unnecessary and difficult to update when adding/removing
examples.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agonet/hns3: fix FLR reset
Chunsong Feng [Fri, 25 Oct 2019 12:37:05 +0000 (20:37 +0800)]
net/hns3: fix FLR reset

PF FLR resets the PCIe ECAM space of all VFs under the PF
and does not automatically recover. Therefore, the VF driver
needs to restore the ECAM configuration, including
bus_master_en, msix_enable to avoid FLR reset failure.

Fixes: 2790c6464725 ("net/hns3: support device reset")

Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
5 years agonet/hns3: fix error code for firmware timeout
Hongbo Zheng [Fri, 25 Oct 2019 12:37:04 +0000 (20:37 +0800)]
net/hns3: fix error code for firmware timeout

Configuration commands are sent to firmware for processing.
When firmware processing timeout, the corresponding error
code is returned. Considering that it is more reasonable to
use error code -ETIME for timeout error, the error code for
processing timeout is changed from -EBADE to -ETIME.

Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware")

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
5 years agonet/hns3: fix offload flag for RSS hash
Wei Hu (Xavier) [Fri, 25 Oct 2019 12:37:03 +0000 (20:37 +0800)]
net/hns3: fix offload flag for RSS hash

This patch adds PKT_RX_RSS_HASH flag to rx packet's ol_flags
to repair the bug that hns3 pmd driver doesn't set
PKT_RX_RSS_HASH flag. In hns3 network engine RSS is always
enabled.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
5 years agonet/hns3: fix statistics
Hao Chen [Fri, 25 Oct 2019 12:37:02 +0000 (20:37 +0800)]
net/hns3: fix statistics

This patch fixes the statistics problems for sending and receiving
message as belows:

1.In receiving direction, for FCS error messages, drivers should not
record them in rte_eth_stats.ipackets statistics.

2.In sending direction, for messages of illegal length, too long or
equals 0, drivers should not notify the network card hardware to
send them, should not continue to send the remaining message in burst,
and record them in rte_eth_stats.opackets statistics.

Fixes: 8839c5e202f3 ("net/hns3: support device stats")

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
5 years agonet/virtio: fix Tx checksum offloads
Andrew Rybchenko [Thu, 24 Oct 2019 17:46:09 +0000 (18:46 +0100)]
net/virtio: fix Tx checksum offloads

Missing parenthesis around expression before type cast to struct
virtio_net_hdr pointer makes the arithmetic to be in
sizeof(struct virtio_net_hdr) units.

Use rte_pktmbuf_mtod_offset() to fix the problem.

Type of head_size is changed to signed since some compilers bark
on unary minus applied to unsigned.

Fixes: 1ae55ad38e5e ("net/virtio: fix mbuf data and packet length mismatch")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/bnxt: uninit locks during resource cleanup
Venkat Duvvuru [Thu, 24 Oct 2019 07:44:32 +0000 (13:14 +0530)]
net/bnxt: uninit locks during resource cleanup

Currently, bnxt_uninit_locks is called inside bnxt_dev_uninit. However,
the more appropriate place to call it is inside bnxt_uninit_resources.
This is more logical, as all the resources uninitialization is happening
inside bnxt_uninit_resources.

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: fix memory leak
Kalesh AP [Thu, 24 Oct 2019 07:44:31 +0000 (13:14 +0530)]
net/bnxt: fix memory leak

During hot fw upgrade or error recovery, driver does cleanup and
reallocation of resources. But driver reallocates memory for ring
group info table without freeing the allocated memory during
device init.

Fix this memory leak by moving the freeing of ring group info table
to bnxt_free_mem() in bnxt_uninit_resources().

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
5 years agonet/bnxt: add wrapper function for Thor device check
Kalesh AP [Thu, 24 Oct 2019 07:44:30 +0000 (13:14 +0530)]
net/bnxt: add wrapper function for Thor device check

This patch adds a wrapper function bnxt_thor_device() which checks
for the pci device is Thor family.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
5 years agonet/bnxt: add PCI IDs for 57500 series NPAR devices
Kalesh AP [Thu, 24 Oct 2019 07:44:29 +0000 (13:14 +0530)]
net/bnxt: add PCI IDs for 57500 series NPAR devices

Add PCI IDs for 57500 series NPAR devices

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: add more checks during firmware reset
Kalesh AP [Thu, 24 Oct 2019 07:44:28 +0000 (13:14 +0530)]
net/bnxt: add more checks during firmware reset

Added check for fw reset or fw errors in few more routines.
While processing the events, if it is fw fatal or non-fatal
event, there is no need to process the remaining events as
driver triggers recovery mechanism.

Also added a check for fw reset or fatal error in bnxt_disable_int()
to avoid bar access in case of fatal error.

Fixes: be14720def9c ("net/bnxt: support FW reset")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix crash after removing and adding slaves
Santoshkumar Karanappa Rastapur [Thu, 24 Oct 2019 07:44:27 +0000 (13:14 +0530)]
net/bnxt: fix crash after removing and adding slaves

On removing the slave interface, slave_remove in bonding module calls
_rte_eth_dev_reset which in turn frees both Tx and Rx queues.
1. segfault is seen after removing/adding the slave interface and starting
bond interface.
In this below path, when mtu is set for the slave interface, queues are
not created yet and driver reference to queue[0] causes the segfault.
slave_configure:
rte_eth_dev_set_mtu
rte_eth_dev_configure
rte_eth_rx_queue_setup

2. segfault is seen on starting the port after removing from bond device.
This is a testpmd bug where in, on starting the port, testpmd is supposed
to recreate the queues before starting the port.

Fixed these by adding check for queues created before accessing them.

Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix MAC address check in flow validation
Somnath Kotur [Thu, 24 Oct 2019 07:44:26 +0000 (13:14 +0530)]
net/bnxt: fix MAC address check in flow validation

Add another check to flag zero mac address while validating/parsing
the flow arguments

Fixes: 407244800389 ("net/bnxt: allow only unicast MAC address filter creation")

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
5 years agonet/bnxt: expose some missing counters in port stats
Somnath Kotur [Thu, 24 Oct 2019 07:44:25 +0000 (13:14 +0530)]
net/bnxt: expose some missing counters in port stats

Rx/Tx Port statistics record PFC enabled frames for each priority.
Modify the Rx/Tx port stats array to report these as well.

Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
Cc: stable@dpdk.org
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: fix filter type for non-ntuple flows
Rahul Gupta [Thu, 24 Oct 2019 07:44:24 +0000 (13:14 +0530)]
net/bnxt: fix filter type for non-ntuple flows

Use HWRM_CFA_L2_FILTER filter_type, as its checked during SRC MAC
filter creation in bnxt_create_l2_filter().

Fixes: afef822b2e1b ("net/bnxt: support creating SMAC and inner DMAC filters")

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix race between start and interrupt handler
Kalesh AP [Thu, 24 Oct 2019 07:44:23 +0000 (13:14 +0530)]
net/bnxt: fix race between start and interrupt handler

During port start, driver enables interrupts. At the end of port start
driver schedules the alarm for fw health check. This can cause race
between interrupt handler and schedule fw health check alarm thread
which falsely detects FW error.

Fixes: 9d0cbaecc91a ("net/bnxt: support periodic FW health monitoring")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix default MAC check
Venkat Duvvuru [Thu, 24 Oct 2019 07:44:22 +0000 (13:14 +0530)]
net/bnxt: fix default MAC check

bnxt_set_hwrm_vnic_filters programs default mac addr and the
same default mac is added by mac_add_addr_op routine as well.
This redundant mac add is avoided by checking if the default
mac is already added.

However, that check is wrong. The check should consider the
mac index as well to determine the default mac. This patch
fixes it by using mac index to determine the default mac.

Fixes: 68f589f2c728 ("net/bnxt: fix setting primary MAC address")
Cc: stable@dpdk.org
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: update HWRM API to version 1.10.1.6
Ajit Khaparde [Thu, 24 Oct 2019 07:44:21 +0000 (13:14 +0530)]
net/bnxt: update HWRM API to version 1.10.1.6

Update HWRM API to version 1.10.1.6

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
5 years agonet/bnxt: fix RSS configuration for Thor controller
Santoshkumar Karanappa Rastapur [Thu, 24 Oct 2019 07:44:20 +0000 (13:14 +0530)]
net/bnxt: fix RSS configuration for Thor controller

rss_table structure stores receive, completion ring IDs for Thor based
controllers and receive queue id for others. Below commit accidentally
left the old code and hence was always overwriting receive ring id with
queue id for Thor. This causes subsequent VNIC_RSS_CFG command to fail.

Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix writing MTU to FW
Ajit Khaparde [Thu, 24 Oct 2019 07:44:19 +0000 (13:14 +0530)]
net/bnxt: fix writing MTU to FW

We are currently writing the MAX supported MTU size even though
the MTU passed by the application is a different value.
Configure the application specified MTU instead.

Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: fix setting max RSS contexts
Ajit Khaparde [Thu, 24 Oct 2019 07:44:18 +0000 (13:14 +0530)]
net/bnxt: fix setting max RSS contexts

Configure max RSS contexts in case the firmware indicates a maximal
resource reservation strategy.

Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: fix ping with MTU change
Santoshkumar Karanappa Rastapur [Thu, 24 Oct 2019 07:44:17 +0000 (13:14 +0530)]
net/bnxt: fix ping with MTU change

Driver was setting maximum receive unit differently in bnxt_mtu_set_op
and bnxt_hwrm_vnic_alloc. Moreover firmware adds the 4 bytes for FCS.
Fixed it by setting correct maximum receive unit value.

Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: fix check while freeing filter
Kalesh AP [Thu, 24 Oct 2019 07:44:16 +0000 (13:14 +0530)]
net/bnxt: fix check while freeing filter

This patch fixes the coverity UNUSED_VALUE issue.

Coverity issue: 349938
Fixes: 49d0709b257f ("net/bnxt: delete and flush L2 filters cleanly")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agoraw/ifpga/base: fix dereference before null check
Tianfei Zhang [Tue, 17 Sep 2019 22:24:59 +0000 (06:24 +0800)]
raw/ifpga/base: fix dereference before null check

Add pointer null check before dereference.

Coverity issue: 344976
Fixes: 12f92a513a13 ("raw/ifpga/base: fix retimer link status")
Cc: stable@dpdk.org
Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
5 years agoapp/testpmd: support multiple raw encap/decap
Xiaoyu Min [Mon, 16 Sep 2019 09:21:02 +0000 (17:21 +0800)]
app/testpmd: support multiple raw encap/decap

In some scenarios, the raw_encap/raw_decap actions could be multiple in
one single flow (e,g. hirepin flow):

  ... actions raw_decap / raw_encap / raw_decap / raw_encap / ...

This requires the testpmd supports multiple raw_encap/raw_decap data
settings as well.

With the multiple raw_encap/raw_decap settings, the testpmd commands –
set raw_encap / set raw_decap will become:

  set raw_encap <index> <item pattern>
  set raw_decap <index> <item pattern>

And the actions – raw_encap/raw_decap also could optionally choose which
global raw_encap/raw_decap confs to be used by index:

  ... actions raw_decap index 1 / raw_encap index 2 / ...

If there is no `index` specified, the default index is 0:

  set raw_encap <item pattern>
  ... actions raw_decap / raw_encap / ...

which will use raw_encap index 0.

In addition to the set raw_encap/raw_decap commands,

  show <raw_encap/raw_decap> <index>
  show <raw_encap/raw_decap> all

are also introduced into in order to check which index is set and to
what.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
5 years agoapp/testpmd: fix Tx checksum when TSO enabled
Peng Huang [Thu, 24 Oct 2019 09:37:34 +0000 (09:37 +0000)]
app/testpmd: fix Tx checksum when TSO enabled

This patch fixed the TX checksum value problem when enabled TSO in
tunnel packets, because outer UDP checksum calculation depend on
the TSO configuration.

Fixes: 0f62d63593ed ("app/testpmd: support tunneled TSO in checksum engine")
Cc: stable@dpdk.org
Signed-off-by: Peng Huang <peng.huang@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agonet/mlx: fix debug build with icc
Raslan Darawsheh [Wed, 23 Oct 2019 11:31:45 +0000 (11:31 +0000)]
net/mlx: fix debug build with icc

Trying to compile mlx5 pmd in debug mode with icc
will lead to compilation failures due to the fact that
icc doesn't have support for the pragma of pedantic.

Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
5 years agovhost: fix IPv4 checksum
Flavio Leitner [Thu, 24 Oct 2019 16:29:19 +0000 (13:29 -0300)]
vhost: fix IPv4 checksum

Currently the IPv4 header checksum is calculated including its
current value, which can be a valid checksum or just garbage.
In any case, if the original value is not zero, then the result
is always wrong.

The IPv4 checksum is defined in RFC791, page 14 says:
  Header Checksum:  16 bits

  The checksum algorithm is:
  The checksum field is the 16 bit one's complement of the one's
  complement sum of all 16 bit words in the header.  For purposes of
  computing the checksum, the value of the checksum field is zero.

Thus force the csum field to always be zero.

Fixes: b08b8cfeb2ae ("vhost: fix IP checksum")
Cc: stable@dpdk.org
Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agoexamples: delete vhost SCSI example
Jin Yu [Thu, 24 Oct 2019 10:21:59 +0000 (18:21 +0800)]
examples: delete vhost SCSI example

This example is too old and SPDK will not maintain this example
anymore. Also SPDK has submitted a new vhost example vhost-blk.
We will keep on maintaining vhost-blk and It shows the packed
ring and live recovery support.

Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: reject unsupported Tx multi-queue modes
Andrew Rybchenko [Wed, 9 Oct 2019 12:32:08 +0000 (13:32 +0100)]
net/virtio: reject unsupported Tx multi-queue modes

This driver supports none of DCB or VMDQ modes, therefore must
check and return error if configured incorrectly.

Fixes: c1f86306a026 ("virtio: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: reject unsupported Rx multi-queue modes
Dilshod Urazov [Wed, 9 Oct 2019 12:32:07 +0000 (13:32 +0100)]
net/virtio: reject unsupported Rx multi-queue modes

This driver supports none of DCB, RSS or VMDQ modes, therefore must
check and return error if configured incorrectly.

Virtio can distribute Rx packets across multi-queue, but there is
no controls (algorithm, redirection table, hash function) except
number of Rx queues and ETH_MQ_RX_NONE is the best fit meaning
no method is enforced on how to route packets to MQs.

Fixes: c1f86306a026 ("virtio: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: reject deferred Tx start
Dilshod Urazov [Wed, 9 Oct 2019 12:32:06 +0000 (13:32 +0100)]
net/virtio: reject deferred Tx start

Deferred start Tx queue is not supported by the driver.

Fixes: 0748be2cf9a2 ("ethdev: queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: reject deferred Rx start
Dilshod Urazov [Wed, 9 Oct 2019 12:32:05 +0000 (13:32 +0100)]
net/virtio: reject deferred Rx start

Deferred start Rx queue is not supported by the driver.

Fixes: 0748be2cf9a2 ("ethdev: queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: disable host TSO for linear buffers without extbuf
Ilya Maximets [Thu, 17 Oct 2019 15:00:19 +0000 (17:00 +0200)]
vhost: disable host TSO for linear buffers without extbuf

If linear buffers requested and external buffers are not, vhost
will not be able to receive any buffer that doesn't fit in a
single mbuf.  Moreover, if such a buffer will appear in a vring
it will never be dequeued and the whole vring will become dead
breaking the network connection.

Disable segmentation offloading from the host side to avoid
having such a big buffers.

Fixes: c3ff0ac70acb ("vhost: improve performance by supporting large buffer")

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: return error message for mbuf allocation failure
Ilya Maximets [Wed, 16 Oct 2019 14:31:07 +0000 (16:31 +0200)]
vhost: return error message for mbuf allocation failure

mbuf allocation failure is a hard failure that highlights some
significant issues with memory pool size or a mbuf leak.

We still have the message for subsequent chained mbufs, but not
for the first one.  It was removed while introducing extbuf
support for large buffers.  But it was useful for catching
mempool issues and needs to be returned back.

Fixes: c3ff0ac70acb ("vhost: improve performance by supporting large buffer")

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Flavio Leitner <fbl@sysclose.org>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: optimize packed ring dequeue when in-order
Marvin Liu [Thu, 24 Oct 2019 16:08:32 +0000 (00:08 +0800)]
vhost: optimize packed ring dequeue when in-order

When VIRTIO_F_IN_ORDER feature is negotiated, vhost can optimize dequeue
function by only update first used descriptor.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: optimize packed ring dequeue
Marvin Liu [Thu, 24 Oct 2019 16:08:31 +0000 (00:08 +0800)]
vhost: optimize packed ring dequeue

Optimize vhost device packed ring dequeue function by splitting batch
and single functions. No-chained and direct descriptors will be handled
by batch and other will be handled by single as before.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: add packed ring zcopy batch and single dequeue
Marvin Liu [Thu, 24 Oct 2019 16:08:30 +0000 (00:08 +0800)]
vhost: add packed ring zcopy batch and single dequeue

Add vhost packed ring zero copy batch and single dequeue functions like
normal dequeue path.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: optimize packed ring enqueue
Marvin Liu [Thu, 24 Oct 2019 16:08:29 +0000 (00:08 +0800)]
vhost: optimize packed ring enqueue

Optimize vhost device packed ring enqueue function by splitting batch
and single functions. Packets can be filled into one desc will be
handled by batch and others will be handled by single as before.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: update packed ring dequeue
Marvin Liu [Thu, 24 Oct 2019 16:08:28 +0000 (00:08 +0800)]
vhost: update packed ring dequeue

Buffer used ring updates as many as possible in vhost dequeue function
for coordinating with virtio driver. For supporting buffer, shadow used
ring element should contain descriptor's flags. First shadowed ring
index was recorded for calculating buffered number.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: flush batched enqueue descs directly
Marvin Liu [Thu, 24 Oct 2019 16:08:27 +0000 (00:08 +0800)]
vhost: flush batched enqueue descs directly

Flush used elements when batched enqueue function is finished.
Descriptor's flags are pre-calculated as they will be reset by vhost.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: flush enqueue updates by cacheline
Marvin Liu [Thu, 24 Oct 2019 16:08:26 +0000 (00:08 +0800)]
vhost: flush enqueue updates by cacheline

Buffer vhost packed ring enqueue updates, flush ring descs if buffered
content filled up one cacheline. Thus virtio can receive packets at a
faster frequency.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: add packed ring batch dequeue
Marvin Liu [Thu, 24 Oct 2019 16:08:25 +0000 (00:08 +0800)]
vhost: add packed ring batch dequeue

Add batch dequeue function like enqueue function for packed ring, batch
dequeue function will not support chained descriptors, single packet
dequeue function will handle it.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>