Commit Graph

5391 Commits

Author SHA1 Message Date
David Marchand
55cf111b6e vfio: remove incorrect experimental tag
The incriminated commit promoted this symbol as stable but the
definition still has the tag.

Fixes: 787ae736a3 ("vfio: remove experimental tag")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2019-06-29 19:04:25 +02:00
David Marchand
19f95c4744 devargs: remove incorrect experimental tags
The incriminated commit promoted those symbols as stable but the
prototypes still have the tag.

Fixes: 73eca2f77f ("devargs: promote experimental API as stable")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2019-06-29 19:04:21 +02:00
David Marchand
f319d99379 eal: hide internal hotplug function
This API was experimental and not properly marked in the map file.
But looking more closely, this is just an internal wrapper for EAL init.
Hide it in the hotplug code.

Fixes: 244d513071 ("eal: enable hotplug on multi-process")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2019-06-29 19:04:07 +02:00
Mattias Rönnblom
e4dd3bddd1 eal: use 32-bit RDSEED to allow 32-bit x86 usage
When seeding the pseudo-random number generator, replace the 64-bit
RDSEED with two 32-bit RDSEED instructions to allow building and
running on 32-bit x86.

Fixes: faf8fd2527 ("eal: improve entropy for initial PRNG seed")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
2019-06-29 14:25:14 +02:00
Mattias Rönnblom
5f4ed3f058 eal: introduce random generator with upper bound
Add a function rte_rand_max() which generates an uniformly distributed
pseudo-random number less than a user-specified upper bound.

The commonly used pattern rte_rand() % SOME_VALUE creates biased
results (as in some values in the range are more frequently occurring
than others) if SOME_VALUE is not a power of 2.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-06-28 15:23:55 +02:00
Mattias Rönnblom
faf8fd2527 eal: improve entropy for initial PRNG seed
Replace the use of rte_get_timer_cycles() with getentropy() for
seeding the pseudo-random number generator. getentropy() provides a
more truly random value.

getentropy() requires glibc 2.25 and Linux kernel 3.17. In case
getentropy() is not found at compile time, or the relevant syscall
fails in runtime, the rdseed machine instruction will be used as a
fallback.

rdseed is only available on x86 (Broadwell or later). In case it is
not present, rte_get_timer_cycles() will be used as a second fallback.

On non-Meson builds, getentropy() will not be used.

Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-06-28 15:23:52 +02:00
Mattias Rönnblom
3f002f0696 eal: replace libc-based random generation with LFSR
This commit replaces rte_rand()'s use of lrand48() with a DPDK-native
combined Linear Feedback Shift Register (LFSR) (also known as
Tausworthe) pseudo-random number generator.

This generator is faster and produces better-quality random numbers
than the linear congruential generator (LCG) of lib's lrand48(). The
implementation, as opposed to lrand48(), is multi-thread safe in
regards to concurrent rte_rand() calls from different lcore threads.
A LCG is still used, but only to seed the five per-lcore LFSR
sequences.

In addition, this patch also addresses the issue of the legacy
implementation only producing 62 bits of pseudo randomness, while the
API requires all 64 bits to be random.

This pseudo-random number generator is not cryptographically secure -
just like lrand48().

Bugzilla ID: 114
Bugzilla ID: 276

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-06-28 15:23:38 +02:00
Ferruh Yigit
500e70b90c telemetry: fix build
Build error:
../lib/librte_telemetry/rte_telemetry.c:558:28:
  error: comparison of unsigned expression < 0 is always false
  [-Werror,-Wtautological-compare]

Build error not observed in default make build because telemetry library
disabled by default but easier to reproduce via meson.

Fixing by converting unsigned variables to signed.

Fixes: 0fe3a37924 ("telemetry: format json response when sending stats")
Fixes: 4080e46c80 ("telemetry: support global metrics")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
2019-06-28 11:06:08 +02:00
Konstantin Ananyev
28b2d3d112 bpf: fix check array size
Array ins_chk in lib/librte_bpf/bpf_validate.c has 255 entries.
So the instruction with opcode == 255 will reading beyond array
boundaries.
For more details please refer to:
https://bugs.dpdk.org/show_bug.cgi?id=283

