Commit Graph

8590 Commits

Author SHA1 Message Date
Pablo de Lara
cfea1f3048 app/testpmd: print statistics periodically
Add parameter to print port statistics periodically
(disabled by default), if interactive mode is not enabled.

This is useful to allow the user to see port statistics
without having to get into the internal command line.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-07-06 14:03:34 +02:00
Pablo de Lara
99cabef088 app/testpmd: add parameter to start forwarding Tx first
Add parameter to start forwarding sending first
a burst of packets, which is useful when testing
a loopback connection.

This was already implemented as an internal command,
but adding it as a parameter is interesting, as it
allows the user to test a loopback connection without
entering in the internal command line.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-07-06 01:45:31 +02:00
Stephen Hemminger
463ced957c pci: increase domain storage to 32 bits
In some environments, the PCI domain can be larger than 16 bits.
For example, a PCI device passed through in Azure gets a synthetic domain
id  which is internally generated based on GUID. The PCI standard does
not restrict domain to be 16 bits.

This change breaks ABI for API's that expose PCI address structure.

The printf format for PCI remains unchanged, so that on most
systems (with only 16 bit domain) the output format is unchanged
and is 4 characters wide.  For example: 0000:00:01.0
Only on sysetms with higher bits will the domain take up more
space; example: 12000:00:01.0

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-07-06 01:28:02 +02:00
Stephen Hemminger
c023dabc07 pci: remove unnecessary casts in address parsing
The function strtoul returns unsigned long and can be directly
assigned to a smaller type. Removing the casts allows easier
expansion of PCI domain.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-07-06 01:27:19 +02:00
Ferruh Yigit
657c713385 usertools: add option to unbind all devices
-u accepts "dpdk" argument to unbind all devices bound to a DPDK driver.

Usage:
usertools/dpdk-devbind.py -u dpdk

Example:
$ usertools/dpdk-devbind.py -s

Network devices using DPDK-compatible driver
============================================
0000:08:00.1 '...' drv=igb_uio unused=
0000:81:00.0 '...' drv=igb_uio unused=
0000:88:00.0 '...' drv=igb_uio unused=
0000:88:00.1 '...' drv=igb_uio unused=
...

$ usertools/dpdk-devbind.py -u dpdk
$ usertools/dpdk-devbind.py -s

Network devices using DPDK-compatible driver
============================================
<none>
....

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-07-06 00:53:15 +02:00
Ferruh Yigit
a1e7c17555 ethdev: use device name from device structure
Device name resides in two different locations, in rte_device->name and
in ethernet device private data.

For now, the copy in the ethernet device private data is required for
multi process support, the name is the how secondary process finds about
primary process device.

But in the ethdev library some eth_dev->data->name usage can be
converted to rte_device->name.

This patch updates ethdev to use rte_device->name when possible.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-07-06 00:17:11 +02:00
Ferruh Yigit
4be4659a93 drivers/net: use device name from device structure
Device name resides in two different locations, in rte_device->name and
in ethernet device private data.

For now, the copy in the ethernet device private data is required for
multi process support, the name is the how secondary process finds about
primary process device.

But for drivers there is no reason to use the copy in the ethernet
device private data.

This patch updates PMDs to use only rte_device->name.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-07-06 00:17:02 +02:00
Ferruh Yigit
48d8675c9c ethdev: ensure same name size for device and ethdev
rte_device->name copied into eth_dev->name, right now size is same for
both but the requirement is not clear.

This patch highlights the relation without changing actual sizes.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-07-06 00:16:15 +02:00
Qi Zhang
a3a2e2c8f7 ethdev: add fuzzy match in flow API
Add new meta pattern item RTE_FLOW_TYPE_ITEM_FUZZY in flow API.

This is for device that support fuzzy match option.
Usually a fuzzy match is fast but the cost is accuracy.
i.e. Signature Match only match pattern's hash value, but it is
possible that two different patterns have the same hash value.

Matching accuracy level can be configured by subfield threshold.
Driver can divide the range of threshold and map to different
accuracy levels that device support.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-07-05 19:51:56 +02:00
Jianfeng Tan
641566b38b eal: fix config file path when checking process
When primary process is booted with --file-prefix option, the API,
rte_eal_primary_proc_alive(), uses a wrong config file path to
check if primary process is alive.

Fix it by calling helper function to get config file path.

