dpdk.git
5 years agogro: check invalid TCP header length
Jiayu Hu [Wed, 16 Jan 2019 00:45:33 +0000 (08:45 +0800)]
gro: check invalid TCP header length

When the TCP header length of input packets is invalid (i.e., less
than 20 bytes or greater than 60 bytes), check_seq_option() will
access illegal memory area when compare TCP Options, which may
cause a segmentation fault.

This patch adds missing invalid TCP header length check to avoid
illegal memory accesses.

Fixes: 0d2cbe59b719 ("lib/gro: support TCP/IPv4")
Fixes: 9e0b9d2ec0f4 ("gro: support VxLAN GRO")
Cc: stable@dpdk.org
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoapp/pdump: fix vdev cleanup
Reshma Pattan [Tue, 15 Jan 2019 13:45:04 +0000 (13:45 +0000)]
app/pdump: fix vdev cleanup

Virtual devices added in pdump application
using rte_eal_hotplug_add should be removed explicitly
while exiting the pdump application, otherwise the
subsequent run of the pdump application will fail with the reason
that virtual devices with the same name already exists in primary.

Fixes: 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agopower: fix file descriptor leak
Liang Ma [Tue, 15 Jan 2019 10:01:37 +0000 (10:01 +0000)]
power: fix file descriptor leak

Coverity issue: 328528
Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")

Signed-off-by: Liang Ma <liang.j.ma@intel.com>
Reviewed-by: Lei Yao <lei.a.yao@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agobuild: fix meson check for binutils 2.30
Harry van Haaren [Thu, 17 Jan 2019 17:17:44 +0000 (17:17 +0000)]
build: fix meson check for binutils 2.30

This commit reworks the checks for binutils 2.30 and how
the flags to disable AVX512F are passed to the compiler.

Previously the #define for including AVX512 code was set,
while the -mno-avx512f argument was given to the compiler.
This would cause gcc to correctly refuse to emit AVX512
instructions, but the rte_memcpy code that includes AVX512
optimizations was being added to the build.

The check for binutils check is now moved to x86 as it is
irrelevant for other architectures, and the -mno-avx512f
flag is passed to a march_opts array in meson. As the
-mno-avx512 flag is added earlier in the build, the code
in rte_memcpy is no longer attempted to be compiled.

This commit also adds a message print in the meson configure
stage to alert the user of the workaround being employed.

Fixes: a32ca9a4ebc1 ("mk: fix scope of disabling AVX512F support")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoeal: fix clang build with intrinsics forced
Ilya Maximets [Tue, 15 Jan 2019 11:29:39 +0000 (14:29 +0300)]
eal: fix clang build with intrinsics forced

This fixes x86_64-native-linuxapp-clang build with
CONFIG_RTE_FORCE_INTRINSICS=y:

    include/generic/rte_atomic.h:218:9: error:
        implicit declaration of function '__atomic_exchange_2'
        is invalid in C99 [-Werror,-Wimplicit-function-declaration]

    include/generic/rte_atomic.h:501:9: error:
        implicit declaration of function '__atomic_exchange_4'
        is invalid in C99 [-Werror,-Wimplicit-function-declaration]

    include/generic/rte_atomic.h:783:9: error:
        implicit declaration of function '__atomic_exchange_8'
        is invalid in C99 [-Werror,-Wimplicit-function-declaration]

We didn't caught this issue previously on other platforms because
CONFIG_RTE_FORCE_INTRINSICS enabled by default only for armv8.

Fixes: 7bdccb93078e ("eal: fix ARM build with clang")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
5 years agoeal: check string parameter lengths
Anatoly Burakov [Wed, 16 Jan 2019 12:12:53 +0000 (12:12 +0000)]
eal: check string parameter lengths

When specifying parameters such as hugefile prefix from the
command-line, it is possibly to supply an empty string. This may
lead to various problems: for example, if hugefile prefix is
empty, the runtime config path construction may end up
looking like "/var/run/dpdk//_config", which will technically
work, but is wrong and places files in the wrong place.

To fix it, check lengths of such user-specified parameters for
hugefile prefix, as well as hugepage dir and user-specified
mbuf pool ops string.

Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoeal: fix out of bound access when no CPU available
David Marchand [Thu, 17 Jan 2019 13:12:57 +0000 (14:12 +0100)]
eal: fix out of bound access when no CPU available

In the unlikely case when the dpdk application is started with no cpu
available in the [0, RTE_MAX_LCORE - 1] range, the master_lcore is
automatically chosen as RTE_MAX_LCORE which triggers an out of bound
access.

Either you have a crash then, or the initialisation fails later when
trying to pin the master thread on it.
In my test, with RTE_MAX_LCORE == 2:

$ taskset -c 2 ./master/app/testpmd --no-huge -m 512 --log-level *:debug
[...]
EAL: pthread_setaffinity_np failed
PANIC in eal_thread_init_master():
cannot set affinity
7: [./master/app/testpmd() [0x47f629]]

Bugzilla ID: 19
Fixes: 2eba8d21f3c9 ("eal: restrict cores auto detection")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: fix core number validation
Hari Kumar Vemula [Thu, 17 Jan 2019 12:13:12 +0000 (12:13 +0000)]
eal: fix core number validation

When incorrect core value or range provided,
as part of -l command line option, a crash occurs.

Added valid range checks to fix the crash.

Added ut check for negative core values.
Added unit test case for invalid core number range.

Fixes: d888cb8b9613 ("eal: add core list input format")
Cc: stable@dpdk.org
Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoversion: 19.02-rc2
Thomas Monjalon [Tue, 15 Jan 2019 02:08:43 +0000 (03:08 +0100)]
version: 19.02-rc2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoexamples/vhost: fix a typo
Rami Rosen [Mon, 14 Jan 2019 14:47:47 +0000 (16:47 +0200)]
examples/vhost: fix a typo

This minor patch fixes a typo in examples/vhost/main.c.

