Commit Graph

14659 Commits

Author SHA1 Message Date
Phil Yang
dbfb8ec709 app/testpmd: optimize mbuf pool allocation
By default, testpmd will create membuf pool for all NUMA nodes and
ignore EAL configuration.

Count the number of available NUMA according to EAL core mask or core
list configuration. Optimized by only creating membuf pool for those
nodes.

Fixes: c9cafcc82d ("app/testpmd: fix mempool creation by socket id")
Cc: stable@dpdk.org

Signed-off-by: Phil Yang <phil.yang@arm.com>
Acked-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-09-19 15:21:36 +02:00
Anatoly Burakov
c127be93f6 mem: support using memfd segments for in-memory mode
Enable using memfd-created segments if supported by the system.

This will allow having real fd's for pages but without hugetlbfs
mounts, which will enable in-memory mode to be used with virtio.

The implementation is mostly piggy-backing on existing real-fd
code, except that we no longer need to unlink any files or track
per-page locks in single-file segments mode, because in-memory
mode does not support secondary processes anyway.

We move some checks from EAL command-line parsing code to memalloc
because it is now possible to use single-file segments mode with
in-memory mode, but only if memfd is supported.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-09-19 15:02:19 +02:00
Anatoly Burakov
3a44687139 mem: allow querying offset into segment fd
In a few cases, user may need to query offset into fd for a
particular memory segment (for example, to selectively map
pages). This commit adds a new API to do that.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-09-19 15:01:58 +02:00
Anatoly Burakov
41dbdb6872 mem: add external API to retrieve page fd
Now that we can retrieve page fd's internally, we can expose it
as an external API. This will add two flavors of API - thread-safe
and non-thread-safe. Fix up internal API's to return values we need
without modifying rte_errno internally if called from within EAL.

We do not want calling code to accidentally close an internal fd, so
we make a duplicate of it before we return it to the user. Caller is
therefore responsible for closing this fd.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-09-19 14:48:04 +02:00
Anatoly Burakov
1009ba1704 mem: add internal API to get and set segment fd
Enable setting and retrieving segment fd's internally.

For now, retrieving fd's will not be used anywhere until we
get an external API, but it will be useful for things like
virtio, where we wish to share segment fd's.

Setting segment fd's will not be available as a public API
at this time, but internally it is needed for legacy mode,
because we're not allocating our hugepages in memalloc in
legacy mode case, and we still need to store the fd.

Another user of get segment fd API is memseg info dump, to
show which pages use which fd's.

Not supported on FreeBSD.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-09-19 14:46:34 +02:00
Anatoly Burakov
16cab6e5c8 mem: track page fd in non-single file mode
Previously, we were only tracking lock file fd's in single-file
segments mode, but did not track fd's in non-single file mode
because we didn't need to (mmap() call still kept the lock). Now
that we are going to expose these fd's to the world, we need to
have access to them, so track them even in non-single file
segments mode.

We don't need to close fd's after mmap() because we're still
tracking them in an fd list. Also, for anonymous hugepages mode,
fd will always be -1 so exit early on error.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-09-19 14:44:11 +02:00
Anatoly Burakov
a033a4158b mem: rename lock list to fd list
Previously, we were only using lock lists to store per-page lock fd's
because we cannot use modern fcntl() file description locks to lock
parts of the page in single file segments mode.

Now, we will be using this list to store either lock fd's (along with
memseg list fd) in single file segments mode, or per-page fd's (and set
memseg list fd to -1), so rename the list accordingly.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-09-19 14:43:14 +02:00
Anatoly Burakov
18329a4366 mem: raise maximum fd limit unconditionally
Previously, when we allocated hugepages, we closed the fd's corresponding
to them after we've done our mappings. Since we did mmap(), we didn't
actually lose the reference, but file descriptors used for mmap() do not
count against the fd limit. Since we are going to store all of our fd's,
we will hit the fd limit much more often when using smaller page sizes.