Fixes: dd3e00138d ("eal: check if primary process is alive")
Cc: stable@dpdk.org

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
2017-07-05 15:17:05 +02:00
Jianfeng Tan
a33c81e38c ethdev: fix secondary process crash on unused virtio
Suppose we have 2 virtio devices for a VM, with only the first one,
virtio0, binding to igb_uio. Start a primary DPDK process, driving
only virtio0. Then start a secondary DPDK process, it encounters
segfault at eth_virtio_dev_init() because hw is NULL, when trying
to initialize the 2nd virtio devices.
    1539                    if (!hw->virtio_user_dev) {

We could add a precheck to return error when hw is NULL. But the
root cause is that virtio devices which are not driven by the primary
process are not exluded by secondary eal probe function.

To support legacy virtio devices bound to none kernel driver, we
removed RTE_PCI_DRV_NEED_MAPPING in
commit 962cf902e6 ("pci: export device mapping functions").
At the boot of primary process, ether dev is allocated in rte_eth_devices
array, rte_eth_dev_data is also allocated in rte_eth_dev_data array; then
probe function fails; and ether dev is released. However, the entry in
rte_eth_dev_data array is not cleared. Then we start secondary process,
and try to attach the virtio device that not used in primary process,
the field, dev_private (or hw), in rte_eth_dev_data, is NULL.

To fail the dev attach, we need to clear the field, name, when we
release any ether devices in primary, so that below loop in
rte_eth_dev_attach_secondary() will not find any matched names.
        for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
                if (strcmp(rte_eth_dev_data[i].name, name) == 0)
                        break;
        }

Fixes: 6d890f8ab5 ("net/virtio: fix multiple process support")
Cc: stable@dpdk.org

Reported-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
2017-07-05 12:10:40 +02:00
Olivier Matz
ad10c17821 mem: do not advertise physical address when no hugepages
When populating a mempool with a virtual memory area, the mempool
library expects to be able to get the physical address of each page.

When started with --no-huge, the physical addresses may not be available
because the pages are not locked in memory. It sometimes returns
RTE_BAD_PHYS_ADDR, which makes the mempool_populate() function to fail.