Fixes: 6e12ec4c4d ("bpf: add more checks")
Cc: stable@dpdk.org

Reported-by: Michel Machado <michel@digirati.com.br>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-06-27 23:17:10 +02:00
Konstantin Ananyev
4b06b0771f ip_frag: fix IPv6 fragment size calculation
Take into account IPv6 fragment extension header when
calculating data size for each fragment.

Fixes: 7a838c8798 ("ip_frag: fix IPv6 when MTU sizes not aligned to 8 bytes")
Fixes: 0aa31d7a59 ("ip_frag: add IPv6 fragmentation support")
Cc: stable@dpdk.org

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-06-27 18:05:46 +02:00
Phil Yang
6146fbb2fe stack: fix sign of list length
clang raise 'pointer-sign' warnings in __atomic_compare_exchange
when passing 'uint64_t *' to parameter of type 'int64_t *' converts
between pointers to integer types with different sign.

Fixes: 7e6e609939 ("stack: add C11 atomic implementation")
Cc: stable@dpdk.org

Suggested-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2019-06-27 18:00:59 +02:00
Thomas Monjalon
75683290e5 eal/linux: fix return after alarm registration failure
When adding an alarm, if an error happen when registering
the common alarm callback, it is not considered as a major failure.
The alarm is then inserted in the list.
However it was returning an error code after inserting the alarm.

The error code is not set anymore to be consistent with the behaviour.

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

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2019-06-27 17:25:05 +02:00
Xiaolong Ye
4142b06e2d eal: correct log for alarm error
Fixes: af75078fec ("first public release")
Fixes: 764bf26873 ("add FreeBSD support")
Cc: stable@dpdk.org

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2019-06-27 10:33:06 +02:00
Arnon Warshavsky
4e8854ae89 eal: do not panic on shared memory init
This patch changes some void functions to return a value,
so that the init sequence may tear down orderly
instead of calling panic.

Signed-off-by: Arnon Warshavsky <arnon@qwilt.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2019-06-26 16:50:33 +02:00
Marcin Smoczynski
28188cee2a build: enable BSD features visibility for FreeBSD
When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE macro
explicitly in its build recipe, it restricts visibility of a non POSIX
features subset, such as IANA protocol numbers (IPPROTO_* macros).
Non standard features are enabled by default for DPDK both for Linux
thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE. However
using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
__BSD_VISIBLE to be defined to 0 for FreeBSD, causing different feature
sets visibility for Linux and FreeBSD. It restricts from using IPPROTO
macros in public headers, such as rte_ip.h, despite the fact they are
already widely used in sources.

Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
which enforces feature sets visibility unification between Linux and
FreeBSD.

Add single -D_GNU_SOURCE to config/meson.build as a project argument
instead of adding separate directive for each project subtree.

This patch solves the problem of build breaks for [1] on FreeBSD [2]
following the discussion [3].

