Commit Graph

1630 Commits

Author SHA1 Message Date
Jiayu Hu
1b7b24389c vhost: enhance async enqueue for small packets
Async enqueue offloads large copies to DMA devices, and small copies
are still performed by the CPU. However, it requires users to get
enqueue completed packets by rte_vhost_poll_enqueue_completed(), even
if they are completed by the CPU when rte_vhost_submit_enqueue_burst()
returns. This design incurs extra overheads of tracking completed
pktmbufs and function calls, thus degrading performance on small packets.

This patch enhances async enqueue for small packets by enabling
rte_vhost_submit_enqueue_burst() to return completed packets.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-01-13 18:51:58 +01:00
Dmitry Kozlyuk
da042bcfc6 build: fix linker flags on Windows
The --export-dynamic linker option is only applicable to ELF.
On Windows, where COFF is used, it causes warnings:

    x86_64-w64-mingw32-ld: warning: --export-dynamic is not supported
    for PE+ targets, did you mean --export-all-symbols? (MinGW)

    LINK : warning LNK4044: unrecognized option '/-export-dynamic';
    ignored (clang)

Don't add --export-dynamic on Windows anywhere.

Fixes: b031e13d7f ("build: fix plugin load on static build")
Cc: stable@dpdk.org

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
2021-01-13 22:13:37 +01:00
Joyce Kong
96d1d898dc examples/vhost_blk: replace SMP barrier with thread fence
Simply replace the rte_smp_mb barriers with SEQ_CST atomic thread fence,
if there is no load/store operations.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-01-08 18:07:55 +01:00
Joyce Kong
111cf3f497 examples/vhost: relax memory ordering when enqueue/dequeue
Use C11 atomic APIs with one-way barriers to replace two-way
barriers when operating enqueue/dequeue. Used->idx and avail->idx
are the synchronization points for split vring.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-01-08 18:07:55 +01:00
Olivier Matz
b031e13d7f build: fix plugin load on static build
When dpdk is compiled as static libraries, it is not possible
to load a plugin from an application. We get the following error:

  EAL: librte_pmd_xxxx.so: undefined symbol: per_lcore__rte_errno

This happens because the dpdk symbols are not exported. Add them to the
dynamic symbol table by using '-Wl,--export-dynamic'. This option was
previously present when compiled with Makefiles, it was introduced in
commit f9a08f6502 ("eal: add support for shared object drivers")

Also add it to the pkg-config file.