Fixes: d19533e86f1d ("examples/vhost: copy old vhost example")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
5 years agoexamples/tep_term: remove unused constant
Rami Rosen [Sun, 13 Jan 2019 15:02:12 +0000 (17:02 +0200)]
examples/tep_term: remove unused constant

The  definition of MAX_PRINT_BUFF in examples/tep_termination/main.c
is not necessary as it is not used. This cleanup patch removes it.

Fixes: a50245ede72a ("examples/tep_term: initialize VXLAN sample")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
5 years agoexamples/ip_fragmentation: support big packets
Noa Ezra [Sun, 13 Jan 2019 11:37:06 +0000 (11:37 +0000)]
examples/ip_fragmentation: support big packets

In some vendors the RX and TX configuration must be the same, therefore
the MTU size need to be equal to max_rx_pkt_len.
The MTU is the largest size packet in bytes that can be sent on the
network, therefore before changing this parameter, the NIC could not
receive packets larger than 1500 bytes, which is the default MTU size.
In addition, scatter-gather need to be enabled in order to receive
frames bigger than mbuf size.

Signed-off-by: Noa Ezra <noae@mellanox.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agotest/hash: fix perf result
Dharmik Thakkar [Mon, 14 Jan 2019 09:23:04 +0000 (03:23 -0600)]
test/hash: fix perf result

Reset 'iter' and 'tbl_rw_test_param.found' on each iteration
to give correct result for lost and duplicated keys.

This patch also changes the default return value of the test to -1
when not enough resources are provided.

Fixes: 0eb3726ebcf14 ("test/hash: add test for read/write concurrency")
Cc: stable@dpdk.org
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Yipeng Wang <yipeng1.wang@intel.com>
5 years agodoc: fix a typo in power management guide
Yong Wang [Mon, 7 Jan 2019 09:10:47 +0000 (04:10 -0500)]
doc: fix a typo in power management guide

This patch fixes a typo in programmer's guide. It should be Frequency,
not Fequence.

Fixes: 450f0791312c ("power: add traffic pattern aware power control")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
5 years agoexamples/power: fix core id with JSON commands
David Hunt [Mon, 7 Jan 2019 11:39:20 +0000 (11:39 +0000)]
examples/power: fix core id with JSON commands

This patch fixes a bug introduced in the 64-core limitation
enhancement where the core_id is inadvertently converted from
virtual to physical even though it may already be a physical
core_id.

We should be using the core_type field, and only converting via
hypervisor when core_type is set to CORE_TYPE_VIRTUAL

Fixes: 5776b7a371d1 ("examples/power: allow VM to use lcores over 63")

Signed-off-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Lei Yao <lei.a.yao@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
5 years agoexamples/power: fix for p-state
David Hunt [Tue, 8 Jan 2019 15:25:23 +0000 (15:25 +0000)]
examples/power: fix for p-state

The vm_power_manager starts by setting the environment to acpi
using rte_power_set_env(PM_ENV_ACPI_CPUFREQ). This causes a problem
starting vm_power_manager when the system is using the intel_pstate
driver. The env should be set to none, or not called at all, because
the library now auto-detects the environment to be either acpi or
intel_pstate. This patch sets the environment to none so that the
library can successfully auto-detect.

Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")

Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agotest/power: handle p-state mode
David Hunt [Mon, 7 Jan 2019 14:40:51 +0000 (14:40 +0000)]
test/power: handle p-state mode

The cpufreq test breakes when the system is using the intel_pstate
driver for frequency management. The power library has recentyly been
updated to allow use of the intel_pstate driver, this patch fixes the
cpufreq test so that it can now use either acpi or pstate modes.
The library will auto-detect, and set the environment appropriately.

Fixes: ed7c51a6a680 ("app/test: vm power management")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agopower: fix frequency list return code
David Hunt [Mon, 7 Jan 2019 14:40:23 +0000 (14:40 +0000)]
power: fix frequency list return code

The power_pstate_cpufreq_freqs() function was returning -1 in an
unsigned int, causing buffer over-runs when the results were being
processed. This function should be returning zero for all error
conditions, similar to it's acpi relation, power_acpi_cpufreq_freqs().

Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")

Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agopower: fix frequency list to handle null buffer
David Hunt [Mon, 7 Jan 2019 14:39:34 +0000 (14:39 +0000)]
power: fix frequency list to handle null buffer

This patch fixes a segfault in the case where a null buffer is passed
to the following functions:
   power_acpi_cpufreq_freqs()
   power_pstate_cpufreq_freqs()

Fixes: 445c6528b55f ("power: common interface for guest and host")

Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agopower: fix error handling on setting governor
David Hunt [Tue, 8 Jan 2019 14:59:26 +0000 (14:59 +0000)]
power: fix error handling on setting governor

In the power_set_governor_*() functions, we using fputs() on /sys
filesystem. However, we also need to call fflush() to ensure that
the write completes successfully. Otherwise the attempt to set the
power governor fails and the function returns as if it has
succeeded. This patch adds an fflush to ensure that the
write succeeds, otherwise returns an error.

Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")

Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agoipsec: fix build with gcc 6
Konstantin Ananyev [Mon, 14 Jan 2019 15:58:03 +0000 (15:58 +0000)]
ipsec: fix build with gcc 6

gcc 6.2 and 6.4 fails to compile lib/librte_ipsec/sa.c
with the following errors:
lib/librte_ipsec/sa.c:
 In function inline_outb_tun_pkt_process:
 x86_64-native-linuxapp-gcc/include/rte_memcpy.h:337:2:
 error: array subscript is above array bounds [-Werror=array-bounds]
  rte_mov32((uint8_t *)dst + 1 * 32, (const uint8_t *)src + 1 * 32);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ...

It complains about the following lines of code:
esp_outb_tun_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t
        ....
        /* update spi, seqn and iv */
        esph = (struct esp_hdr *)(ph + sa->hdr_len);
        iv = (uint64_t *)(esph + 1);
        rte_memcpy(iv, ivp, sa->iv_len);