[1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
[2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
[3] https://mails.dpdk.org/archives/dev/2019-May/132110.html

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-06-26 16:50:33 +02:00
Reshma Pattan
4080e46c80 telemetry: support global metrics
telemetry has support for fetching port based stats
from metrics library.

Metrics library also has global stats which are
not fetched by telemetry, so extend telemetry to
fetch the global metrics.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
2019-06-24 16:51:28 +02:00
Fan Zhang
4349d412af vhost/crypto: fix inferred misuse of enum
This patch fixes the inferred misuse of enum of crypto algorithms.

Coverity issue: 325879
Fixes: e80a987081 ("vhost/crypto: add session message handler")
Cc: stable@dpdk.org

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-06-20 23:42:04 +02:00
Fan Zhang
1a92c9632b vhost/crypto: fix logically dead code
This patch fixes a few same class bugs that causes the
logically dead code in vhost_crypto.

Coverity issue: 277236, 277233, 277220, 277214
Fixes: 3bb595ecd6 ("vhost/crypto: add request handler")
Cc: stable@dpdk.org

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-06-20 23:42:04 +02:00
Noa Ezra
346c2c954e vhost: fix missing include
Add a missing include with the defines for vhost-user driver features.

Fixes: 5fbb3941da ("vhost: introduce driver features related APIs")
Cc: stable@dpdk.org

Signed-off-by: Noa Ezra <noae@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Matan Azrad <matan@mellanox.com>
2019-06-20 23:42:04 +02:00
Reshma Pattan
05682bddb6 telemetry: fix memory leak
Free the `values` pointer before returning
from rte_telemetry_command_ports_all_stat_values()
to avoid memory leak.

Fixes: c12cefa379 ("telemetry: fix mapping of statistics")
Cc: stable@dpdk.org

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
2019-06-18 12:07:45 +03:00
Igor Ryzhov
ee3cac929e kni: remove PCI related information
As there is no ethtool support in KNI anymore,
PCI related information is no longer needed.

Fixes: ea6b39b5b8 ("kni: remove ethtool support")

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-17 14:22:22 +03:00
Andrew Rybchenko
aab0afb495 ethdev: fix Tx prepare documentation to use positive errno
Tx prepare documentation was incorrectly suggesting to use
negative rte_errno.

Fixes: 4fb7e803eb ("ethdev: add Tx preparation")
Fixes: 439a90b5f2 ("ethdev: reorder inline functions")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:30 +09:00
Sunil Kumar Kori
a79e3088ca ethdev: add default value for max segment
rte_eth_dev_info structure exposes, nb_seg_max & nb_mtu_seg_max
to provide maximum number of supported segments for a given platform.

Defining UINT16_MAX as default value of above mentioned variables to
expose support of infinite/maximum segments.

Based on above values, application can decide best size for buffers
while creating mbuf pool.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-13 23:54:30 +09:00
David Marchand
cd7bb0d442 ethdev: add a check on mempool during RxQ setup
We currently have no check on the mempool pointer passed to
rte_eth_rx_queue_setup.
Let's avoid a plain crash when dereferencing it.

Suggested-by: Jens Freimann <jfreimann@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-13 23:54:29 +09:00
Maxime Coquelin
1f4d55be43 eal/x86: force inlining of all memcpy and mov helpers
Some helpers in the header file are forced inlined other are
only inlined, this patch forces inline for all.

It will avoid it to be embedded as functions when called multiple
times in the same object file. For example, when we added packed
ring support in vhost-user library, rte_memcpy_generic got no
more inlined.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-06-13 23:54:29 +09:00
Maxime Coquelin
d1134c09e3 vhost: simplify descriptor buffer prefetching
Now that we have a single function to map the descriptors
buffers, let's prefetch them there as it is the earliest
place we can do it.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
2019-06-13 23:54:29 +09:00
Maxime Coquelin
084fac96ca vhost: do not inline unlikely fragmented buffers code
Handling of fragmented virtio-net header and indirect descriptors
tables was implemented to fix CVE-2018-1059. It should never
happen with healthy guests and so is already considered as
unlikely code path.

This patch moves these bits into non-inline dedicated functions
to reduce the I-cache pressure.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
2019-06-13 23:54:29 +09:00
Maxime Coquelin
5a5f6e78b2 vhost: do not inline packed and split functions
At runtime either packed Tx/Rx functions will always be called,
or split Tx/Rx functions will always be called.

This patch removes the forced inlining in order to reduce
the I-cache pressure.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
2019-06-13 23:54:29 +09:00
Maxime Coquelin
094b643d9b vhost: un-inline dirty pages logging functions
In order to reduce the I-cache pressure, this patch removes
the inlining of the dirty pages logging functions, that we
can consider as cold path.

Indeed, these functions are only called while doing live
migration, so not called most of the time.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
2019-06-13 23:54:29 +09:00
Tom Barbette
5e74137765 ethdev: add API to read device clock
Add rte_eth_read_clock to read the raw clock of a device.

The main use is to get the device clock conversion co-efficients to be
able to translate the raw clock of the timestamp field of the pkt mbuf
to a local synced time value.

This function was missing to allow users to convert the Rx timestamp
field to real time without the complexity of the rte_timesync* facility.
One can derivate the clock frequency by calling twice read_clock and
then keep a common time base.

Signed-off-by: Tom Barbette <barbette@kth.se>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-06 20:21:20 +09:00
Jerin Jacob
557c5cbde3 acl: fix build with some arm64 compiler
Some compilers reporting the following error, though the existing
code doesn't have any uninitialized variable case.
Just to make compiler happy, initialize the int32x4_t variable
one shot using vdupq_n_s32.

lib/librte_acl/acl_run_neon.h: In function 'search_neon_4'
lib/librte_acl/acl_run_neon.h:230:12: error:
  'input' may be used uninitialized in this function
  int32x4_t input;

Fixes: 34fa6c27c1 ("acl: add NEON optimization for ARMv8")
Cc: stable@dpdk.org

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2019-06-12 00:07:13 +09:00
Ruifeng Wang
474b4c1d7c hash: simplify signature compare with NEON
Replaced multiple neon instructions with single equivalent instruction.
This made simpler code and a bit higher performance.
Hash bulk lookup had 0.1% ~ 3% performance gain in tests on ARM A72
platforms.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2019-06-05 19:49:28 +02:00
Bruce Richardson
4c773788e0 build: generate Windows exports file
Rather than having a separate version.map file for linux/BSD and an
exports definition file for windows for each library, generate the
latter from the former automatically at build time.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-06-05 19:49:28 +02:00
Konstantin Ananyev
64ac6feb82 bpf: fix pseudo calls for program loaded from ELF
clang 6.0 and onwards, for the external function call generates
BPF_PSEUDO_CALL instruction:
call pseudo +-off -> call another bpf function.
More details about that change: https://lwn.net/Articles/741773/
DPDK BPF implementation right now doesn't support multiple BPF
functions per module.
To overcome that problem, and preserve existing functionality
(ability to call allowed by user external functions),
bpf_elf_load() clears EBPF_PSEUDO_CALL value.
For details how to reproduce the issue:
https://bugs.dpdk.org/show_bug.cgi?id=259

Fixes: 5dba93ae5f ("bpf: add ability to load eBPF program from ELF object file")
Cc: stable@dpdk.org

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-06-05 18:34:56 +02:00
Bruce Richardson
9bd75b508e bpf: remove use of weak functions
Weak functions don't work well with static libraries and require the use of
"whole-archive" flag to ensure that the correct function is used when
linking.  Since the weak function is only used as a placeholder within this
library alone, we can replace it with a non-weak version protected using
preprocessor ifdefs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-06-05 16:28:20 +02:00
Bruce Richardson
e53ce4e413 acl: remove use of weak functions
Weak functions don't work well with static libraries and require the use of
"whole-archive" flag to ensure that the correct function is used when
linking. Since the weak functions are only used as placeholders within
this library alone, we can replace them with non-weak functions using
preprocessor ifdefs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-06-05 16:28:11 +02:00
Honnappa Nagarahalli
b944428000 rcu: fix format specifier in dump
Use %u to fix argument type mismatch in fprintf.

Coverity issue: 340074
Fixes: 64994b56cf ("rcu: add RCU library supporting QSBR mechanism")
Cc: stable@dpdk.org

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2019-06-05 14:41:34 +02:00
Anatoly Burakov
67dd4d77e0 ipc: handle unsupported IPC in async request
Currently, IPC API will silently ignore unsupported IPC.
Fix the API call to explicitly handle unsupported IPC cases.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-06-05 11:28:10 +02:00
Anatoly Burakov
c7ef989970 ipc: handle unsupported IPC in sync request
Currently, IPC API will silently ignore unsupported IPC.
Fix the API call and its callers to explicitly handle
unsupported IPC cases.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-06-05 11:28:05 +02:00
Anatoly Burakov
144767514e ipc: handle unsupported IPC in sendmsg
Currently, IPC API will silently ignore unsupported IPC.
Fix the API call and its callers to explicitly handle
unsupported IPC cases.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-06-05 11:28:00 +02:00
Anatoly Burakov
9a4274be9e ipc: do not unregister action if IPC unsupported
Currently, unregister will be attempted even if IPC wasn't
supported in the first place. It is harmless, but for
consistency reasons, update the unregister API call to
exit early when IPC is not supported.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-06-05 11:27:43 +02:00
Anatoly Burakov
edf73dd330 ipc: handle unsupported IPC in action register
Currently, IPC API will silently ignore unsupported IPC.
Fix the API call and its callers to explicitly handle
unsupported IPC cases.

For primary processes, it is OK to not have IPC because
there may not be any secondary processes in the first place,
and there are valid use cases that disable IPC support, so
all primary process usages are fixed up to ignore IPC
failures.

For secondary processes, IPC will be crucial, so leave all
of the error handling as is.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-06-05 11:27:36 +02:00
Anatoly Burakov
c830900d75 ipc: handle unsupported IPC in init
Currently, IPC API will silently ignore unsupported IPC.
Fix the API call and its callers to explicitly handle
unsupported IPC cases.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-06-05 11:27:17 +02:00
Xiaolong Ye
7f9f46d6ce ring: remove unnecessary forward declaration
As memzone.h is introduced by
commit 38c9817ee1 ("mempool: adjust name size in related data types"),
forward declaration for rte_memzone is no longer needed.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-06-04 13:09:51 +02:00
Nicolas Dichtel
2a96c88be8 mem: ease init in a docker container
move_pages() is only used to get the numa node id, but this function
is not allowed by default in docker (it needs CAP_SYS_NICE and an update of
the seccomp profile).
get_mempolicy() also requires CAP_SYS_NICE but doesn't need any change in
the default seccomp profile.

Note that the returned value of move_pages() was not checked, thus some
errors could be hidden (if the requested id was 0).

Fixes: 582bed1e1d ("mem: support mapping hugepages at runtime")
Cc: stable@dpdk.org

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Didier Pallard <didier.pallard@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-06-04 13:03:24 +02:00
Yongseok Koh
0cb86518db bus/pci: add Mellanox kernel driver type
When checking RTE_PCI_DRV_IOVA_AS_VA flag to determine IOVA mode,
pci_one_device_has_iova_va() returns true only if kernel driver of the
device is vfio. However, Mellanox mlx4/5 PMD doesn't need to be detached
from kernel driver and attached to VFIO/UIO. Control path still goes
through the existing kernel driver, which is mlx4_core/mlx5_core. In order
to make RTE_PCI_DRV_IOVA_AS_VA effective for mlx4/mlx5 PMD, a new kernel
driver type has to be introduced.

Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2019-06-04 00:33:06 +02:00
Bruce Richardson
ffadd933ac eal/x86: check rdrand and rdseed
The meson build never checked for the presence of rdrand and rdseed
instructions, while make build never checked for rdseed. Ensure builds
always have the appropriate checks - and therefore defines - for these
instructions. For runtime, we also add in rdseed to the list of known
bits returned from cpuid() instruction, so we can confirm its presence at
application init time.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
2019-06-04 00:23:04 +02:00
Bruce Richardson
c649f0b4f5 build: add libatomic dependency for 32-bit clang
When compiling with clang on 32-bit platforms, we are missing copies
of 64-bit atomic functions. We can solve this by linking against
libatomic for the drivers and libs which need those atomic ops.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-06-03 23:57:43 +02:00
Bruce Richardson
be9d80d4df mem: mark unused function in 32-bit builds
The get_socket_mem_size() function is only used in 64-bit builds,
causing clang to warn about it for 32-bit builds. Add the __rte_unused
attribute to the function to silence the warning.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-06-03 23:56:35 +02:00
Bruce Richardson
f5256f8dfd build: remove unnecessary large file support defines
Since we now always use _FILE_OFFSET_BITS=64 flag when building
DPDK, we can remove the Makefile and C-file #defines setting it
individually for parts of the build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-06-03 23:55:50 +02:00