This was working before the commit cdc242f260 ("eal/linux: support
running as unprivileged user"), because rte_mem_virt2phy() was returning
0 instead of RTE_BAD_PHYS_ADDR, which was seen as a valid physical
address.

Since --no-huge is a debug function that breaks the support of physical
drivers, always set physical addresses to RTE_BAD_PHYS_ADDR in memzones
or in rte_mem_virt2phy(), and ensure that mempool won't complain in that
case.

Fixes: cdc242f260 ("eal/linux: support running as unprivileged user")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Jan Blunck <jblunck@infradead.org>
2017-07-04 17:51:22 +02:00
Jianbo Liu
5df1c51033 examples/l3fwd: add loop count for hash multi-lookup
New macro to define how many times of hash lookup in one time, and this
makes the code more concise.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:41:53 +02:00
Jianbo Liu
569b290cdb examples/l3fwd: add NEON implementation
Use ARM NEON intrinsics to accelerate l3 fowarding.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:41:53 +02:00
Jianbo Liu
3c4b4024c2 arch/arm: add vcopyq_laneq_u32 for old gcc
Implement vcopyq_laneq_u32 if gcc version is lower than 7.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:41:53 +02:00
Jianbo Liu
3a6827ed19 examples/l3fwd: rearrange LPM code
Some common code can be used by other ARCHs, move to l3fwd_lpm.c

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:41:53 +02:00
Jianbo Liu
66d8bc009c examples/l3fwd: extract common code from multi packet send
Keep x86 related code in l3fwd_sse.h, and move common code to
l3fwd_common.h, which will be used by other Archs.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:41:53 +02:00
Jianbo Liu
677311d270 examples/l3fwd: rename file for sequential hash lookup
The l3fwd_em_sse.h is enabled by NO_HASH_LOOKUP_MULTI.
Renaming it because it's only for sequential hash lookup,
and doesn't include any x86 SSE instructions.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:41:53 +02:00
Jianbo Liu
8ec858abe4 examples/l3fwd: reorganise multi hash lookup
Extract common code from l3fwd_em_hlm_sse.h, and add to the new file
l3fwd_em_hlm.h.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 17:25:01 +02:00
Ashwin Sekhar T K
a566400e8b net: implement CRC for ARM64 NEON
Added CRC compute APIs for arm64 utilizing the pmull
capability.

Added new file net_crc_neon.h to hold the arm64 pmull
CRC implementation.

Added wrappers in rte_vect.h for those neon intrinsics
which are not supported in GCC version < 7.

Verified the changes with crc_autotest unit test case

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Acked-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 15:58:45 +02:00
Ashwin Sekhar T K
266451e419 eal: move gcc version definition to common header
Moved the definition of GCC_VERSION from lib/librte_table/rte_lru.h
to lib/librte_eal/common/include/rte_common.h.

Tested compilation on:
 * arm64 with gcc
 * x86 with gcc and clang

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
Acked-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-04 15:57:22 +02:00
Ashwin Sekhar T K
34e5913067 mk: add crypto capability for armv8a and thunderx
armv8-a has optional CRYPTO extension which adds the
AES, PMULL, SHA1 and SHA2 capabilities. -march=armv8-a+crypto
enables code generation for the ARMv8-A architecture together
with the optional CRYPTO extensions.

Added the following flags to detect the corresponding
capability at compile time.
 * RTE_MACHINE_CPUFLAG_AES
 * RTE_MACHINE_CPUFLAG_PMULL
 * RTE_MACHINE_CPUFLAG_SHA1
 * RTE_MACHINE_CPUFLAG_SHA2

At run-time, the following flags can be used to detect the
capabilities.
 * RTE_CPUFLAG_AES
 * RTE_CPUFLAG_PMULL
 * RTE_CPUFLAG_SHA1
 * RTE_CPUFLAG_SHA2

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
2017-07-04 15:56:58 +02:00
Ashwin Sekhar T K
f9599fa054 examples/performance-thread: support ARM64
Updated Makefile to allow compilation for arm64 architecture.

Added necessary arm64 support for lthread.

Fixed minor compilation errors for arm64 compilation.

Tested the apps l3fwd-thread and lthread_pthread_shim on thunderx
and x86_64.

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
2017-07-04 15:19:42 +02:00
Ashwin Sekhar T K
de88718f63 examples/performance-thread: reorganise arch code
Moved the architecture dependent stack set code to architecture
specific directory.

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
2017-07-04 15:19:22 +02:00
Bruce Richardson
8152e00dce examples/performance-thread: remove non-SSE4 fallbacks
Since this example is for x86_64 platforms only, and since SSE4 is now a
mandatory requirement, we can remove the ifdefs checking for that
instruction set level, and the fallbacks if it is not present.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
193f9ec5c0 examples/l3fwd: remove checks for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
a113713835 examples/ip_pipeline: remove macro check for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
5ea4d4688d net/ixgbe: remove fallback code for x86 non-SSE4
Since SSE4 is now part of minimum requirements for DPDK on x86, we no
longer need this fallback code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
80477544fd net/i40e: remove checks for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we no longer
need these checks.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
50f0b41f23 net/enic: replace check for SSE4 with check for x86
Since SSE4 is now minimum requirement for x86 platforms we can replace the
check for SSE4 with a check for x86

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
541ce1c707 crypto/zuc: remove check for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
cfcb2003c0 crypto/snow3g: remove check for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
23f8637e26 crypto/kasumi: remove check for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
6a86c3477f crypto/aesni_mb: remove check for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
887c272fab table: remove check for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
the scalar version on x86.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
ff1b2b39d6 sched: remove check for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:39:18 +02:00
Bruce Richardson
e08555a041 net: remove check for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:35:41 +02:00
Bruce Richardson
3f50cf9075 ip_frag: check for x86 rather than SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
to check for its presence any more.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:35:41 +02:00
Bruce Richardson
4f4cd8717e hash: remove checks for SSE
Since SSE4 is now part of the minimum requirements for DPDK, we don't need
a fallback case to handle selection of algorithm when SSE4 is unavailable.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2017-07-04 14:35:41 +02:00
Bruce Richardson
673e2fe586 distributor: remove checks for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we now longer
need this check.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:35:41 +02:00
Bruce Richardson
35320649fa acl: remove checks for SSE4
Since SSE4 is now part of the minimum requirements for DPDK, we now longer
need this check.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:35:41 +02:00
Bruce Richardson
f46e442ca0 eal: remove unneeded conditionals for SSE headers
Our x86 baseline is to have support for SSE4.2, so therefore there is no
point in conditions around the inclusion of SSE1 - SSE4 headers.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2017-07-04 14:35:37 +02:00
Bruce Richardson
f27769f796 mk: require SSE4.2 support on all x86 platforms
Increase the default baseline from "core2" architecture to "corei7". This
means that all builds will have SSE4.2 support included, and we can remove
special case manipulation of CFLAGS for the same. Naturally, this does mean
that some machines that previously could run DPDK now can't do so, but
hardware with SSE4.2 has been around for almost a decade now, so this
should not be a major problem.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-04 14:30:05 +02:00
Tiwei Bie
190ce8645e contigmem: do not zero pages during each mmap
Don't zero the pages during each mmap. Instead, only zero the pages
when they are not already mmapped. Otherwise, the multi-process
support will be broken, as the pages will be zeroed when secondary
processes map the memory. Besides, track the open and mmap operations
on the cdev, and prevent the module from being unloaded when it is
still in use.

Fixes: 82f9318055 ("contigmem: zero all pages during mmap")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-07-04 01:32:57 +02:00
Tiwei Bie
5f51eca224 contigmem: free allocated memory on error
Fixes: 764bf26873 ("add FreeBSD support")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-07-04 01:32:28 +02:00
Jan Blunck
0bba9e6050 eal: use new hotplug API in attach
Using the new hotplug API allows attach to be backwards compatible while
decoupling it from the concrete bus implementations.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
2017-07-04 01:22:19 +02:00
Jan Blunck
cbb4c648c5 ethdev: use device handle to detach
This is changing the API of rte_eal_dev_detach().

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2017-07-04 01:22:19 +02:00
Jan Blunck
a3ee360f44 eal: add hotplug add/remove device
Signed-off-by: Jan Blunck <jblunck@infradead.org>
2017-07-04 01:10:24 +02:00
Gaetan Rivet
00e62aae69 bus/pci: implement plug/unplug operations
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-07-04 01:09:33 +02:00
Jan Blunck
96f54a07c8 bus/vdev: implement unplug operation
Signed-off-by: Jan Blunck <jblunck@infradead.org>
2017-07-04 01:09:17 +02:00