Fix this to raise the fd limit to maximum unconditionally.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-09-19 14:41:38 +02:00
Anatoly Burakov
d4ce95d6b4 eal: do not allow legacy mode with --in-memory mode
In-memory mode was never meant to support legacy mode, because we
cannot sort anonymous pages anyway.

Fixes: 72b49ff623 ("mem: support --in-memory mode")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-09-19 14:40:56 +02:00
Anatoly Burakov
310aa7c041 fbarray: fix detach in --no-shconf mode
In noshconf mode, no shared files are created, but we're still trying
to unlink them, resulting in detach/destroy failure even though it
should have succeeded. Fix it by exiting early in noshconf mode.

Fixes: 3ee2cde248 ("fbarray: support --no-shconf mode")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-09-19 14:40:18 +02:00
Gaetan Rivet
b0236c7cf7 eal: add strscpy function
The strncpy function has long been deemed unsafe for use,
in favor of strlcpy or snprintf.

While snprintf is standard and strlcpy is still largely available,
they both have issues regarding error checking and performance.

Both will force reading the source buffer past the requested size
if the input is not a proper c-string, and will return the expected
number of bytes copied, meaning that error checking needs to verify
that the number of bytes copied is not superior to the destination
size.

This contributes to awkward code flow, unclear error checking and
potential issues with malformed input.

The function strscpy has been discussed for some time already and
has been made available in the linux kernel[1].

Propose this new function as a safe alternative.

[1]: http://git.kernel.org/linus/30c44659f4a3

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-09-19 11:38:19 +02:00
David Marchand
c4833b8ed3 mbuf: remove deprecated segment free functions
__rte_mbuf_raw_free and __rte_pktmbuf_prefree_seg have been deprecated for
a long time now (early 17.05), are not part of the abi and are easily
replaced with existing api.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-19 10:35:01 +02:00
Luca Boccassi
7abb521d2c event/opdl: add in meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:53:35 +02:00
Luca Boccassi
76ca29a7d6 event/opdl: rename map file to match library name
So that it can be used from Meson as well

Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:53:35 +02:00
Luca Boccassi
8fabc16808 baseband/null: add in meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:53:35 +02:00
Luca Boccassi
cd2b6458a1 crypto/scheduler: add in meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:53:35 +02:00
Luca Boccassi
263b9ba2d3 net/vmxnet3: add in meson build
Note that the library built by meson will not have the _uio suffix:
librte_pmd_vmxnet3.so - as it follows the directory name, while the
legacy makefile rename it to librte_pmd_vmxnet3_uio.so.

Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:53:35 +02:00
Luca Boccassi
30d3d01683 net/qede: add in meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Shahed Shaikh <shahed.shaikh@cavium.com>
2018-09-18 22:53:35 +02:00
Luca Boccassi
9fc43dbfd6 net/vdev_netvsc: add in meson build
Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:49:39 +02:00
Luca Boccassi
095cae3668 net/tap: add in meson build
Use same autoconf generation mechanism as the MLX4/5 PMDs

Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-09-18 22:48:49 +02:00
Luca Boccassi
720b14db3a build: generate API documentation with meson
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-18 15:50:54 +02:00
Luca Boccassi
282628a231 build: use same version as make showversion in meson
make showversion will print 18.11.0-rc0 but Meson sets 18.11-rc0,
causing among other things a difference in the generated documentation.

Fixes: 76b9d9de5c ("version: 18.11-rc0")

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-18 15:50:17 +02:00
Luca Boccassi
98d0538796 mk: use templated doxygen config
This will allow the same config file to be used from Meson.
The result has been verified to be identical via diffoscope.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-18 15:49:48 +02:00
Luca Boccassi
8260f4f98c mk: use script to generate examples.dox
This will make it possible to generate the file in the same way from
Meson as well.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-18 15:49:29 +02:00
Bruce Richardson
77a5e7cdb2 build: fix compatibility with meson 0.41 onwards
Versions of meson prior to 0.47 flattened the parameters to the
"set_variable" function, which meant that the function could not take
array variables as a parameter. Therefore, we need to disable driver
tracking for those older versions, in order to maintain compatibility
with the minimum supported 0.41 version, and also v0.45 shipped in
Ubuntu 18.04 release.

