Commit Graph

3234 Commits

Author SHA1 Message Date
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
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
Jan Blunck
7c8810f43f bus: introduce device plug/unplug
This allows the buses to plug and probe specific devices.
This is meant to be a building block for hotplug support.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
2017-07-04 01:08:42 +02:00
Jan Blunck
2f517390e5 bus: add helper to find bus by name
Signed-off-by: Jan Blunck <jblunck@infradead.org>
2017-07-04 01:08:36 +02:00
Jan Blunck
95d57b2b03 bus: add helper to find which bus holds a device
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-07-04 01:08:28 +02:00
Jan Blunck
dd288f0dfb bus: require to implement device finding
Signed-off-by: Jan Blunck <jblunck@infradead.org>
2017-07-04 01:08:27 +02:00
Jan Blunck
9a58384b74 bus/pci: implement method to find device
Signed-off-by: Jan Blunck <jblunck@infradead.org>
2017-07-04 01:08:21 +02:00
Jan Blunck
7729daf9ed bus/vdev: implement method to find device
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-07-04 01:08:17 +02:00
Jan Blunck
3a8f0bc68a bus: add method to find device
This new method allows buses to expose their devices in a controlled
manner. A comparison function is provided by the user to discriminate
between devices, using arbitrary data as identifier.

It is possible to start an iteration from a specific point, in order to
continue a search.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-07-04 01:08:13 +02:00
Jan Blunck
87bfa873af bus: add iterator to find a bus
This helper allows to iterate over all registered buses and find one
matching data used as parameter.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-07-04 01:08:11 +02:00
Gaetan Rivet
fea892e35f bus/vdev: use standard bus registration
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-07-04 01:07:53 +02:00
Jerin Jacob
577329e66b eal: switch to architecture specific pause function
Remove rte_pause() definition from rte_common.h and
switchover to architecture specific rte_pause.h

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-07-03 23:58:51 +02:00
Jerin Jacob
ad0c241386 eal/ppc64: add empty pause function
The patch does not provide any functional change for ppc64
with respect to existing rte_pause() definition.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
2017-07-03 23:58:51 +02:00
Jerin Jacob
d2f8d65f6e eal/x86: copy pause function
The patch does not provide any functional change for x86
with respect to existing rte_pause() definition.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-07-03 23:58:51 +02:00
Jerin Jacob
dfd33f01cd eal/arm64: add pause function
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-03 23:58:51 +02:00
Jerin Jacob
b8d08b0dc3 eal/arm32: add empty pause function
The patch does not provide any functional change for ARM32
with respect to existing rte_pause() definition.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Jan Viktorin <viktorin@rehivetech.com>
Acked-by: Jianbo Liu <jianbo.liu@linaro.org>
2017-07-03 23:58:51 +02:00
Jerin Jacob
841e7ae580 eal: introduce architecture specific pause function
Each architecture may have different instructions for optimized
and power consumption aware rte_pause() implementation.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-07-03 23:57:49 +02:00
Ashwin Sekhar T K
3b557b932c eal/arm: fix build with clang
Fixed warning -Wasm-operand-widths seen with armv8a
clang compilation.

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-03 22:28:16 +02:00
Ashwin Sekhar T K
30b156d5ef acl: fix build with ARMv8 clang
Fixed warning -Wunknown-warning-option seen with
armv8a clang compilation.

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-03 22:28:10 +02:00
Ashwin Sekhar T K
fa50d3b27a hash: compile ARMv8 CRC32 support conditionally
Compile the armv8a CRC32 support only if the machine
has the CRC extensions i.e if RTE_MACHINE_CPUFLAG_CRC32
is defined.

Removed the .arch assembly directives as these are no
more necessary.

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-03 22:27:42 +02:00
Ashwin Sekhar T K
8d55ebcc78 eal: pause while busy-waiting for lcore slave
Instead of simply busy-waiting for slave in rte_eal_wait_lcore()
do rte_pause(). This will give power savings.

This also fixes warning -Wempty-body seen with armv8a clang
compilation.

Suggested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-07-03 22:27:40 +02:00
Ashwin Sekhar T K
47e15e618a table: add NEON implementation of LRU strategy 3
* Added new file rte_lru_arm64.h for holding arm64 specific
  definitions