Fixes: 16ade738fd ("app/testpmd: build with meson")
Fixes: 89f0711f9d ("examples: build some samples with meson")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
2021-01-05 23:01:36 +01:00
Gregory Etelson
6184a02223 examples/l3fwd-power: check packet types after start
l3fwd-power uses `--parse-ptype' parameter to query egress packets
type.  Before that feature is enabled l3fwd-power verifies PMD ability
to advertise supported packet types with
rte_eth_dev_get_supported_ptypes().

The above ethdev function API contains this note:
"
Better to invoke this API after the device is already started or rx burst
function is decided, to obtain correct supported ptypes.
"

The patch updates code for PMDs that register supported types after
dev_start.

Fixes: 82bea46616 ("examples/l3fwd-power: add --parse-ptype option")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
2020-11-22 18:27:08 +01:00
Bruce Richardson
aba2af9936 examples/multi_process: add SPDX license tag to makefiles
The makefiles for some of the multi_process example files were missing
SPDX license headers, so add them. These Makefiles completely replaced
the older makefiles and were written from scratch, not based on previous
versions, so add a new copyright year on them.

Fixes: 13abe17c3c ("examples/multi_process: convert to pkg-config-based build")

Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-20 17:32:23 +01:00
Savinay Dharmappa
5ba66e8c2a examples/qos_sched: fix subport configuration
Update the qos_sched user guide and profile config file
with default subport profile.

Fixes: 802d214dc8 ("examples/qos_sched: update subport rate dynamically")

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-11-20 12:50:41 +01:00
Stephen Hemminger
db27370b57 eal: replace blacklist/whitelist options
Replace -w / --pci-whitelist with -a / --allow options
and --pci-blacklist with --block.
The -b short option remains unchanged.

Allow the old options for now, but print a nag
warning since old options are deprecated.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-11-16 00:11:22 +01:00
David Marchand
bc8e32473c examples: restore trace point
Before make removal, those examples were built with experimental flag
for tracepoints to be compiled in but the pkg-config part of those
makefiles were missed.

Fixes: 78d44153de ("ethdev: add tracepoints")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-15 15:35:11 +01:00
David Marchand
090693344b examples/rxtx_callbacks: fix build with pkg-config
This example is missing the experimental flag since it uses an
experimental API.

Fixes: cd1dadeb9b ("examples/rxtx_callbacks: support HW timestamp")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-15 15:34:50 +01:00
David Marchand
9c3586a643 examples/vhost_blk: fix build with pkg-config
vhost_blk.c: In function ‘ctrlr_worker’:
vhost_blk.c:543:2: warning: implicit declaration of function ‘CPU_ZERO’
[-Wimplicit-function-declaration]
  543 |  CPU_ZERO(&cpuset);
      |  ^~~~~~~~
vhost_blk.c:544:2: warning: implicit declaration of function ‘CPU_SET’
[-Wimplicit-function-declaration]
  544 |  CPU_SET(0, &cpuset);
      |  ^~~~~~~
vhost_blk.c:545:2: warning: implicit declaration of function
‘pthread_setaffinity_np’ [-Wimplicit-function-declaration]
  545 |  pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);
      |  ^~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cczpiMWH.o: in function `ctrlr_worker':
vhost_blk.c:(.text+0x1076): undefined reference to `CPU_ZERO'
/usr/bin/ld: vhost_blk.c:(.text+0x1082): undefined reference to
`CPU_SET'
collect2: error: ld returned 1 exit status
gmake: *** [Makefile:34: build/vhost-blk-shared] Error 1

Explicitly pass _GNU_SOURCE and include missing headers (rather than
rely on automagic inclusion from other system headers).

Fixes: c19beb3f38 ("examples/vhost_blk: introduce vhost storage sample")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-15 15:33:05 +01:00
David Marchand
e0216ac509 examples/performance-thread: fix build with pkg-config
main.c: In function ‘lthread_tx’:
main.c:2091:25: error: implicit declaration of function ‘sched_getcpu’;
 did you mean ‘sched_getparam’? [-Werror=implicit-function-declaration]
 2091 |  tx_conf->conf.cpu_id = sched_getcpu();
      |                         ^~~~~~~~~~~~
      |                         sched_getparam
cc1: all warnings being treated as errors

Explicitly pass _GNU_SOURCE and include missing header (rather than
rely on automagic inclusion from other system headers).

Fixes: d48415e1fe ("examples/performance-thread: add l3fwd-thread app")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-11-15 15:31:15 +01:00
David Marchand
9bb2997cb7 examples/ntb: fix clean target
When introducing this example, the cleanup from commit 7e9562a107
("examples: fix make clean when using pkg-config") was missed.

Fixes: c5eebf85ba ("examples/ntb: add example for NTB")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2020-11-15 15:30:21 +01:00
David Marchand
db886c51df examples/l3fwd-graph: fix pkg-config usage
This example missed the fixes from commit 69b1bb49ed
("examples: hide error for missing pkg-config path flag") and
commit 12a652a02b ("examples: fix build with old pkg-config").

Fixes: 08bd1a1744 ("examples/l3fwd-graph: add graph-based l3fwd skeleton")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-11-15 15:29:34 +01:00
David Marchand
0738209c23 examples/l3fwd-graph: fix static build
This example missed the rework from commit 8549295db0
("build/pkg-config: improve static linking flags").

