Commit Graph

17597 Commits

Author SHA1 Message Date
Hemant Agrawal
53a1a1f7cb raw/dpaa2_qdma: fix spin lock release
The code shall be unlock post the lock.

Fixes: c22fab9a6c ("raw/dpaa2_qdma: support configuration APIs")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-05-02 23:28:22 +02:00
Bruce Richardson
12784d9b6e build: add libbsd to pkg-config file if enabled
If libbsd is enabled in DPDK, the strlcpy and strlcat functions in
rte_string_fns.h redirect to the varients in libbsd, only using the
fallbacks if it is not enabled. Therefore, if libbsd is enabled, it needs
to be called out as a DPDK dependency in the pkgconfig file.

To ensure that we don't have undefined variables on non-Linux platforms, we
can remove the linux condition around the libbsd check - no harm comes in
looking for it on other OS, since it's an optional dependency.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-05-02 23:07:14 +02:00
Bruce Richardson
e09848337c build: fix ninja install on FreeBSD
The post-install script to symlink the PMDs from their own PMD directory to
the regular lib directory (so they would be found by ld at runtime) was
using the "-r" flag to ln to create relative symlinks. This flag is
unsupported by ln on FreeBSD causing the ninja install step to fail.

Reworking the script to take the relative driver path as parameter removes
the need for ln to calculate the relative path ensuring compatibility with
FreeBSD.

As part of the fix, we move the registration of the install script to the
config/meson.build file, from the top level one. This improves readability
as the script takes as parameters the variables set in that file.

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

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-05-02 23:07:04 +02:00
Bruce Richardson
2daf565f91 examples: install as part of ninja install
When we install dpdk onto a system, we want to put the examples into
the /usr/share/dpdk (or /usr/local/share) directory for reference.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-05-02 23:05:01 +02:00
Bruce Richardson
39ad54f76c examples/l3fwd: fix build on FreeBSD
On freebsd we need to include sys/socket.h to get the definition of
AF_INET in order to compile.

Fixes: d5ceea4ab1 ("examples/l3fwd: format IP addresses for printing")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-05-02 23:04:40 +02:00
Reshma Pattan
a385972c36 mk: disable warning for packed member pointer
gcc 9 on Fedora 30 gives an error
"taking address of packed member may result in an
unaligned pointer value" warnings.

For clang builds this warning is already disabled,
so disable "-Waddress-of-packed-member" for gcc builds
also.

Snippet of build error:
lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error:
taking address of packed member of ‘struct rte_mem_config’ may result
in an unaligned pointer value [-Werror=address-of-packed-member]
  768 |  cur_msl = &mcfg->memsegs[msl_idx];
      |            ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
2019-05-02 23:04:38 +02:00
Thomas Monjalon
86cc8ff243 maintainers: fix added or removed files
Reference to test/Makefile was forgotten when removing this file.
Reference to app/test/test_rcu* was forgotten when adding the files.

Fixes: a9de470cc7 ("test: move to app directory")
Fixes: b87089b0bb ("test/rcu: add API and functional tests")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2019-05-02 17:48:09 +02:00
Ferruh Yigit
8441eb7274 build: reduce indentation in meson check
Just syntax change to reduce indentation, no functional change.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-05-02 17:48:08 +02:00
Ferruh Yigit
e19c6de3f2 build: fix crash by disabling AVX512 with binutils 2.31
On Skylake platform, with native build, KNI kernel module crashes
because of the corrupted values passed to kernel module.

The corruption occurs because the userspace kni library works
unexpectedly. Compiler [1] is using AVX512 instructions and generated
binary is wrong [2].

It turned around gcc does its job correct, but gas is generating binary
wrong. And expected binutils 2.30, 2.31 & 2.31.1 are affected. Issue has
been fixed in binutils 2.32 with:
Commit x86: don't mistakenly scale non-8-bit displacements

AVX512 was already disabled with bintuils 2.30 [3], extending it to
2.31 & 2.31.1 too.

[1] gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2)

[2] gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90028

[3] Bugzilla ID 97 has the details.