* Verified the changes with table_autotest unit test case

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
2017-07-03 17:15:47 +02:00
Ashwin Sekhar T K
1e29a16248 table: separate out x86-specific from LRU header
* Moved all x86 related lru defines to rte_lru_x86.h while
  retaining all common defines in rte_lru.h
* Verified the changes with table_autotest unit test case

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
2017-07-03 16:54:01 +02:00
Ashwin Sekhar T K
3f98dd87d2 efd: support lookup using NEON intrinsics
* Added file lib/librte_efd/rte_efd_arm64.h to hold arm64
  specific definitions
* Verified the changes with efd_autotest unit test case

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
2017-07-03 15:27:32 +02:00
Ashwin Sekhar T K
b79afd0b7e sched: add NEON optimizations
* Removed setting CONFIG_RTE_SCHED_VECTOR=n from armv8a config
  so that the setting from common_base is taken as the default
  setting for armv8a
* Verified the changes with sched_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-03 15:13:36 +02:00
Ashwin Sekhar T K
6cba794e48 hash: support NEON for Toeplitz algo
Verified the changes with thash_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-03 14:17:37 +02:00
Olivier Matz
fed524ce53 eal: introduce integer log2 function
At some places, the log2() function is used despite this function
works on float. This introduces a dependency to the math lib but
most of the time it is not required because we want an integer log2.

Add a new helper to do this job and fix nfp driver.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-07-03 10:44:12 +02:00
Nikhil Rao
5142318c81 ethdev: fix a typo in global API introduction
This patch fixes a typo in the eth device API doc, device
config. not stored between calls to rte_eth_dev_start/stop()
should be restored before a call to rte_eth_dev_start()
instead of after a call to rte_eth_dev_start().

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-07-02 19:46:52 +02:00
Rami Rosen
a9261095c3 ethdev: fix a typo
This patch fixes a trivial typo in rte_ethdev.h; it should be
"RX multicast OFF" and not "RX multicast OF".

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-07-01 17:28:11 +02:00
Bernard Iremonger
d6af1a13d7 ethdev: add return values to callback process API
Change the rte_eth_dev_callback_process function to return int,
and add a void *ret_param parameter.
The new parameter is used by ixgbe and i40e instead of abusing
the user data of the callback.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2017-07-01 17:19:55 +02:00
Daniel Verkamp
aae9817d5d ring: use aligned memzone allocation
rte_memzone_reserve() provides cache line alignment, but
struct rte_ring may require more than cache line alignment: on x86-64,
it needs 128-byte alignment due to PROD_ALIGN and CONS_ALIGN, which are
128 bytes, but cache line size is 64 bytes.

Fixes runtime warnings with UBSan enabled.

Fixes: d9f0d3a1ff ("ring: remove split cacheline build setting")
Cc: stable@dpdk.org

Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-01 13:26:18 +02:00
Gowrishankar Muthukrishnan
49da4e82cf kni: allocate no more mbuf than empty slots in queue
In kni_allocate_mbufs(), we attempt to add max_burst (32) count of mbuf
always into alloc_q, which is excessively leading too many rte_pktmbuf_
free() when alloc_q is contending at high packet rate (for eg 10Gig data).
In a situation when alloc_q fifo can only accommodate very few (or zero)
mbuf, create only what needed and add in fifo.

With this patch, we could stop random network stall in KNI at higher packet
rate (eg 1G or 10G data between vEth0 and PMD) sufficiently exhausting
alloc_q on above condition. I tested i40e PMD for this purpose in ppc64le.

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-07-01 12:54:51 +02:00
Vasily Philipov
814baffdb6 mbuf: fix debug checks for headroom and tailroom
rte_pktmbuf_headroom() and rte_pktmbuf_tailroom() should be usable
with any segment, not only with headered ones, so is_header should be 0
when we call for sanity check inside them.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-07-01 12:18:29 +02:00
Jerin Jacob
cb327a7802 mbuf: reduce pktmbuf init cycles
There is no need for initializing the complete
packet buffer with zero as the packet data area will be
overwritten by the NIC Rx HW anyway.

The testpmd configures the packet mempool
with around 180k buffers with
2176B size. In existing scheme, the init routine
needs to memset around ~370MB vs the proposed scheme
requires only around ~22MB on 128B cache aligned system.

Useful in running DPDK in HW simulators/emulators,
where millions of cycles have an impact on boot time.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-07-01 12:14:58 +02:00
Ilya Maximets
1b72605d24 mem: balanced allocation of hugepages
Currently EAL allocates hugepages one by one not paying attention
from which NUMA node allocation was done.