While I believe it is a false positive,
it is too excessive to use rte_memcpy() here,
as IV length could be only 0/8/16 bytes.
So introduce small helper function to copy IV and use it
instead of rte_memcpy().

Fixes: 4d7ea3e1459b ("ipsec: implement SA data-path API")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoeal: return error when option register fails
Gaetan Rivet [Thu, 20 Dec 2018 17:06:47 +0000 (18:06 +0100)]
eal: return error when option register fails

Make rte_option_register return a negative value when
an error occur.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: improve option API documentation
Gaetan Rivet [Thu, 20 Dec 2018 17:06:46 +0000 (18:06 +0100)]
eal: improve option API documentation

Use doxygen to describe the main structure and describe a little more
why it exists.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: fix log level of error in option register
Gaetan Rivet [Thu, 20 Dec 2018 17:06:45 +0000 (18:06 +0100)]
eal: fix log level of error in option register

INFO is not correct when logging an error.

Fixes: 2395332798d0 ("eal: add option register infrastructure")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: check against common option on register
Gaetan Rivet [Thu, 20 Dec 2018 17:06:44 +0000 (18:06 +0100)]
eal: check against common option on register

Not only check against other registered options, but also common EAL
options. This will mitigate user confusion.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: rename option name field
Gaetan Rivet [Thu, 20 Dec 2018 17:06:43 +0000 (18:06 +0100)]
eal: rename option name field

option->opt_* is redundant.
The field should also be constant.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: add option usage string
Gaetan Rivet [Thu, 20 Dec 2018 17:06:42 +0000 (18:06 +0100)]
eal: add option usage string

Add a usage string field in rte_option, allowing to display
help to the user and describe which options are currently available.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: do not use static option iterator
Gaetan Rivet [Thu, 20 Dec 2018 17:06:41 +0000 (18:06 +0100)]
eal: do not use static option iterator

This is rather weird. Someone should have caught that during review.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: use bare option string as name
Gaetan Rivet [Thu, 20 Dec 2018 17:06:40 +0000 (18:06 +0100)]
eal: use bare option string as name

Current options name can be passed with arbitrary format.
Force the use of "--" prefix and thus POSIX long options format.

This restricts the ability to introduce surprising options and will help
future additional checks.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/mlx5: fix instruction hotspot on replenishing Rx buffer
Yongseok Koh [Mon, 14 Jan 2019 21:16:22 +0000 (13:16 -0800)]
net/mlx5: fix instruction hotspot on replenishing Rx buffer

On replenishing Rx buffers for vectorized Rx, mbuf->buf_addr isn't needed
to be accessed as it is static and easily calculated from the mbuf address.
Accessing the mbuf content causes unnecessary load stall and it is worsened
on ARM.

Fixes: 545b884b1da3 ("net/mlx5: fix buffer address posting in SSE Rx")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agombuf: add function returning buffer address
Yongseok Koh [Mon, 14 Jan 2019 21:16:21 +0000 (13:16 -0800)]
mbuf: add function returning buffer address

This patch introduces two new functions - rte_mbuf_buf_addr() and
rte_mbuf_data_addr_default().

rte_mbuf_buf_addr() reutrns the buffer address of given mbuf which comes
after mbuf structure and private data.

rte_mbuf_data_addr_default() returns the default address of mbuf data
taking the headroom into account.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoapp/testpmd: check mbufs in verbose mode
David Marchand [Mon, 7 Jan 2019 08:57:12 +0000 (09:57 +0100)]
app/testpmd: check mbufs in verbose mode

Let's check the received/sent mbufs, it can help debugging.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agombuf: add a non fatal sanity check helper
David Marchand [Mon, 7 Jan 2019 08:57:11 +0000 (09:57 +0100)]
mbuf: add a non fatal sanity check helper

Let's add a little helper that does the same as rte_mbuf_sanity_check but
without the panic.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
5 years agombuf: add sanity checks on segment metadata
David Marchand [Mon, 7 Jan 2019 08:57:10 +0000 (09:57 +0100)]
mbuf: add sanity checks on segment metadata

Add some basic checks on the segments offset and length metadata:
always funny to have a < 0 tailroom cast to uint16_t ;-).

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
5 years agodrivers: fix sprintf with snprintf
Pallantla Poornima [Mon, 7 Jan 2019 10:46:23 +0000 (10:46 +0000)]
drivers: fix sprintf with snprintf

sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used

Fixes: 828d51d8fc ("bus/fslmc: refactor scan and probe functions")
Fixes: c22fab9a6c ("raw/dpaa2_qdma: support configuration APIs")
Fixes: e5cbdfc537 ("crypto/dpaa2_sec: add basic operations")
Fixes: b23d4e898a ("crypto/dpaa2_sec: add per dev mempool to store FLE")
Fixes: 623326dded ("crypto/dpaa2_sec: introduce poll mode driver")
Fixes: e7a45f3cc2 ("crypto/caam_jr: add UIO specific operations")
Fixes: f44bccadd8 ("crypto/caam_jr: add device basic operations")
Fixes: 7e3e2954e0 ("crypto/dpaa_sec: move mempool allocation to config")
Fixes: c3e85bdcc6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agonet/nfp: add CPP bridge as service
Alejandro Lucero [Fri, 11 Jan 2019 13:25:53 +0000 (13:25 +0000)]
net/nfp: add CPP bridge as service

The Netronome's Network Flow Processor chip is highly programmable
with the goal of processing packets at high speed. Processing units
and other chip components are available from the host through the
PCIe CPP(Command Push Pull bus) interface. The NFP PF PMD configures
a CPP handler for setting up and working with vNICs, perform actions
like link up or down, or accessing extended stats from the MAC component.

There exist NFP host tools which access the NFP components for
programming and debugging but they require the CPP interface. When the
PMD is bound to the PF, the DPDK app owns the CPP interface, so these
host tools can not access the NFP through other means like NFP kernel
drivers.