Bugzilla ID: 249
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-05-02 17:48:07 +02:00
Ferruh Yigit
6e625189f2 build: fix meson binutils workaround
The '-mno-avx512f' compiler flag is not passed to the compiler,
detection of the binutils and setting flags works fine, but the flag
itself not used by compiler.

Removing the interim 'march_opt' variable and using directly
'machine_args' and setting '-mno-avx512f' to 'machine_args'

Fixes: 566b4d7a96 ("build: fix meson check for binutils 2.30")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-05-02 17:48:03 +02:00
Bruce Richardson
a53f14f961 raw/dpaa2_cmdif: fix warnings with GCC 9
GCC9 gives warnings if the parameter passed to printf for "%s" could be
NULL, so we need to add checks in some cases to ensure that is not the
case.

Fixes: 3298fa4853 ("raw/dpaa2_cmdif: introduce DPAA2 command interface driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-05-02 14:17:37 +02:00
Bruce Richardson
3a66890a8a raw/skeleton: fix warnings with GCC 9
GCC9 gives warnings if the parameter passed to printf for "%s" could be
NULL, so we need to add checks in some cases to ensure that is not the
case.

Fixes: 61c592a8d0 ("raw/skeleton: introduce skeleton rawdev driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-05-02 14:17:34 +02:00
Bruce Richardson
33832c1471 bus/fslmc: fix warning with GCC 9
Printing a null pointer with %s is flagged as a warning by GCC 9, and
should not be done. Replace the %s with the word "null" itself.

Fixes: 828d51d8fc ("bus/fslmc: refactor scan and probe functions")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-05-02 14:17:26 +02:00
Bruce Richardson
e81b0569cc net/ixgbe: fix warning with GCC 9
Compiling on Fedora 30, we get the following warning, causing build failure
when Werror flag is set:

../drivers/net/ixgbe/ixgbe_rxtx.c:2141:14: warning:
‘nmb’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 2141 |    rxe->mbuf = nmb;
      |    ~~~~~~~~~~^~~~~

Initializing the value to "NULL" fixes the issue.

Fixes: 8eecb3295a ("ixgbe: add LRO support")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-05-02 14:17:24 +02:00
Bruce Richardson
d0246e0fdc crypto/zuc: fix dependency check
The check for the zuc library dependency did not check for the include
file needed for compilation. It's also recommended when looking for a
library to use the name without the lib prefix.

Fixes: df1740a8db ("crypto/zuc: enable meson build")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-05-02 10:34:05 +02:00
Bruce Richardson
408bb7b07b crypto/kasumi: fix dependency check
The check for the kasumi library dependency did not check for the include
file needed for compilation. It's also recommended when looking for a
library to use the name without the lib prefix.

Fixes: 2ec2d46c62 ("crypto/kasumi: enable meson build")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-05-02 10:33:58 +02:00
Bruce Richardson
1999aeb368 crypto/snow3g: add to meson build
Snow3G driver is missing support for building with meson. Add a new
meson.build file so it can be included in the builds.

Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-05-02 10:33:52 +02:00
Peng Huang
92c9ba902d devtools: fix ABI compatibility check
The new default-taget "linux" is introduced in v19.05-rc1
but not exist in before release such as v19.02 which have
default-target "linuxapp", there is no compatibility report
when run validate-abi.sh to check ABI compatibility between
v19.05-rc1 and v19.02, changed default-target from "linux"
to "linuxapp" in validate-abi.sh

Fixes: 218c4e68c1 ("mk: use linux and freebsd in config names")
Cc: stable@dpdk.org

Signed-off-by: Peng Huang <peng.huang@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-05-02 01:44:20 +02:00
Honnappa Nagarahalli
d67e6ecf46 doc: add RCU guide
Add lib RCU QSBR programmer guide documentation.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2019-05-02 01:33:14 +02:00
Dharmik Thakkar
b87089b0bb test/rcu: add API and functional tests
Add API positive/negative test cases, functional tests and
performance tests.

Signed-off-by: Malvika Gupta <malvika.gupta@arm.com>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-05-02 01:33:12 +02:00
Honnappa Nagarahalli
64994b56cf rcu: add RCU library supporting QSBR mechanism
Add RCU library supporting quiescent state based memory reclamation method.
This library helps identify the quiescent state of the reader threads so
that the writers can free the memory associated with the lock less data
structures.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Acked-by: Paul E. McKenney <paulmck@linux.ibm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-05-02 01:32:41 +02:00
Nikhil Rao
bdc2f5cf71 eventdev: add experimental tag back for Rx adapter
Add the experimental tag back to the Rx event adapter callback,
the Rx event callback register and the Rx event adapter statistics
retrieval functions due to an API change to be proposed in a
future patch.

This patch also adds the experimental tag to these
function definitions and adds the functions to the EXPERIMENTAL
section of the map file, these were missing previously.

Fixes: 80bdf91dc8 ("eventdev: promote adapter functions as stable")

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2019-05-01 23:24:49 +02:00
Abhinandan Gujjar
27e6cca81a eventdev: fix crypto adapter
This patch fixes null pointer dereference and control
flow issues reported in event crypto adapter by coverity

Coverity issue: 279439, 279446, 279450, 279462
Fixes: 7901eac340 ("eventdev: add crypto adapter implementation")
Cc: stable@dpdk.org

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2019-05-01 23:08:34 +02:00
Arek Kusztal
bfd84d7e7f doc: update guide and release notes for QAT crypto
This patch adds release notes to 19.05 release document, and more
detailed description to Intel QuickAssist Technology driver
documentation files for asymmmetric crypto PMD.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
2019-05-01 16:12:47 +02:00
Anoob Joseph
ec54bc9d51 crypto/octeontx: use distinct metabuf pool for each queue
The metabuf pool is shared across all queue pairs belonging to the
PMD. In order to prevent one queue pair from starving another,
use a distinct mempool for each queue pair.

Fixes: 273487f7b3 ("crypto/octeontx: add global resource init")
Cc: stable@dpdk.org

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Shally Verma <shallyv@marvell.com>
2019-05-01 15:52:55 +02:00
Fiona Trahe
20f1cb1aaf crypto/qat: fix null cipher algo for non 8-byte multiple
NULL cipher algo of 4-byte multiple and other sizes caused firmware hang
due to use of wrong mode. Changed from ECB mode to CTR mode to fix.

Fixes: 98f0608916 ("crypto/qat: add symmetric session file")
Cc: stable@dpdk.org

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
2019-04-30 15:40:56 +02:00
Ayuj Verma
ffa89c90f3 cryptodev: include dependency in asym header
include rte_crypto_sym.h in asym header file.

Signed-off-by: Ayuj Verma <ayverma@marvell.com>
Signed-off-by: Shally Verma <shallyv@marvell.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-04-30 08:42:10 +02:00
Bruce Richardson
457b8e3729 crypto/aesni_gcm: check dependency version with make
The aesni_mb driver has a check in its Makefile for the correct version of
the IPsec_MB library, but this check was missed for the aesni_gcm driver.
Add this check to the makefile, removing an unnecessary assignment in the
process.

Suggested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-04-30 08:37:42 +02:00
Bruce Richardson
3998db2db8 crypto/aesni_mb: cleanup version check
The version check for the IPSec_MB library present in the aesni_gcm
library's meson.build file is a little cleaner than that given here,
so update this one so that both work identically.

While one could use the checks done in the other right now, potentially in
future they may have different version dependencies, or may be compiled in
different orders, so keep the code duplicated for safety, since it's only a
few lines.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-04-30 08:37:36 +02:00
Bruce Richardson
e03547408b crypto/aesni_gcm: check dependency version with meson
The aesni_mb driver and the aesni_gcm driver both require the same version
of the IPSec_MB library, but only the former has a check of the library
found by meson to see if it's the correct version. Add a similar check to
the aesni_gcm library's meson.build file, so that the auto-detection of
dependencies works correctly.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-04-30 08:37:13 +02:00
Akhil Goyal
1b7bfa14f5 examples/ipsec-secgw: fix pool usage for security session
Currently, two separate mempools are being used for creating crypto
sessions and its private data.
crypto sessions are created and initialized separately, so a separate
mempool is passed to each API, but in case of security sessions, where
only one API create and initialize the private data as well.
So if session mempool is passed to create a security session, the
mempool element size is not sufficient enough to hold the private
data as well.
As a perfect solution, the security session create API should take 2
mempools for header and private data and initiatlize accordingly,
but that would mean an API breakage, which will be done in the next
release cycle. So introducing this patch as a workaround to resolve this
issue.

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

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-04-23 14:44:26 +02:00
Konstantin Ananyev
49757b6845 examples/ipsec-secgw: fix SPD no-match case
acl_classify() returns zero value when no matching rule was found.
Currently ipsec-secgw treats it as a valid SPI value, though it has
to discard such packets.
Error could be easily observed by sending outbound unmatched packets,
user will see something like that in the log:
IPSEC: No cryptodev: core 7, cipher_algo 0, auth_algo 0, aead_algo 0

To fix it we need to treat packets with zero result from acl_classify()
as invalid ones. Also we can change DISCARD and BYPASS values to
simplify checks and save some extra space for valid SPI values.
To summarize the approach:
1. have special SPI values for DISCARD and BYPASS.
2. store in SPD full SPI value.
3. after acl_classify(), first check SPI value for DISCARD and BYPASS,
   then convert it in SA index.
4. add check at initilisation time that for each SPD rule there is a
   corresponding SA entry (with the same SPI).

Also marked few global variables as *static*.

Fixes: 906257e965 ("examples/ipsec-secgw: support IPv6")
Fixes: 2a5106af13 ("examples/ipsec-secgw: fix corner case for SPI value")
Cc: stable@dpdk.org

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-04-23 14:44:01 +02:00
Thomas Monjalon
7f251bcf22 version: 19.05-rc2
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2019-04-23 00:43:52 +02:00
Thomas Monjalon
c5e2e08529 doc: fix heading levels in bbdev test guide
The section "Test Vector files" should not be at the same level as
the main title "dpdk-test-bbdev Application".

Fixes: f714a18885 ("app/testbbdev: add test application for bbdev")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
2019-04-23 00:26:33 +02:00
Andrius Sirvys
72ec13b0a1 bitrate: fix unchecked return value
Checking the return value of rte_metrics_update_values, if failed
returning that value.
Coverity had picked up that that the return value wasn't being checked.

Coverity issue: 336863
Fixes: 2ad7ba9a65 ("bitrate: add bitrate statistics library")
Cc: stable@dpdk.org

Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2019-04-23 00:19:06 +02:00
Bruce Richardson
17250a2aff app/testpmd: fix variable use before null check
The value returned from rte_eth_dev_tx_offload_name() function is used
for string comparison before being checked for NULL. Move the NULL check
up to be done first.

Coverity issue: 279438
Fixes: c73a907187 ("app/testpmd: add commands to test new offload API")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
2019-04-23 00:15:10 +02:00
Bruce Richardson
f2088e785c net/i40e: fix dereference before check when getting EEPROM
As flagged by coverity, the "info" structure is being explicitly
dereferenced before being checked later for a NULL value.

Coverity issue: 277241
Fixes: 98e60c0d43 ("net/i40e: add module EEPROM callbacks for i40e")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
2019-04-23 00:15:10 +02:00
Bruce Richardson
3f1b8bf913 net/i40e: fix dereference before null check in mbuf release
Coverity flags that the txq variable is used before it's checked for NULL.
Also fix typo in error message.

Coverity issue: 195023
Fixes: 24853544c8 ("net/i40e: fix mbuf free in vector Tx")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
2019-04-23 00:15:10 +02:00
Bruce Richardson
6fd5b5734f examples/vhost_scsi: fix null-check for parameter
Coverity points out that there is a check in the main thread loop for the
ctrlr->bdev being NULL, but by that stage the pointer has already been
dereferenced. Therefore, for safety, before we enter the loop do an
initial check on the parameter structure.

Coverity issue: 158657
Fixes: db75c7af19 ("examples/vhost_scsi: introduce a new sample app")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
2019-04-23 00:15:10 +02:00
Bruce Richardson
f380206979 examples/vhost_scsi: fix header check for meson build
The header check for the example app was looking for virtio_scsi.h without
the "linux/" prefix, which meant it was never getting found when it should
have been.

Fixes: 8d47a753b7 ("examples/vhost_scsi: disable build if missing dependency")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
2019-04-23 00:15:10 +02:00
David Christensen
70b2c7f12c examples/power: fix build with some disabled PMDs
Running the devtools/test-build.sh script on IBM Power systems fails
because the IXGBE_PMD is explicity disabled for Power as an untested
driver, but the examples/vm_power_manager application has a hard
dependency on a function call in the IXGBE_PMD.

Modify the example application so that all dependencies on PMD code
are conditionally compiled.

Bugzilla ID: 237
Fixes: c9a4779135 ("examples/vm_power_mgr: set MAC address of VF")

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: David Hunt <david.hunt@intel.com>
2019-04-23 00:15:10 +02:00
Reshma Pattan
7e7b7a1f42 examples/power: fix overflowed value
Fix the data type of last_branches, last_branch_misses
from uint32_t to uint64_t, and for hits_diff, miss_diff
from int to int64_t respectively to fix possible
overflow or truncation.

Coverity issue: 337677
Fixes: 4b1a631b8a ("examples/vm_power: add oob monitoring functions")
Cc: stable@dpdk.org

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-04-23 00:15:10 +02:00
Reshma Pattan
57fad3e25f examples/power: fix string overflow
Use strlcpy instead of strcpy to fix string overflow.

Coverity issue: 337671
Fixes: a63504a90f ("examples/power: add JSON string handling")
Cc: stable@dpdk.org

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2019-04-23 00:15:10 +02:00
Reshma Pattan
4c2caea070 examples/power: fix string null termination
After the read() the jason_data null termination is missing
for the case "indent < 0", for "indent > 0" and "indent == 0"
cases null termination is already handled.

So add the missing case "indent < 0" to the existing "indent == 0"
case to fix null termination.

Coverity issue: 337680
Fixes: a63504a90f ("examples/power: add JSON string handling")
Cc: stable@dpdk.org

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2019-04-23 00:15:10 +02:00
David Hunt
958d14d386 examples/power: fix unreachable VF MAC init
A for loop to MAX_VFS had a break as the last line, so the w++
would never get called, breaking out of the loop after the
first iteration. Remove the break so that the loop can execute
properly.

Coverity issue: 337682
Fixes: ace158c4a8 ("examples/vm_power: add check for port count")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
2019-04-23 00:15:10 +02:00
David Hunt
da4ac8e599 examples/power: fix resource leak
Coverity issue: 337674
Fixes: 99a968fac0 ("examples/vm_power: add core list parameter")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
2019-04-23 00:15:10 +02:00
David Hunt
751227a08d power: fix buffer overruns
A previous change removed the limit of 64 cores by
moving away from 64-bit masks to char arrays. However
this left a buffer overrun issue, where the max channels
was defined as 64, and max cores was defined as 256. These
should all be consistently set to RTE_MAX_LCORE.

The #defines being removed are CHANNEL_CMDS_MAX_CPUS,
CHANNEL_CMDS_MAX_CHANNELS, POWER_MGR_MAX_CPUS, and
CHANNEL_CMDS_MAX_VM_CHANNELS, and are being replaced
with RTE_MAX_LCORE for consistency and simplicity.

Coverity issue: 337672, 337673, 337678
Fixes: fd73630e95 ("examples/power: change 64-bit masks to arrays")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-04-23 00:15:10 +02:00
Lee Daly
a0d15e43e4 power: fix max frequency after turbo disabling
This patch will ensure the correct max frequency of a core is set in
the lcore_power_info struct when disabling turbo, while using the
intel pstate driver.

Fixes: e6c6dc0f96 ("power: add p-state driver compatibility")
Cc: stable@dpdk.org

Signed-off-by: Lee Daly <lee.daly@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Acked-by: Liang Ma <liang.j.ma@intel.com>
2019-04-23 00:15:09 +02:00
Marcin Hajkowski
2653bee888 test/power: check all environment types
Test all existing power environment configuration to verify if related
data is properly initialized and clean in set/unset scenarios.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-04-22 22:46:13 +02:00
Marcin Hajkowski
dae173f892 power: reset function pointers on unset environment
Set all power environment related function pointers to NULL
when unset is being made.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-04-22 22:45:51 +02:00