Such behaviour leads to allocation failure if number of available
hugepages for application limited by cgroups or hugetlbfs and
memory requested not only from the first socket.

Example:
	# 90 x 1GB hugepages availavle in a system

	cgcreate -g hugetlb:/test
	# Limit to 32GB of hugepages
	cgset -r hugetlb.1GB.limit_in_bytes=34359738368 test
	# Request 4GB from each of 2 sockets
	cgexec -g hugetlb:test testpmd --socket-mem=4096,4096 ...

	EAL: SIGBUS: Cannot mmap more hugepages of size 1024 MB
	EAL: 32 not 90 hugepages of size 1024 MB allocated
	EAL: Not enough memory available on socket 1!
	     Requested: 4096MB, available: 0MB
	PANIC in rte_eal_init():
	Cannot init memory

	This happens beacause all allocated pages are
	on socket 0.

Fix this issue by setting mempolicy MPOL_PREFERRED for each hugepage
to one of requested nodes using following schema:

	1) Allocate essential hugepages:
		1.1) Allocate as many hugepages from numa N to
		     only fit requested memory for this numa.
		1.2) repeat 1.1 for all numa nodes.
	2) Try to map all remaining free hugepages in a round-robin
	   fashion.
	3) Sort pages and choose the most suitable.

In this case all essential memory will be allocated and all remaining
pages will be fairly distributed between all requested nodes.

New config option RTE_EAL_NUMA_AWARE_HUGEPAGES introduced and
enabled by default for linuxapp except armv7 and dpaa2.
Enabling of this option adds libnuma as a dependency for EAL.

Fixes: 77988fc08d ("mem: fix allocating all free hugepages")

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-06-30 17:54:32 +02:00
Kirill Rybalchenko
fe09afb73b cryptodev: fix device stop function
Flag dev_started should be cleared after dev_stop() function call
because the flag is checked inside the dev_stop() function.

Fixes: d11b0f30df ("cryptodev: introduce API and framework for crypto devices")
Cc: stable@dpdk.org

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-06-28 19:59:22 +02:00
Pablo de Lara
8e3cfa66e7 cryptodev: remove unused driver struct
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-06-28 19:59:22 +02:00
Pablo de Lara
065a0cbaeb cryptodev: remove unused PCI probe/remove
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-06-28 19:59:22 +02:00
Pablo de Lara
fe530c54e7 cryptodev: add PCI driver helpers
Add PCI probe/remove/init/uninit functions in a separate
file rte_cryptodev_pci.h, which do not use cryptodev driver,
in order to be removed in next commits.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-06-28 19:59:22 +02:00
Pablo de Lara
d0b316ad6d cryptodev: release device if PCI probing fails
Call rte_cryptodev_pmd_release_device() if probing a
PCI crypto device, instead of accessing the variables
directly. This will be useful when rte_cryptodev_pci_probe()
gets moved to a separate file.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-06-28 19:59:22 +02:00
Pablo de Lara
63348b9d1c cryptodev: move vdev functions to a separate file
Move all functions handling virtual devices to a separate
header file "rte_cryptodev_vdev.h", in order to leave only
generic functions for any device in the rest of the files.

It also creates the file "rte_cryptodev_pmd.c", with the
implementations of these functions.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-06-28 19:59:22 +02:00
Pablo de Lara
5a7af3bb98 cryptodev: set PCI info only when device is PCI
Do not set PCI information in the device information structure
for any crypto device, just for the ones that are PCI, so
this is set internally in the PCI crypto PMDs (only QAT now).

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-06-28 19:59:22 +02:00
Pablo de Lara
708d07847f cryptodev: simplify device list retrieval logic
rte_cryptodev_devices_get() function returns an array of devices
sharing the same driver.

Instead of having two different paths depending on the device being
virtual or physical, retrieve the driver name from rte_device structure.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-06-28 19:59:22 +02:00
Pablo de Lara
9ad53189a3 cryptodev: rename device retrieval argument
rte_cryptodev_devices_get() function was parsing a crypto
device name as an argument, but the function actually
returns device identifiers of devices that share the
same crypto driver, so the argument should be driver name, instead.

Fixes: 38227c0e3a ("cryptodev: retrieve device info")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-06-28 19:59:22 +02:00