This patch adds a CPP bridge using the rte_service API which can be
enabled by a DPDK app. Interestingly, DPDK clients like OVS will not
enable specific service cores, but this can be performed with a
secondary process specifically enabling this CPP bridge service and
therefore giving access to the NFP to those host tools.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/enic: remove redundant log level check
Hyong Youb Kim [Mon, 14 Jan 2019 15:01:22 +0000 (07:01 -0800)]
net/enic: remove redundant log level check

Fixes: 8d496995346c ("net/enic: support multicast filtering")
Cc: stable@dpdk.org
Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: remove useless include
Hyong Youb Kim [Mon, 14 Jan 2019 15:01:21 +0000 (07:01 -0800)]
net/enic: remove useless include

libgen.h is not used, so do not include it.

Fixes: fefed3d1e62c ("enic: new driver")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/mlx5: validate TOS and TTL on E-Switch
Viacheslav Ovsiienko [Sun, 13 Jan 2019 14:15:24 +0000 (14:15 +0000)]
net/mlx5: validate TOS and TTL on E-Switch

This patch adds the type-of-service and time-to-live IP header
fields validation on E-Switch, both for match pattern and
VXLAN encapsulation action IP header itesm. The E-Switch flows
will use the common mlx5_flow_validate_item_ipv4/6 routines
with added extra parameter, specifying the supported fields
mask.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: support TOS and TTL fields on E-Switch
Viacheslav Ovsiienko [Sun, 13 Jan 2019 14:15:23 +0000 (14:15 +0000)]
net/mlx5: support TOS and TTL fields on E-Switch

This patch adds the type-of-service and time-to-live IP header
fields support on E-Switch. There match pattern for both fields
with masking is added. Also these fields can be set for VXLAN
tunnel encapsulation header.

This issue is critical for some Open VSwitch configuration
on overlayed (tunneled) networks, where the tos field can be
inherited from outer header to inner header.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add TOS and TTL flower match and tunnel keys
Viacheslav Ovsiienko [Sun, 13 Jan 2019 14:15:22 +0000 (14:15 +0000)]
net/mlx5: add TOS and TTL flower match and tunnel keys

This patch is a preparation for adding the type-of-service and
time-to-live IP header fields support on E-Switch. There are
two types of keys added - one for match pattern, other for
tunnel encapsulation header.

This issue is critical for some Open VSwitch configuration
on overlayed (tunneled) networks, where the tos field can be
inherited from outer header to inner header.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add RHEL-7.2 VXLAN device metadata workaround
Viacheslav Ovsiienko [Sat, 29 Dec 2018 19:55:40 +0000 (19:55 +0000)]
net/mlx5: add RHEL-7.2 VXLAN device metadata workaround

RH7.2 with kernel 3.10.0-327 does not support VXLAN
devices metadata and IFLA_VXLAN_COLLECT_METADATA
key is neither defined nor supported. We must specify
VNI parameter, which will be actually ignored by kernel,
applied rules will be processed by mlx5 kernel driver
and the actual VNI from rules will be used.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: switch to detached VXLAN network devices
Viacheslav Ovsiienko [Sat, 29 Dec 2018 19:55:39 +0000 (19:55 +0000)]
net/mlx5: switch to detached VXLAN network devices

Current design uses the VXLAN virtual devices attached
to outer network interface for decapsulation. Kernel
allows to use non-attached devices, so now we can create
not attached device and use it both for encapsulation
and decapsulation. Devices management becomes simpler,
less VXLAN devices are created and used.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: switch encap rules to use container
Viacheslav Ovsiienko [Sat, 29 Dec 2018 19:55:38 +0000 (19:55 +0000)]
net/mlx5: switch encap rules to use container

The VXLAN encapsulation neigh/local rules will use
the new introduced structure, which keeps the
rules lists, related to specified outer interface,
instead of attached VTEP structure. It allows us to
unbind VTEP structure from keeping the rules for
interface.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: introduce encapsulation rules container
Viacheslav Ovsiienko [Sat, 29 Dec 2018 19:55:37 +0000 (19:55 +0000)]
net/mlx5: introduce encapsulation rules container

Currently the VXLAN encapsulation neigh/local rules
are stored in the list contained in the VTEP device
structure. Encapsulation VTEP device is attached to
outer interface and stored rules are related to this
underlying interface. We are going to use unattached
VXLAN devices for encapsulation (kernel does not use
attached interface to find egress one), so we should
introduce the structure to keep interface related
neigh/local rules instead of VTEP structure. This
patch introduces internal tcf_irule structure, and
its create/delete methods.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: optimize neigh and local encap rules search
Viacheslav Ovsiienko [Sat, 29 Dec 2018 19:55:36 +0000 (19:55 +0000)]
net/mlx5: optimize neigh and local encap rules search

This patch removes unnecessary local varialbles and optimizes
local and neigh encapsulation rules search.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix typos and code style
Viacheslav Ovsiienko [Sat, 29 Dec 2018 19:45:12 +0000 (19:45 +0000)]
net/mlx5: fix typos and code style

This patch fixes typos and codestyle issues in mlx5_flow_tcf.c file

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: support ethernet type for tunnels on E-Switch
Viacheslav Ovsiienko [Thu, 27 Dec 2018 15:34:45 +0000 (15:34 +0000)]
net/mlx5: support ethernet type for tunnels on E-Switch

This patch add support for inner and outer ethernet types for the
E-Switch Flows with tunnels. Inner and outer ethernet type match
can be specified with ethernet items, vlan items, or implicitly
deduced from IP address items. The tcm_info field in Netlink message
tcm structure is filled always with outer protocol.

Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: validate ethernet type on E-Switch
Viacheslav Ovsiienko [Thu, 27 Dec 2018 15:34:44 +0000 (15:34 +0000)]
net/mlx5: validate ethernet type on E-Switch