Fixes: 806c45dd48 ("build: add configuration summary at end of config")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Timothy Redaelli <tredaelli@redhat.com>
2018-09-18 15:18:52 +02:00
Bruce Richardson
e4f2047190 devtools: use shared libs to save space in build test
For usability, the default build type in meson is static, so that
binaries can be run from the build directory easily. However, static
builds take more space, so for build-testing purposes default to using
shared builds where possible.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2018-09-18 15:11:46 +02:00
Reshma Pattan
2c6c3e0dc8 pdump: remove dependency on libpthread
pdump library now uses generic multi process channel
and it is no more dependent on the pthreads, so remove
the dependency from the Makefile.

Fixes: 660098d61f ("pdump: use generic multi-process channel")
Cc: stable@dpdk.org

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-09-18 11:48:32 +02:00
Bruce Richardson
806c45dd48 build: add configuration summary at end of config
After running meson to configure a DPDK build, it can be useful to know
what was automatically enabled or disabled. Therefore, print out by way of
summary a categorised list of libraries and drivers to be built.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-17 13:58:40 +02:00
Bruce Richardson
34b3d7a4a4 build: simplify logic for default library dependencies
EAL is a standard dependency of all libraries, except for those built
before it. We can therefore simplify the logic by just checking if EAL
has been processed, and make it a standard dependency if so.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-17 13:51:25 +02:00
Luca Boccassi
983f089696 build: create relative symlinks for PMDs in libdir
Add -r option to ln, otherwise the link will be absolute and contain
the build path and break packaging among other things:

lrwxrwxrwx 1 bluca bluca     99 Sep 11 22:17 librte_mempool_dpaa.so.1.1
  -> /home/bluca/git/dpdk/testt4//usr/local/lib/x86_64-linux-gnu/dpdk/
     drivers/librte_mempool_dpaa.so.1.1

With -r:

lrwxrwxrwx 1 bluca bluca     35 Sep 12 18:13 librte_pmd_zlib.so.1.1
  -> dpdk/drivers/librte_pmd_zlib.so.1.1

Fixes: ed4d43d73e ("build: symlink drivers to library directory")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
Tested-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-17 13:36:52 +02:00
Luca Boccassi
54d609a138 build: add ppc64 meson build
This has been only build-tested for now, on a native ppc64el POWER8E
machine running Debian sid.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-17 12:21:17 +02:00
Luca Boccassi
e0974f31c6 igb_uio: install module when building with meson
Install in $kerneldir/../extra/dpdk. Usually $kerneldir should something
like: /lib/modules/$kver/build, so this directory will match the default
one used by legacy makefiles.

Fixes: a52f4574f7 ("igb_uio: build with meson")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-17 12:18:30 +02:00
Luca Boccassi
60bd13a296 net/i40e: use -Wno-error=format-security for meson
This PMD is built with -Wno-format, which means GCC errors out if
-Wformat-security is used.

Fixes: e940646b20 ("drivers/net: build Intel NIC PMDs with meson")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-17 12:18:13 +02:00
Luca Boccassi
fd5a5cf7a9 raw/ifpga: use -Wno-error=format-security for meson
This PMD is built with -Wno-format, which means GCC errors out if
-Wformat-security is used.

Fixes: 56bb54ea1b ("raw/ifpga/base: add Intel FPGA OPAE share code")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-17 12:17:24 +02:00
Luca Boccassi
888904417d eal: include missing hypervisor files in meson
They are built by the legacy makefiles but not by Meson.

Fixes: 8f40ee0734 ("eal/x86: get hypervisor name")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-09-17 12:17:02 +02:00
Bruce Richardson
7a9eac0974 compat: fix symbol version support with meson
For meson builds, the define to enable the symbol version
macros in rte_compat.h was missing. This led to symbols being
omitted from shared objects. For example, checking rte_distributor.so
with objdump and comparing make and meson built versions:

$ objdump -T make-build/lib/librte_distributor.so | grep _flush
 0000000000001b60 g    DF .text	00000000000000a7 (DPDK_2.0)   rte_distributor_flush
 0000000000003f10 g    DF .text	0000000000000434  DPDK_17.05  rte_distributor_flush