Fixes: 08bd1a1744 ("examples/l3fwd-graph: add graph-based l3fwd skeleton")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-15 15:29:29 +01:00
David Marchand
bcd3004381 examples/l2fwd-crypto: fix build with pkg-config
Two issues fixed here.

First add the experimental flag.
Then fix a link issue with the crypto scheduler driver:
/usr/bin/ld: /tmp/cchr7aHA.o: in function `main':
main.c:(.text.startup+0x1673): undefined reference to
`rte_cryptodev_scheduler_workers_get'
collect2: error: ld returned 1 exit status

Fixes: e3bcb99a5e ("examples/l2fwd-crypto: limit number of sessions")
Fixes: 261bbff75e ("examples: use separate crypto session mempools")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-11-15 15:29:24 +01:00
David Marchand
58a0648bd3 examples/kni: fix build with pkg-config
rm -f build/kni build/kni-static build/kni-shared
test -d build && rmdir -p build || true
[...]
/usr/bin/ld: /tmp/cc72ssnK.o: undefined reference to symbol
'pthread_join@@GLIBC_2.2.5'

This example explicitly call pthread API and should be linked against
the pthread library.

Fixes: 724beb913b ("examples/kni: monitor and update link state continually")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-15 15:29:23 +01:00
David Marchand
13db2494e8 examples/ipsec-gw: fix build with pkg-config
flow.c: In function ‘parse_flow_tokens’:
flow.c:153:23: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
  153 |     if (ipv4_addr_cpy(&rule->ipv4.spec.hdr.src_addr,
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flow.c:154:9: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
  154 |         &rule->ipv4.mask.hdr.src_addr,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flow.c:170:23: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
  170 |     if (ipv4_addr_cpy(&rule->ipv4.spec.hdr.dst_addr,
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flow.c:171:9: error: taking address of packed member of ‘struct
rte_ipv4_hdr’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
  171 |         &rule->ipv4.mask.hdr.dst_addr,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Meson build is fine since we waive those warnings.
Replicate it for make.

Fixes: 8e693616fc ("examples/ipsec-secgw: enable flow based distribution")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-15 15:29:22 +01:00
David Marchand
0525677c81 examples/fips_validation: fix build with pkg-config
When this example started using rte_cryptodev_sym_session_pool_create,
the part for pkg-config builds was not updated.

Fixes: 261bbff75e ("examples: use separate crypto session mempools")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-15 15:29:19 +01:00
Cheng Jiang
6e9a9d2a02 examples/vhost: fix ioat dependency
Fix vhost-switch compiling issue when ioat dependency is missing.
Change 'RTE_x86' check into 'RTE_RAW_IOAT' check in meson build file.
Use 'RTE_RAW_IOAT' to control conditional compiling in source file.
Clean some codes.

Fixes: abec60e711 ("examples/vhost: support vhost async data path")
Fixes: 3a04ecb214 ("examples/vhost: add async vhost args parsing")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: David Marchand <david.marchand@redhat.com>
2020-11-13 19:43:26 +01:00
Cheng Jiang
653b5994e8 examples/vhost: fix string split error handling
Add checking return value of string split function to fix the
coverity issue.

Coverity issue: 363739
Fixes: 3a04ecb214 ("examples/vhost: add async vhost args parsing")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-11-13 19:43:26 +01:00
Cheng Jiang
2b7126f5fc examples/vhost: check argument length
Add args length check before copying to fix the coverity issue.

Coverity issue: 363741
Fixes: 3a04ecb214 ("examples/vhost: add async vhost args parsing")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-11-13 19:43:26 +01:00
Ibtisam Tariq
854dbee2ac examples/vhost_crypto: add new line character in usage
Add new line character(\n) in the usage of vhost_crypto example for
better readability

Fixes: 709521f4c2 ("examples/vhost_crypto: support multi-core")
Cc: stable@dpdk.org

Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-11-13 19:43:25 +01:00
Ibtisam Tariq
fc48d8a5b2 examples/qos_sched: fix usage string
The short option written for interactive mode is --i in usage of
this qos_sched example. Actually, it is -i.

Fixes: cfd5c971e5 ("examples/qos_sched: add stats")
Cc: stable@dpdk.org

Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2020-11-13 14:25:57 +01:00
Bruce Richardson
3495a68f2a examples: stop processing meson file if build impossible
Once it has been determined that an example cannot be built, there is
little point in continuing to process the meson.build file for that
example, so we can use subdir_done() to return to the calling file.
This can potentially prevent problems where later statement in the file
may cause an error on systems where the app cannot be built, e.g. on
Windows or FreeBSD.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-12 19:33:36 +01:00
Bruce Richardson
b334236abd examples/l2fwd-keepalive: skip meson build if no librt
When librt is not present on a system, processing the meson.build file
for this example application causes an error. Make the library
non-mandatory and just mark the example as unbuildable if it is
not present.

Fixes: 89f0711f9d ("examples: build some samples with meson")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-12 19:33:10 +01:00
Bruce Richardson
e5b95003f1 examples: fix flattening directory layout on install
By installing the examples one-by-one in a loop in the examples
meson.build file we effectively flattened out the structure of the examples
folder and omitted some common and shared subfolders that were never
directly built.  Instead, we can remove the loop and just have the whole
"examples" folder installed as-is in a single statement, preserving its
directory structure, and thereby fixing the build of a number of the
examples.

Fixes: 2daf565f91 ("examples: install as part of ninja install")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-12 19:33:06 +01:00
Dmitry Kozlyuk
c2341bb671 cmdline: avoid name clash with Windows system types
cmdline_numtype member names clash with Windows system identifiers.
Add RTE_ prefix to cmdline constants to avoid this and possible
future conflicts.

Suggested-by: Ranjit Menon <ranjit.menon@intel.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Jie Zhou <jizh@microsoft.com>
Tested-by: Jie Zhou <jizh@microsoft.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-11-05 17:49:00 +01:00
Cheng Jiang
abec60e711 examples/vhost: support vhost async data path
This patch is to implement vhost DMA operation callbacks for CBDMA
PMD and add vhost async data-path in vhost sample. With providing
callback implementation for CBDMA, vswitch can leverage IOAT to
accelerate vhost async data-path.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-11-03 23:24:26 +01:00
Cheng Jiang
3a04ecb214 examples/vhost: add async vhost args parsing
This patch is to add async vhost driver arguments parsing function
for CBDMA channel, DMA initiation function and args description.
The meson build file is changed to fix dependency problem. With
these arguments vhost device can be set to use CBDMA or CPU for
enqueue operation and bind vhost device with specific CBDMA channel
to accelerate data copy.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-11-03 23:24:26 +01:00
Vladimir Medvedkin
57ddbf7edd examples/ipsec-secgw: fix session mempool initialisation
Creation of a session mempool may fail in the case of a single lcore
and a low number of SA.

In case when there is only one lcore and number of configures SA less
then (0.5 * CDEV_MP_CACHE_SZ) then creation of the mempool fails with
EINVAL. This is because the number of requested items is less than
(cache size * CDEV_MP_CACHE_MULTIPLIER).

Hence, the number of elements in mempool is increased in such cases.

Fixes: e30b2833c4 ("security: update session create API")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-11-02 09:24:41 +01:00
Fan Zhang
601b8a54a5 fips_validation: fix GCM test
This patch fixes FIPS GCM test of the redundant plaintext string
write and insufficient test case support check for some corner
cases.

Fixes: d09abf2d10 ("examples/fips_validation: update GCM test")
Cc: stable@dpdk.org

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2020-11-02 09:24:41 +01:00
Fan Zhang
ecc3356fed examples/fips_validation: fix missed version line
This patch fixes the missing version line in the response file.

Fixes: 7936501840 ("examples/fips_validation: fix version compatibility")
Cc: stable@dpdk.org

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2020-11-02 09:24:40 +01:00
Thomas Monjalon
13ad83f18a examples/rxtx_callbacks: switch timestamp to dynamic field
The mbuf timestamp is moved to a dynamic field
in order to allow removal of the deprecated static field.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-11-03 16:21:15 +01:00
Anatoly Burakov
317a1da8d6 examples/l3fwd-power: fix race on interrupt wakeup log
Currently, the interrupt status notification prevents log spam by
remembering whether previous interrupt wakeup was due to traffic or due
to timeout expiring. However, it is a single variable that can
potentially be accessed from multiple threads, so it is not thread-safe.

Fix it by having per-lcore interrupt status.

Fixes: f4d1e19c29 ("examples/l3fwd-power: add Rx interrupt timeout")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Tested-by: Xi Zhang <xix.zhang@intel.com>
2020-11-02 11:47:19 +01:00
David Marchand
01f3496695 reorder: switch sequence number to dynamic mbuf field
The reorder library used sequence numbers stored in the deprecated field
seqn.
It is moved to a dynamic mbuf field in order to allow removal of seqn.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2020-10-31 22:14:30 +01:00
Ciara Power
bda9ce3c94 examples/fips_validation: fix leak on failure
The wb_data variable went out of scope on failure in the
get_writeback_data function. This is now freed before returning -1.

Coverity issue: 363453
Fixes: 952e10cdad ("examples/fips_validation: support scatter gather list")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2020-10-31 18:10:43 +01:00
Ciara Power
afda6b0116 examples/fips_validation: fix crash on allocation failure
The return value was not being checked when calling the
get_writeback_data function in the AES test case. On failure, this led
to a NULL dereference when using memcpy later. The return value is now
checked to avoid this NULL dereference.

Coverity issue: 363463
Fixes: 952e10cdad ("examples/fips_validation: support scatter gather list")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2020-10-31 18:00:03 +01:00
Thomas Monjalon
eb8258402b examples/rxtx_callbacks: switch TSC to dynamic field
The example used the deprecated mbuf field udata64.
It is moved to a dynamic field in order to allow removal of udata64.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-10-31 16:13:11 +01:00
Thomas Monjalon
61bf499d9c examples/bbdev: switch to dynamic mbuf field
The example used the deprecated mbuf field udata64 as input mbuf pointer.
It is moved to a dynamic field in order to allow removal of udata64.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2020-10-31 16:13:11 +01:00
Thomas Monjalon
614af75489 security: switch metadata to dynamic mbuf field
The device-specific metadata was stored in the deprecated field udata64.
It is moved to a dynamic mbuf field in order to allow removal of udata64.

The name rte_security_dynfield is not very descriptive
but it should be replaced later by separate fields for each type of data
that drivers pass to the upper layer.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2020-10-31 16:13:11 +01:00
Thomas Monjalon
7b0de673e2 examples: enclose DPDK includes with angle brackets
In examples, DPDK header files are external,
so they must be enclosed with angle brackets, not quotes.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-10-31 16:13:10 +01:00
Honnappa Nagarahalli
4e3b2d4c76 examples/performance-thread: fix build with low core count
When the value of RTE_MAX_LCORE is small, it results in the
following compilation error.

../examples/performance-thread/l3fwd-thread/main.c:2338:34: error:
iteration 4 invokes undefined behavior
[-Werror=aggressive-loop-optimizations]

Fixes: d48415e1fe ("examples/performance-thread: add l3fwd-thread app")
Cc: stable@dpdk.org

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Reviewed-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2020-10-30 15:45:59 +01:00
Bruce Richardson
27b549c12d examples/multi_process: fix build on Ubuntu 20.04
Two warnings are reported by gcc 9.3.0 on Ubuntu 20.04.

When producing a printable mac address the buffer was appropriately sized
for holding the mac address exactly, but the actual snprintf included a
'\n' character at the end, which means that the snprintf technically is
getting truncated i.e. the \n would not be added due to lack of space.
This gets flagged as a problem by modern versions of gcc, e.g. on Ubuntu
20.04.

main.c:77:37: warning: ‘__builtin___snprintf_chk’ output truncated
  before the last format character [-Wformat-truncation=]
   77 |     "%02x:%02x:%02x:%02x:%02x:%02x\n",
      |                                     ^

Since the \n is getting stripped anyway, we can fix the issue by just
removing it. In the process we can switch to using the standard ethernet
address formatting function from rte_ether.h.

The other warning is about possible string truncation when getting the
RX queue name:

In file included from init.c:36:
init.c: In function ‘init’:
../shared/common.h:38:28: warning: ‘%u’ directive output may be truncated
  writing between 1 and 10 bytes into a region of size 8
  [-Wformat-truncation=]
   38 | #define MP_CLIENT_RXQ_NAME "MProc_Client_%u_RX"
      |                            ^~~~~~~~~~~~~~~~~~~~
../shared/common.h:52:35: note: in expansion of macro ‘MP_CLIENT_RXQ_NAME’
   52 |  snprintf(buffer, sizeof(buffer), MP_CLIENT_RXQ_NAME, id);
      |                                   ^~~~~~~~~~~~~~~~~~

This is a false positive, as the value of the "id" is limited to 255,
being stored in the app as a uint8_t value, removing the possibility of
the %u being replaced by anything other then 3 characters max (rather than
up to 10 as thought by the compiler). Therefore, the warning can be easily
removed by changing the type of the "id" parameter to the local function
from "unsigned" to "uint8_t" also, ensuring the compiler is aware of the
range limit.

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

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2020-10-30 14:54:50 +01:00
Bruce Richardson
a9f57cfc08 examples/vm_power: fix build on Ubuntu 20.04
When compiling on Ubuntu 20.04, a warning was issued about possible
truncation of the path string for the power management socket.

channel_manager.c: In function ‘add_all_channels’:
channel_manager.c:470:41: warning: ‘%s’ directive output may be
  truncated writing up to 255 bytes into a region of size 90
  [-Wformat-truncation=]
  470 |     sizeof(chan_info->channel_path), "%s%s",
      |                                         ^~

This can be fixed by adding in an explicit truncation check to the code
and handling it appropriately.

Fixes: e8ae9b6625 ("examples/vm_power: channel manager and monitor in host")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2020-10-30 14:54:23 +01:00
Bruce Richardson
7157a9dcc4 examples: fix linking against specific drivers
Some example apps rely on driver-specific functionality and link explicitly
against those drivers. These apps need their makefiles updated to take
account of the renaming of the driver libs.

Fixes: a20b2c01a7 ("build: standardize component names and defines")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2020-10-30 14:33:36 +01:00
Rory Sexton
3ac192b309 examples/vm_power: fix memory leak
Fix memory leak where variable oob_enable can go out of scope leaking
the storage it points to.

Coverity issue: 337674
Fixes: 95f648ff9e ("examples/vm_power: make branch ratio threshold per core")

Signed-off-by: Rory Sexton <rory.sexton@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2020-10-30 13:16:09 +01:00
Cristian Dumitrescu
570e681079 examples/ip_pipeline: fix external build
Fix build with external makefile.

Fixes: fbc74e6633 ("examples/ip_pipeline: remove infra code")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-10-29 17:32:51 +01:00
Cristian Dumitrescu
275ebefea7 examples/pipeline: fix resource leak
Coverity issue: 363041
Fixes: 5074e1d551 ("examples/pipeline: add configuration commands")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-10-29 17:32:51 +01:00