This patch updates the validation routine for the E-Switch Flows.
The ethernet type field can be specified within inner and outer
tunnel ethernet items, by vlan item or implicitly deduced from
IP address items. The validation routine checks all these items
and their combinations for mutual compatibility issues and possible
conflicts.

Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: support tunnel inner items on E-Switch
Viacheslav Ovsiienko [Thu, 27 Dec 2018 15:34:43 +0000 (15:34 +0000)]
net/mlx5: support tunnel inner items on E-Switch

This patch updates the translation routine for the E-Switch Flows.
Inner tunnel pattern items are translated into Netlink message,
support for tunnel inner IP addresses (v4 or v6), IP protocol,
and TCP and UDP ports is added.

We are going to support Flows matching with outer tunnel items
and not containing the explicit tunnel decap action (this one
might be drop, redirect or table jump, for exapmle).
So we can not rely on presence of tunnel decap action in the
list to decide whether the Flow is for tunnel, instead we will
use the presence of tunnel item. Item translation is rebound
to presence of tunnel items, instead of relying on decap action.

There is no way to tell kernel driver the outer address type
(IPv4 or IPv6) but specify the address flower key. The outer
address key is put on Netlink with zero mask if there is no
RTE item is specified in the list.

Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: validate tunnel inner items on E-Switch
Viacheslav Ovsiienko [Thu, 27 Dec 2018 15:34:42 +0000 (15:34 +0000)]
net/mlx5: validate tunnel inner items on E-Switch

This patch updates the validation routine for the E-Switch Flows.
The inner/outer item flags are added and set correctly, the
validation routine will accept and check the inner items
which follow the tunnel item (like VNI).

Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: remove checks for outer tunnel items on E-Switch
Viacheslav Ovsiienko [Thu, 27 Dec 2018 15:34:41 +0000 (15:34 +0000)]
net/mlx5: remove checks for outer tunnel items on E-Switch

This patch removes unnecessary outer tunnel parameters check in the
validation routine for the E-Switch Flows. IPv4/IPv6 may have any
spec and mask, and transferred to tc without changes, all checks
are performed by kernel.

We are going to support Flows matching with outer tunnel items
and not containing the explicit tunnel decap action (this one
might be drop, redirect or table jump, for exapmle). So we can
not rely on presence of tunnel decap action in the list to decide
whether the Flow is for tunnel, instead we will use the presence
of tunnel item (like RTE_FLOW_ITEM_TYPE_VXLAN) in the item list.
The tunnel pattern checks within Flow validation routine are
rebound to presence of tunnel item. VXLAN decap action checks
for presence of VXLAN VNI item.

The tunnel UDP item is checked at the point of processing the tunnel
item (i.e. VXLAN). We can not perform UDP item check as tunnel once
UDP item encountered in the list, because it is not known yet whether
the tunnel item follows. The pointer to UDP item is saved and
checked as outer ones if tunnel item found.

Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/i40e: perform basic validation on VF messages
Haiyue Wang [Thu, 10 Jan 2019 12:07:31 +0000 (20:07 +0800)]
net/i40e: perform basic validation on VF messages

Do the VF message basic validation such as OPCODE message length check,
some special OPCODE message format check, to protect the i40e PMD from
malicious VF message attack.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: fix VLAN filter Tx
Qiming Yang [Mon, 14 Jan 2019 13:35:30 +0000 (21:35 +0800)]
net/ice: fix VLAN filter Tx

This patch fixed Tx error and allowed untagged packets in
when vlan filter on.

Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agoapp/testpmd: fix missing prefetch in macswap mode
Yongseok Koh [Mon, 14 Jan 2019 10:00:22 +0000 (02:00 -0800)]
app/testpmd: fix missing prefetch in macswap mode

Prefetching packet was missing when do_macswap() was optimized.

Fixes: 62b52877adbe ("app/testpmd: batch MAC swap for performance on x86")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agoapp/testpmd: fix pointer reference in macswap
Yongseok Koh [Mon, 14 Jan 2019 10:00:21 +0000 (02:00 -0800)]
app/testpmd: fix pointer reference in macswap

The pointer is misused and could set wrong MAC address. As a result, some
of packets can be dropped in receiver side due to MAC address mismatch.
This can be shown as performance degradation.

Bugzilla ID: 188
Fixes: 62b52877adbe ("app/testpmd: batch MAC swap for performance on x86")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agonet/tap: do not print pointer in info message
Stephen Hemminger [Fri, 11 Jan 2019 20:35:20 +0000 (12:35 -0800)]
net/tap: do not print pointer in info message

Printing pointer in log is uninformative (unless in a debugger),
instead print the assigned kernel device name which correlates
well with what TAP is doing.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/tap: get rid of global name variable
Stephen Hemminger [Fri, 11 Jan 2019 20:35:19 +0000 (12:35 -0800)]
net/tap: get rid of global name variable

Having a global variable which is set to "TUN" or "TAP" during
probe is a potential bug if probing is ever done in different
processes or contexts. Let's fix it now by using existing enum
that has type of connection.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by Keith Wiles <keith.wiles@intel.com>

5 years agonet/tap: let kernel choose tun device name
Stephen Hemminger [Fri, 11 Jan 2019 20:35:18 +0000 (12:35 -0800)]
net/tap: let kernel choose tun device name

Assigning tun and tap index in DPDK tap device driver is racy
and fails if used with primary/secondary. Instead use the kernel
feature of device wildcarding where if a name with %d is used
the kernel will fill in the next available device.

Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD")
Cc: stable@dpdk.org
Reported-by: Haifeng Li <hfli@netitest.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by Keith Wiles <keith.wiles@intel.com>

5 years agonet/tap: lower the priority of log messages
Stephen Hemminger [Fri, 11 Jan 2019 20:35:17 +0000 (12:35 -0800)]
net/tap: lower the priority of log messages

Any messages that normally occur during probe should be at DEBUG
level (not NOTICE). This reduces overall log clutter.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by Keith Wiles <keith.wiles@intel.com>