$ objdump -T meson-build/lib/librte_distributor.so | grep _flush
 0000000000001d50 g    DF .text	00000000000000fb  DPDK_2.0    rte_distributor_flush

Adding in the missing define fixes this.

Fixes: 5b9656b157 ("lib: build with meson")
Cc: stable@dpdk.org

Reported-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Luca Boccassi <bluca@debian.org>
2018-09-17 11:52:57 +02:00
Ashish Gupta
0b5284ad57 crypto/openssl: replace macros by static inline functions
Replace macros by static inline functions in openssl version
compatibility layer

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2018-08-30 05:10:50 +02:00
Hemant Agrawal
1bc489ca09 examples/ipsec-secgw: support 3DES-CBC
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2018-08-30 05:10:50 +02:00
Kamil Chalupnik
ad45893579 app/bbdev: fix inputs mbuf creation
Omitting inputs and outputs mbuf creation for BaseBand Null Device
as inputs and outputs data do not exist for Null Device

Fixes: b2a4654f08 ("mempool: check for zero size creation")
Cc: stable@dpdk.org

Signed-off-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
2018-08-30 05:10:50 +02:00
Fiona Trahe
df8cca4633 compress/qat: use compression specific driver name
The QAT compression driver was named "qat".
Rename to compress_qat for consistency with other compressdev drivers
and with crypto_qat.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
2018-08-30 05:10:50 +02:00
Fiona Trahe
6a3e44717d crypto/qat: fix typo
Fixes: f9a3d7f68f ("crypto/qat: move code into appropriate files")

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
2018-08-30 05:10:50 +02:00
Fiona Trahe
7ce27b9e5c doc: describe qat build config options
Added description of the build configuration options for QAT.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
2018-08-30 05:10:50 +02:00
Fiona Trahe
02545b6ca2 doc: update build instructions for qat PMDs
Update PMD build section.
Linked to kernel dependency section and refactored text
between those 2 sections.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
2018-08-30 05:10:50 +02:00
Fiona Trahe
59ad25fe21 doc: add overview of qat guide
Add overview of QAT doc sections and link between them.
Indent to next level all sections within
the crypto and common sections.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
2018-08-30 05:10:50 +02:00
Fiona Trahe
aa38c849cf doc: correct typo and cosmetic changes in qat guide
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
2018-08-30 05:10:50 +02:00
Fiona Trahe
b1c9177bb9 doc: add how to test in qat crypto guide
Add section to common QAT part of doc about
which tests can be used to exercise
QAT compress and crypto PMDS

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
2018-08-30 05:10:50 +02:00
Fiona Trahe
d2054aad7a doc: add limitations to qat compressdev guide
Add two missing limitations to QAT compressdev documentation.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
2018-08-30 05:10:50 +02:00
Ferruh Yigit
58c3b60969 net/i40e: remove invalid comment
Comments says "no csum error report support" but there is no check
related csum offloads. Removing the comment.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-09-14 20:19:57 +02:00
Adrien Mazarguil
96765f68de app/testpmd: show errno along with flow API errors
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-09-14 20:08:41 +02:00
Stephen Hemminger
dc7680e859 net/netvsc: support integrated VF
Integrate accelerated networking support into netvsc PMD.
This allows netvsc to manage VF without using failsafe or vdev_netvsc.
For the exception vswitch path some tests like transmit
get a 22% increase in packets/sec.
For the VF path, the code is slightly shorter but has no
real change in performance.

Pro:
   * using netvsc is more like other DPDK NIC's
   * the exception packet uses less CPU
   * much smaller code size
   * no locking required on VF transmit/receive path
   * no legacy Linux network device to get mangled by userspace
   * much simpler (1K vs 9K) LOC
   * unified extended statistics

Con:
   * using netvsc has more complex startup model
   * no bifurcated driver support
   * no flow support (since host does not have flow API).
   * no tunnel offload support
   * no receive interrupt support

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-09-14 20:08:41 +02:00