5 years agonet/tap: check interface name in kvargs
Stephen Hemminger [Fri, 11 Jan 2019 20:35:16 +0000 (12:35 -0800)]
net/tap: check interface name in kvargs

If interface name is passed to remote or iface then check
the length and for invalid characters. This avoids problems where
name gets truncated or rejected by kernel.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by Keith Wiles <keith.wiles@intel.com>

5 years agonet/tap: allow full length names
Stephen Hemminger [Fri, 11 Jan 2019 20:35:15 +0000 (12:35 -0800)]
net/tap: allow full length names

The code for set_interface_name was incorrectly assuming that
space for null byte was necessary with snprintf/strlcpy.

Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by Keith Wiles <keith.wiles@intel.com>

5 years agonet/tap: use strlcpy for interface name
Stephen Hemminger [Fri, 11 Jan 2019 20:35:14 +0000 (12:35 -0800)]
net/tap: use strlcpy for interface name

snprintf is not needed here, use strlcpy instead.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by Keith Wiles <keith.wiles@intel.com>

5 years agonet/sfc: fix typo in preprocessor check
Andrew Rybchenko [Sun, 13 Jan 2019 14:50:13 +0000 (14:50 +0000)]
net/sfc: fix typo in preprocessor check

ISP2() macro function misspelled in a check just before it.

Fixes: e1b944598579 ("net/sfc: build libefx")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoconfig: add static linkage of mlx dependency
Thomas Monjalon [Wed, 9 Jan 2019 14:23:19 +0000 (15:23 +0100)]
config: add static linkage of mlx dependency

The libraries provided by rdma-core may be statically linked
if enabling CONFIG_RTE_IBVERBS_LINK_STATIC in the make-based build.
If CONFIG_RTE_BUILD_SHARED_LIB is disabled, the applications
will embed the mlx PMDs with ibverbs and the mlx libraries.
If CONFIG_RTE_BUILD_SHARED_LIB is enabled,
the mlx PMDs will embed ibverbs and the mlx libraries.

Support with meson may be added later.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agoconfig: gather options for dlopen mlx dependency
Thomas Monjalon [Wed, 9 Jan 2019 14:23:18 +0000 (15:23 +0100)]
config: gather options for dlopen mlx dependency

Rename options CONFIG_RTE_LIBRTE_MLX4_DLOPEN_DEPS and
CONFIG_RTE_LIBRTE_MLX5_DLOPEN_DEPS to a single option
CONFIG_RTE_IBVERBS_LINK_DLOPEN.
Rename meson option enable_driver_mlx_glue to ibverbs_link.

There was no good reason for setting a different link option
for mlx4 and mlx5. Having a single common option makes it
easier to understand and unify make and meson systems.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agodoc: fix MAC address rewrite actions in prog guide
Dekel Peled [Wed, 9 Jan 2019 11:37:59 +0000 (13:37 +0200)]
doc: fix MAC address rewrite actions in prog guide

This patch fixes a typo in SET_MAC_DST action description.
It also adds restriction note for set MAC src/dst actions description.

Fixes: 15dbcdaada77 ("ethdev: add generic MAC address rewrite actions")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
5 years agoethdev: declare Tx prepare API as not experimental
David Marchand [Fri, 11 Jan 2019 14:11:37 +0000 (15:11 +0100)]
ethdev: declare Tx prepare API as not experimental

The Tx prepare API was introduced at a time when the experimental API
tag mechanism did not exist yet and is missing the tag.
However, this API has been there since 17.02 and did not suffer any
change since its introduction.

Let's just remove the warning from the documentation.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agobus/fslmc: support secondary process
Shreyansh Jain [Fri, 11 Jan 2019 12:25:08 +0000 (12:25 +0000)]
bus/fslmc: support secondary process

Previously FSLMC bus only supported blacklisting of DPNI (eth),
DPSECI (crypto) devices. With this patch, devices like DPIO,
DPMCP, and other DP* can also be blacklisted/whitelisted.

This is a required condition for secondary processes where the
secondary needs to be passed a mutually exclusive list of
resources as compared the primary and all other secondaries.

This patch also moves the DPIO memory from malloc to hugepage so
that in future in case the DPIO list can be shared, it can be
accessed in secondaries.

Once this patch is done, multi-process cases can be executed by
whitelisting/blacklisting devices in each instance.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agonet/dpaa2: change reference to private device
Shreyansh Jain [Fri, 11 Jan 2019 12:25:05 +0000 (12:25 +0000)]
net/dpaa2: change reference to private device

The I/O threads for DPAA2 take their reference for bpool ID, the
port ID and other info like qdid, from the rte_eth_dev. Further,
to get this data during I/O operation, a reference of the RTE
device is kept in the queue structure (dpaa2_queue).

In case of secondary processes, rte_eth_dev is not same as the
primary process. Thus, the reference goes invalid.

This patch changes the implementation to use the dev_private
rather than the rte_eth_dev as that is shared area across
all the processes.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agomempool/dpaa2: support saving context of buffer pool
Shreyansh Jain [Fri, 11 Jan 2019 12:25:02 +0000 (12:25 +0000)]
mempool/dpaa2: support saving context of buffer pool

Initial design was to have the buffer pool per process where a
global static array stores the bpids. But, in case of secondary
processes, this would not allow the I/O threads to translate the
bpid in Rx'd packets.

This patch moves the array to a global area (rte_malloc) and in
case of Rx thread not containing a valid reference to the array,
reference is build using the handle avaialble in the dpaa2_queue.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agonet/dpaa2: support custom hash key
Nipun Gupta [Fri, 11 Jan 2019 12:24:59 +0000 (12:24 +0000)]
net/dpaa2: support custom hash key

The DPAA2 hw can support a special offset based
configuration to program distribution on hash.
This is for all cases, which are not directly supported.

e.g. HASH based distribution on inner ip header
of a GRE tunnel.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agonet/dpaa2: add dpdmux initialization and configuration
Nipun Gupta [Fri, 11 Jan 2019 12:24:55 +0000 (12:24 +0000)]
net/dpaa2: add dpdmux initialization and configuration

This patch introduces an rte pmd API to configure dpdmux from
the application.
dpdmux can work in association with dpni as an additional
distribution capability on the NIC.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agobus/fslmc: support scanning DPDMUX object
Nipun Gupta [Fri, 11 Jan 2019 12:24:52 +0000 (12:24 +0000)]
bus/fslmc: support scanning DPDMUX object

Add support in bus and vfio to scan dpdmux type of objects

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agonet/dpaa2: add dpdmux mc flib
Nipun Gupta [Fri, 11 Jan 2019 12:24:49 +0000 (12:24 +0000)]
net/dpaa2: add dpdmux mc flib

dpdmux object is added as a part of net driver as it is used to
de-multiplex packets to separate interfaces on basis of specific rules.
These rules can be configured from the software

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agobus/fslmc: make portal function static
Hemant Agrawal [Fri, 11 Jan 2019 12:24:45 +0000 (12:24 +0000)]
bus/fslmc: make portal function static

Change QBMAN portal function to static as it is not exposed outside
this file context.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/fslmc: rename portal pi index to consumer index
Hemant Agrawal [Fri, 11 Jan 2019 12:24:42 +0000 (12:24 +0000)]
bus/fslmc: rename portal pi index to consumer index

This is to align with the latest qbman hw library

Signed-off-by: Youri Querry <youri.querry_1@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/fslmc: add dynamic config for memback portal mode
Hemant Agrawal [Fri, 11 Jan 2019 12:24:38 +0000 (12:24 +0000)]
bus/fslmc: add dynamic config for memback portal mode

Add flag in portal init to adjust the qbman memory type,
to decide between legacy portal mode or newly introduced
memory backed portals.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Youri Querry <youri.querry_1@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/fslmc: upgrade to latest qbman library
Hemant Agrawal [Fri, 11 Jan 2019 12:24:34 +0000 (12:24 +0000)]
bus/fslmc: upgrade to latest qbman library

This patch upgrades and sync the dpdk based qbman code
with new version of qbman flib.

Signed-off-by: Youri Querry <youri.querry_1@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: enable optional timestamp in mbuf
Akhil Goyal [Fri, 11 Jan 2019 12:24:30 +0000 (12:24 +0000)]
net/dpaa2: enable optional timestamp in mbuf

This patch enables the population of timestamp field
in mbuf on packet receive.
It may give performance impact on LX2xxx platforms.
So, it has been made optional for Lx2xxx platform.
One shall call, rte_dpaa2_enable_ts() to enable it.

Nothing is required for LS2 and LS1088 platforms.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agonet/dpaa2: fix device init for secondary process
Shreyansh Jain [Fri, 11 Jan 2019 12:24:27 +0000 (12:24 +0000)]
net/dpaa2: fix device init for secondary process

In order to support I/O from secondary process, the
burst APIs and OPS APIs shall be mapped/plugged.

Fixes: c147eae01cb3 ("net/dpaa2: introduce NXP DPAA2 driver")
Cc: stable@dpdk.org
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agobus/fslmc: fix parse method for bus devices
Shreyansh Jain [Fri, 11 Jan 2019 12:24:23 +0000 (12:24 +0000)]
bus/fslmc: fix parse method for bus devices

Current code expects that bus->parse() would get a string containing
the name of the bus. That is incorrect. bus->parse() is expected
to have strings like:
  dpni.1,key=val
  dpio.2,key=val

when user passed:
  -b fslmc:dpni.1,key=val

This commit fixes this behavior.

Fixes: 50245be05d1a ("bus/fslmc: support device blacklisting")
Cc: stable@dpdk.org
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agobus/fslmc: fix to convert error msg to warning
Hemant Agrawal [Fri, 11 Jan 2019 12:24:19 +0000 (12:24 +0000)]
bus/fslmc: fix to convert error msg to warning

This is just a information. No need to print
it as a error.

Fixes: ce9efbf5bb09 ("bus/fslmc: support dynamic logging")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: fix bad check for not-null
Hemant Agrawal [Fri, 11 Jan 2019 12:24:16 +0000 (12:24 +0000)]
net/dpaa2: fix bad check for not-null

The check !dpaa2->cscn is not correct to check non-null value.

Fixes: 5d9a1e4d23fe ("net/dpaa2: enhance queue memory cleanup")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/fslmc: fix to use correct physical core for logical core
Hemant Agrawal [Fri, 11 Jan 2019 12:24:12 +0000 (12:24 +0000)]
bus/fslmc: fix to use correct physical core for logical core

Existing code is using the lcore id as the physical core
id. Add code to get the right physical id.

Also, dpaa2 can not support one lcore mapping to multiple cpus,
print err on such cases.

Fixes: ce9efbf5bb09 ("bus/fslmc: support dynamic logging")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/fslmc: fix ring mode to use correct cache settings
Youri Querry [Fri, 11 Jan 2019 12:24:08 +0000 (12:24 +0000)]
bus/fslmc: fix ring mode to use correct cache settings

The code was incorrectly using the cache inhibited access.
It shall use cached enabled access for better performance.

Fixes: 293c0ca94c36 ("bus/fslmc: support memory backed portals with QBMAN 5.0")
Cc: stable@dpdk.org
Signed-off-by: Youri Querry <youri.querry_1@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agobus/fslmc: fix to reset portal memory before use
Sachin Saxena [Fri, 11 Jan 2019 12:24:04 +0000 (12:24 +0000)]
bus/fslmc: fix to reset portal memory before use

Uninitialized portal memory is causing unwanted issues.

Fixes: 293c0ca94c36 ("bus/fslmc: support memory backed portals with QBMAN 5.0")
Cc: stable@dpdk.org
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agonet/virtio-user: support control VQ for packed
Jens Freimann [Fri, 11 Jan 2019 09:39:29 +0000 (10:39 +0100)]
net/virtio-user: support control VQ for packed

Add support to virtio-user for control virtqueues.

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: check head desc with correct wrap counter
Jens Freimann [Fri, 11 Jan 2019 09:39:28 +0000 (10:39 +0100)]
net/virtio: check head desc with correct wrap counter

In virtio_pq_send_command() we check for a used descriptor
and wait in an idle loop until it becomes used. We can't use
vq->used_wrap_counter here to check for the first descriptor
we made available because the ring could have wrapped. Let's use
the used_wrap_counter that matches the state of the head descriptor.

Fixes: ec194c2f1895 ("net/virtio: support packed queue in send command")

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: support platform memory ordering
Ilya Maximets [Wed, 9 Jan 2019 14:50:15 +0000 (17:50 +0300)]
net/virtio: support platform memory ordering

VIRTIO_F_ORDER_PLATFORM is required to use proper memory barriers
in case of HW vhost implementations like vDPA.

DMA barriers (rte_cio_*) are sufficent for that purpose.

Previously known as VIRTIO_F_IO_BARRIER.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
5 years agonet/virtio: update memory ordering comment for VQ notify
Ilya Maximets [Wed, 9 Jan 2019 14:50:14 +0000 (17:50 +0300)]
net/virtio: update memory ordering comment for VQ notify

We're not using IO ports in case of modern device even on IA.
Also, this comment useless for other architectures.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
5 years agonet/virtio: add barrier before reading the flags
Ilya Maximets [Wed, 9 Jan 2019 14:50:13 +0000 (17:50 +0300)]
net/virtio: add barrier before reading the flags

Reading the used->flags could be reordered with avail->idx update.
vhost in kernel disables notifications for the time of packets
receiving, like this:

    1. disable notify
    2. process packets
    3. enable notify
    4. has more packets ? goto 1

In case of reordering, virtio driver could read the flags on
step 2 while notifications disabled and update avail->idx after
the step 4, i.e. vhost will exit the loop on step 4 with
notifications enabled, but virtio will not notify.

Fixes: c1f86306a026 ("virtio: add new driver")
Cc: stable@dpdk.org
Reported-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
5 years agoexamples/vhost: remove unnecessary method and constant
Rami Rosen [Wed, 9 Jan 2019 14:57:30 +0000 (16:57 +0200)]
examples/vhost: remove unnecessary method and constant

This cleanup patch removes a method and a constant which
are now unnecessary in the VHOST sample application, namely
the validate_num_devices() method and the MAX_DEVICES
constant.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/ice: fix firmware version result of ethtool
Leyi Rong [Thu, 10 Jan 2019 05:22:04 +0000 (13:22 +0800)]
net/ice: fix firmware version result of ethtool

Fix the drvinfo dumped firmware-version when using dpdk ethtool,
change it to the same result as Linux ethtool shown info.

Fixes: e31cb9a36298 ("net/ice: support FW version getting")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/sfc/base: fix Tx descriptor max number check
Igor Romanov [Wed, 9 Jan 2019 11:12:07 +0000 (11:12 +0000)]
net/sfc/base: fix Tx descriptor max number check

Fix check of maximum descriptor number (compare with maximum Tx
descriptor number instead of maximum EVQ events number).

Fixes: f7dc06bf35f2 ("net/sfc/base: import 5xxx/6xxx family support")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: discard last seen VLAN TCI if Tx packet is dropped
Ivan Malov [Wed, 9 Jan 2019 11:06:39 +0000 (11:06 +0000)]
net/sfc: discard last seen VLAN TCI if Tx packet is dropped

Early processing of a packet on transmit may change last seen
VLAN TCI in the queue context. If such a packet is eventually
dropped, last seen VLAN TCI must be set to its previous value.

Fixes: 7fd636815a43 ("net/sfc: support VLAN offload on transmit path")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: add missing header guard to TSO header file
Ivan Malov [Wed, 9 Jan 2019 11:05:13 +0000 (11:05 +0000)]
net/sfc: add missing header guard to TSO header file

Add missing header guard, including compiler directive for cplusplus.

Fixes: f1f575be9b76 ("net/sfc: put generalised TSO declarations in a header")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/bonding: fix possible null pointer reference
Declan Doherty [Tue, 8 Jan 2019 11:17:56 +0000 (11:17 +0000)]
net/bonding: fix possible null pointer reference

In function check_for_bonded_ethdev the driver name is used without
validating the pointer references in the passed ethdev object.

Fixes: 740feaf349b1 ("ethdev: remove driver name from device private data")
Cc: stable@dpdk.org
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
5 years agoapp/testpmd: fix quit to stop all ports before close
Cristian Dumitrescu [Fri, 4 Jan 2019 12:28:33 +0000 (12:28 +0000)]
app/testpmd: fix quit to stop all ports before close

This patch proposes a slightly different test-pmd quit operation: stop
all devices before starting to close any device. Basically, stop all
moving parts before beginning to remove them. The current test-pmd quit
is stopping and closing each device before moving to the next device.

If all devices in the system are independent of each other, this
difference is usually not important. In case of Soft NIC devices, any
such virtual device typically depends on one or more physical devices
being alive, as it accesses their queues, so this difference becomes
important.

Without this straightforward fix, all the Soft NIC devices need to be
manually stopped before the quit command is issued, otherwise the quit
command can sometimes crash the test-pmd application.

Fixes: d3a274ce9dee ("app/testpmd: handle SIGINT and SIGTERM")
Cc: stable@dpdk.org
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agodoc: fix a parameter name in testpmd guide
Rami Rosen [Fri, 4 Jan 2019 09:10:46 +0000 (11:10 +0200)]
doc: fix a parameter name in testpmd guide

There is no parameter called "eth-peer-configfile" in testpmd.
It should be "eth-peers-configfile". See the usage() method in
app/test-pmd/parameters.c.

Fixes: a67857e97ba8 ("doc: clarify usage of testpmd MAC forward mode")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>