dpdk.git
8 years agotable: remove unnecessary acl dump
Jasvinder Singh [Thu, 19 May 2016 14:35:08 +0000 (15:35 +0100)]
table: remove unnecessary acl dump

Removes rte_acl_dump() call from rte_table_acl_build () as it invokes
number of printf messages.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/l2fwd-crypto: fix supported key size check
Pablo de Lara [Tue, 12 Apr 2016 10:04:03 +0000 (11:04 +0100)]
examples/l2fwd-crypto: fix supported key size check

When initializing crypto devices within the app,
the provided key sizes are checked against the supported
sizes from the crypto device capabilities.

When the supported sizes are not a range, but a single value,
the check may become an infinite loop (when size is not supported).

Fixes: a061e50a0d97 ("examples/l2fwd-crypto: fix ambiguous input key size")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
8 years agodoc: fix l2fwd-crypto sample command
Fan Zhang [Wed, 25 May 2016 09:00:15 +0000 (10:00 +0100)]
doc: fix l2fwd-crypto sample command

Corrected a typo in application name.

Corrected authentication algorithm to fit the sample 16-byte
authentication key.

Fixes: ba7b86b1 ("doc: add l2fwd-crypto sample app guide")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
8 years agoexamples/l2fwd-crypto: enable AES-XCBC-MAC authentication algo
Fan Zhang [Wed, 25 May 2016 09:00:45 +0000 (10:00 +0100)]
examples/l2fwd-crypto: enable AES-XCBC-MAC authentication algo

This patch enables AES-XCBC-MAC authentication algorithm support to
l2fwd-crypto sample application.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
8 years agoexamples/l2fwd-crypto: enable AES-CTR cipher algorithm
Fan Zhang [Fri, 3 Jun 2016 10:11:59 +0000 (11:11 +0100)]
examples/l2fwd-crypto: enable AES-CTR cipher algorithm

This patch enables AES counter mode algorithm support to l2fwd-crypto
sample application.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoaesni_mb: add AES-CTR
Fan Zhang [Fri, 3 Jun 2016 10:11:57 +0000 (11:11 +0100)]
aesni_mb: add AES-CTR

This patch provides counter mode support to AES-NI multi-buffer library.

The following cipher algorithm is enabled:
- RTE_CRYPTO_CIPHER_AES_CTR

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoapp/test: add AES-CTR
Arek Kusztal [Fri, 6 May 2016 10:22:16 +0000 (11:22 +0100)]
app/test: add AES-CTR

Added tests cases for AES working in counter mode.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
8 years agoqat: add AES-CTR capability
Arek Kusztal [Fri, 6 May 2016 10:22:15 +0000 (11:22 +0100)]
qat: add AES-CTR capability

Added possibility for AES to work in counter mode

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
8 years agoqat: set default optimization level
Arek Kusztal [Tue, 7 Jun 2016 16:58:14 +0000 (17:58 +0100)]
qat: set default optimization level

Changed to -O3 optimization flag in Intel QuickAssist Technology Makefile.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
8 years agoqat: avoid strict-aliasing break
Arek Kusztal [Tue, 7 Jun 2016 16:58:13 +0000 (17:58 +0100)]
qat: avoid strict-aliasing break

To avoid GCC warning about "dereferencing type-punned pointer will break
strict-aliasing rules" aad_len pointer is dereferenced instead of direct
dereferencing of uint32_t* cast of the middle of an array.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
8 years agoqat: fix physical address of content descriptor
Arek Kusztal [Wed, 1 Jun 2016 10:52:00 +0000 (11:52 +0100)]
qat: fix physical address of content descriptor

Fix an error with computation of physical address of
content descriptor in the symmetric operations session

Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
8 years agoqat: fix null pointer dereferencing
Deepak Kumar Jain [Wed, 18 May 2016 16:12:38 +0000 (17:12 +0100)]
qat: fix null pointer dereferencing

Fix null pointer dereferencing while clearing session

Coverity issue: 126586
Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices")

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
8 years agoaesni_mb: fix null pointer dereferencing
Deepak Kumar Jain [Tue, 7 Jun 2016 09:36:11 +0000 (10:36 +0100)]
aesni_mb: fix null pointer dereferencing

Fix null pointer dereferencing by reporting if null and
exiting the function.

Coverity issue: 126584
Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoaesni_mb: fix an indent
Deepak Kumar Jain [Tue, 7 Jun 2016 09:34:44 +0000 (10:34 +0100)]
aesni_mb: fix an indent

Fix wrong indentation for return value

Coverity issue: 126585
Fixes: 924e84f87306 ("aesni_mb: add driver for multi buffer based crypto")

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agodoc: fix supported AES-CBC key lengths
Pablo de Lara [Thu, 5 May 2016 10:00:45 +0000 (11:00 +0100)]
doc: fix supported AES-CBC key lengths

AES-NI MB PMD supports 128, 192 and 256-bit keys,
not 128, 256 and 512-bit keys.

Fixes: 924e84f87306 ("aesni_mb: add driver for multi buffer based crypto")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoivshmem: add all memzones of mempool to metadata
Ferruh Yigit [Fri, 3 Jun 2016 16:38:38 +0000 (17:38 +0100)]
ivshmem: add all memzones of mempool to metadata

Mempool consist of multiple memzones, at least from two of them.
ivshmem assumes mempool and elements are all in same memzone.

Updating code to add all memzones when a mempool added.

Fixes: d1d914ebbc25 ("mempool: allocate in several memory chunks by default")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoivshmem: document a potential crash in rte_ring
Anatoly Burakov [Wed, 1 Jun 2016 14:51:57 +0000 (15:51 +0100)]
ivshmem: document a potential crash in rte_ring

Commit 4768c475 added a pointer to the memzone in rte_ring. However,
all memzones are residing in local mem_config, therefore accessing
the memzone pointer inside the guest in an IVSHMEM-shared rte_ring
will cause segmentation fault. This issue is unlikely to ever get
fixed, as this would require lots of changes for very little benefit,
therefore we're documenting this limitation instead.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
8 years agoivshmem: fix overlap detection
Anatoly Burakov [Tue, 24 May 2016 12:50:05 +0000 (13:50 +0100)]
ivshmem: fix overlap detection

Partial revert of an earlier ill-conceived "fix".
Adjacent segments can never be considered overlapping because we
are not comparing ends to starts, but rather starts to starts.
Therefore the earlier fix was wrong (plus it also had a typo).

Fixes: d6cf31419e51 ("ivshmem: avoid infinite loop when concatenating segments")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agokni: move more kernel version check to compat header
Ferruh Yigit [Mon, 30 May 2016 11:22:34 +0000 (12:22 +0100)]
kni: move more kernel version check to compat header

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agokni: fix spacing in compat header
Ferruh Yigit [Mon, 30 May 2016 11:22:33 +0000 (12:22 +0100)]
kni: fix spacing in compat header

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agokni: fix build with kernel 4.7
Ferruh Yigit [Mon, 30 May 2016 11:22:32 +0000 (12:22 +0100)]
kni: fix build with kernel 4.7

Fix compile error because of Linux API change, 'trans_start' field
removed from 'struct net_device'.

Linux: 9b36627acecd ("net: remove dev->trans_start")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agokni: fix build clean on Ubuntu
Olivier Matz [Mon, 30 May 2016 11:56:46 +0000 (13:56 +0200)]
kni: fix build clean on Ubuntu

The $(comma) variable is not defined in this Makefile, nor in
any included Makefile. Seen while doing a "make clean" on ubuntu:

  $ make clean
  == Clean lib
  == Clean lib/librte_compat
  == Clean lib/librte_eal
  == Clean lib/librte_eal/common
  == Clean lib/librte_eal/linuxapp
  == Clean lib/librte_eal/linuxapp/eal
  == Clean lib/librte_eal/linuxapp/igb_uio
  == Clean lib/librte_eal/linuxapp/kni
  tr: missing operand after ‘.-’
  Two strings must be given when translating.
  Try 'tr --help' for more information.

This commit replaces $(comma) by a ',' character, it's not a problem in
that case since we are inside antiquotes.

Fixes: a09b359daca3 ("kni: fix build on Ubuntu 14.04")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by Ferruh Yigit <ferruh.yigit@intel.com>

8 years agomk: fix cross-compilation
Jerin Jacob [Thu, 26 May 2016 11:20:14 +0000 (16:50 +0530)]
mk: fix cross-compilation

Removed comparison against $CC in Makefiles as
in cross-compiling mode CC can be a different string
instead of string "gcc"

Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agodoc: fix typo in FreeBSD guide
Pablo de Lara [Thu, 19 May 2016 14:39:20 +0000 (15:39 +0100)]
doc: fix typo in FreeBSD guide

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agodoc: add pep8 as the python code style guidelines
John McNamara [Fri, 27 May 2016 14:57:15 +0000 (15:57 +0100)]
doc: add pep8 as the python code style guidelines

Added PEP8 to the DPDK Coding Style guidelines to cover Python
contributions to DPDK.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoscripts: check commits with checkpatch
Thomas Monjalon [Thu, 2 Jun 2016 09:13:15 +0000 (11:13 +0200)]
scripts: check commits with checkpatch

The new option -n allows to give a number of commits to check
from the git HEAD.
If neither -n nor patch files are given, the commits after
origin/master are checked.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoeal/x86: fix clang build with -O0
Damjan Marion [Fri, 3 Jun 2016 08:15:23 +0000 (10:15 +0200)]
eal/x86: fix clang build with -O0

Clang seems to have a bug with asm inside inline function rte_xabort():

rte_rtm.h:56:15: error: invalid operand for inline asm constraint 'i'
        asm volatile(".byte 0xc6,0xf8,%P0" :: "i" (status) : "memory");
                     ^

It is seen only when building with EXTRA_CFLAGS=-O0.

The workaround is to replace the inline function by a macro.

Fixes: ba7468997ea6 ("spinlock: add HTM lock elision for x86")

Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoapp/test: fix buffer overflow
Jan Viktorin [Tue, 3 May 2016 19:15:27 +0000 (21:15 +0200)]
app/test: fix buffer overflow

A bug has been detected by valgrind:

Invalid write of size 1
   by 0x86ECC76: sprintf (in /usr/lib/libc-2.23.so)
   by 0x430B0A: commands_init (in build/app/test)
   by 0x42F215: main (in build/app/test)
 Address 0x9d72ff2 is 0 bytes after a block of size 1,346 alloc'd
   at 0x78C1BD0: malloc (in vgpreload_memcheck-amd64-linux.so)
   by 0x430AE4: commands_init (in build/app/test)
   by 0x42F215: main (in build/app/test)

The commands buffer is exactly 1346 B long so there is an access just
after the buffer. The sprintf always writes '\0' at the end of the string.
The '#' separator adds 1 B more to each string. This is correct until the
last string is sprinted there. The last one is 1 B longer then expected,
i.e.:
      strlen(t->command) + strlen("#") + ONE_FOR_ZERO

Fixes: 727909c59231 ("app/test: introduce dynamic commands list")

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Acked-by: David Marchand <david.marchand@6wind.com>
8 years agoapp/test: move cycles autotest to first group
Thomas Monjalon [Wed, 11 May 2016 12:52:16 +0000 (14:52 +0200)]
app/test: move cycles autotest to first group

The cycles test was wrongly in the group of mempool perf test.
It is moved in parallel test group 1 with timer test.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoapp/test: remove unused constants
Thomas Monjalon [Wed, 11 May 2016 06:39:09 +0000 (08:39 +0200)]
app/test: remove unused constants

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoapp/test: reduce memory needs
Thomas Monjalon [Thu, 5 May 2016 06:49:49 +0000 (08:49 +0200)]
app/test: reduce memory needs

Adjust memory parameter (--socket-mem) of the autotests
to be able to make fast_test in a constrained environment (e.g. a VM).

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoapp/test: shorten execution time
Thomas Monjalon [Wed, 4 May 2016 15:15:05 +0000 (17:15 +0200)]
app/test: shorten execution time

The autotests are too long to be run often.
This patch reduces the needed time of some tests in fast_test.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoapp/test: isolate lpm performance cases
Thomas Monjalon [Thu, 5 May 2016 07:08:13 +0000 (09:08 +0200)]
app/test: isolate lpm performance cases

The LPM performance tests should not be mixed with
functional tests: they are long and show some statistics.

LPM6 functional tests are added to parallel tests.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoapp/test: fix log check when default level is high
Thomas Monjalon [Wed, 4 May 2016 13:18:29 +0000 (15:18 +0200)]
app/test: fix log check when default level is high

The log unit test was checking display of low priority messages.
It was not working if RTE_LOG_LEVEL is not RTE_LOG_DEBUG.
It is even easier to see since the default level is INFO (9b9d7ca).

Now the test use ERR and CRIT levels which should be always enabled
while not trigerring syslog output on the console.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agomk: fix autotest lists
Thomas Monjalon [Wed, 11 May 2016 09:09:15 +0000 (11:09 +0200)]
mk: fix autotest lists

The perf test lists were not consistent.
Add timer perf test to the list.
Add LPM6 test to fast tests.
And fix the phony target.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agomk: remove useless test targets
Thomas Monjalon [Wed, 11 May 2016 09:23:05 +0000 (11:23 +0200)]
mk: remove useless test targets

We can define any custom whitelist of tests to run:
make test WHITELIST=ring
The predefined lists for ring and mempool tests are not quite useful.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoscripts: highlight bad patterns in commit check
Yuanhan Liu [Wed, 11 May 2016 04:09:01 +0000 (21:09 -0700)]
scripts: highlight bad patterns in commit check

I got a report like following:

    Wrong headline lowercase:
            xxx: move vhost device ctx to cuse

It takes a bit while (by checking the code) that it's "ctx" triggers
the warning. It could be spotted very quickly if "tx" is highlighted.
This patch adds such support.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoscripts: fix false positive in commit check
Yuanhan Liu [Wed, 11 May 2016 04:09:00 +0000 (21:09 -0700)]
scripts: fix false positive in commit check

It reports an false positive warning when the commit subject includes
the word "ctx", as it matches following regexp:

     -e 'rx\|tx\|RX\|TX'

Fixes: edbeb7d962e9 ("scripts: check commit formatting")

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoscripts: ignore bit macro in checkpatch
Thomas Monjalon [Tue, 19 Apr 2016 13:13:23 +0000 (15:13 +0200)]
scripts: ignore bit macro in checkpatch

It was suggesting to use a Linux macro:
CHECK:BIT_MACRO: Prefer using the BIT macro

It is ignored because it is a false positive in DPDK case.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoscripts: remove unused map files merger
Thomas Monjalon [Thu, 19 May 2016 18:00:04 +0000 (20:00 +0200)]
scripts: remove unused map files merger

This script was forgotten when dropping the combined library.

Fixes: 948fd64befc3 ("mk: replace the combined library with a linker script")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
8 years agoqede: add missing external dependency and disable by default
Panu Matilainen [Tue, 24 May 2016 10:28:31 +0000 (13:28 +0300)]
qede: add missing external dependency and disable by default

The qede driver depends on libz but the LDLIBS entry in makefile
was missing. Also because of the external dependency, make it
disabled in default config as per common DPDK policy on external deps.

Fixes: ec94dbc57362 ("qede: add base driver")

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoqede: fix 32-bit build with debug enabled
Thomas Monjalon [Thu, 19 May 2016 17:29:56 +0000 (19:29 +0200)]
qede: fix 32-bit build with debug enabled

Some 64-bit variables are printed for debug.
%PRIx64 qualifier must be used because %lx is not long enough
on 32-bit systems

Fixes: ec94dbc57362 ("qede: add base driver")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
8 years agoethdev: use dedicated macro to check port id
Mauricio Vasquez B [Wed, 18 May 2016 19:15:11 +0000 (21:15 +0200)]
ethdev: use dedicated macro to check port id

The RTE_ETH_VALID_PORTID_OR_ERR_RET macro is used in some places
to check if a port id is valid or not. This commit makes use of it in
some new parts of the code.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agombuf: add prefetch helpers
Olivier Matz [Wed, 18 May 2016 16:02:08 +0000 (18:02 +0200)]
mbuf: add prefetch helpers

Some architectures (ex: Power8) have a cache line size of 128 bytes,
so the drivers should not expect that prefetching the second part of
the mbuf with rte_prefetch0(&m->cacheline1) is valid.

This commit add helpers that can be used by drivers to prefetch the
rx or tx part of the mbuf, whatever the cache line size.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agomempool: avoid division by zero
Slawomir Mrozowicz [Thu, 19 May 2016 12:36:35 +0000 (14:36 +0200)]
mempool: avoid division by zero

In function call rte_mempool_xmem_size, division by expression total_size
which may be zero has undefined behavior.

Coverity issue: 13243
Fixes: 148f963fb532 ("xen: core library changes")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agodoc: update release notes about mempool allocation
Olivier Matz [Wed, 18 May 2016 11:04:56 +0000 (13:04 +0200)]
doc: update release notes about mempool allocation

Remove the deprecation notice and add an entry in the release note
for the changes in mempool allocation.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoapp/test: rework mempool test
Olivier Matz [Wed, 18 May 2016 11:04:55 +0000 (13:04 +0200)]
app/test: rework mempool test

Rework the mempool test to better indicate where it failed,
and, now that this feature is available, add the freeing of the
mempool after the test is done.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: add flag for removing phys contiguous constraint
Olivier Matz [Wed, 18 May 2016 11:04:54 +0000 (13:04 +0200)]
mempool: add flag for removing phys contiguous constraint

Add a new flag to remove the constraint of having physically contiguous
objects inside a mempool.

Add this flag to the log history mempool to start, but we could add
it in most cases where objects are not mbufs.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomem: avoid memzone/mempool/ring name truncation
Olivier Matz [Wed, 18 May 2016 11:04:53 +0000 (13:04 +0200)]
mem: avoid memzone/mempool/ring name truncation

Check the return value of snprintf to ensure that the name of
the object is not truncated.

By the way, update the test to avoid to trigger an error in
that case.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoapp/testpmd: remove anonymous mempool code
Olivier Matz [Wed, 18 May 2016 11:04:52 +0000 (13:04 +0200)]
app/testpmd: remove anonymous mempool code

Now that mempool library provide functions to populate with anonymous
mmap'd memory, we can remove this specific code from test-pmd.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: make mempool populate and free api public
Olivier Matz [Wed, 18 May 2016 11:04:51 +0000 (13:04 +0200)]
mempool: make mempool populate and free api public

Add the following functions to the public mempool API:

- rte_mempool_create_empty()
- rte_mempool_populate_phys()
- rte_mempool_populate_phys_tab()
- rte_mempool_populate_virt()
- rte_mempool_populate_default()
- rte_mempool_populate_anon()
- rte_mempool_free()

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: populate with anonymous memory
Olivier Matz [Wed, 18 May 2016 11:04:50 +0000 (13:04 +0200)]
mempool: populate with anonymous memory

Now that we can populate a mempool with any virtual memory,
it is easier to introduce a function to populate a mempool
with memory coming from an anonymous mapping, as it's done
in test-pmd.

The next commit will replace test-pmd anonymous mapping by
this function.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: create the internal ring when populating
Olivier Matz [Wed, 18 May 2016 11:04:49 +0000 (13:04 +0200)]
mempool: create the internal ring when populating

Instead of creating the internal ring at mempool creation, do
it when populating the mempool with the first memory chunk. The
objective here is to simplify the change of external handler
when it will be introduced.

For instance, this will be possible:

  mp = rte_mempool_create_empty(...)
  rte_mempool_set_ext_handler(mp, my_handler)
  rte_mempool_populate_default()

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: rework support of Xen dom0
Olivier Matz [Wed, 18 May 2016 11:04:48 +0000 (13:04 +0200)]
mempool: rework support of Xen dom0

Avoid to have a specific file for that, and remove #ifdefs.
Now that we have introduced a function to populate a mempool
with a virtual area, the support of xen dom0 is much easier.

The only thing we need to do is to convert the guest physical
address into the machine physical address using rte_mem_phy2mch().
This function does nothing when not running xen.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoxen: return machine address without knowing memseg id
Olivier Matz [Wed, 18 May 2016 11:04:47 +0000 (13:04 +0200)]
xen: return machine address without knowing memseg id

The conversion from guest physical address to machine physical address
is fast when the caller knows the memseg corresponding to the gpa.

But in case the user does not know this information, just find it
by browsing the segments. This feature will be used by next commit.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: introduce a function to create an empty pool
Olivier Matz [Wed, 18 May 2016 11:04:46 +0000 (13:04 +0200)]
mempool: introduce a function to create an empty pool

Introduce a new function rte_mempool_create_empty()
that allocates a mempool that is not populated.

The functions rte_mempool_create() and rte_mempool_xmem_create()
now make use of it, making their code much easier to read.
Currently, they are the only users of rte_mempool_create_empty()
but the function will be made public in next commits.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: introduce a function to free a pool
Olivier Matz [Wed, 18 May 2016 11:04:45 +0000 (13:04 +0200)]
mempool: introduce a function to free a pool

Introduce rte_mempool_free() that:

- unlink the mempool from the global list if it is found
- free all the memory chunks using their free callbacks
- free the internal ring
- free the memzone containing the mempool

Currently this function is only used in error cases when
creating a new mempool, but it will be made public later
in the patch series.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: replace physical address by a memzone pointer
Olivier Matz [Wed, 18 May 2016 11:04:44 +0000 (13:04 +0200)]
mempool: replace physical address by a memzone pointer

Storing the pointer to the memzone instead of the physical address
provides more information than just the physical address: for instance,
the memzone flags.

Moreover, keeping the memzone pointer will allow us to free the mempool
(this is done later in the series).

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: support no hugepage mode
Olivier Matz [Wed, 18 May 2016 11:04:43 +0000 (13:04 +0200)]
mempool: support no hugepage mode

Introduce a new function rte_mempool_populate_virt() that is now called
by default when hugepages are not supported. This function populate the
mempool with several physically contiguous chunks whose minimum size is
the page size of the system.

Thanks to this, rte_mempool_create() will work properly in without
hugepages (if the object size is smaller than a page size), and 2
specific workarouds can be removed:

- trailer_size was artificially extended to a page size
- rte_mempool_virt2phy() did not rely on object physical address

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomem: lock pages when not using hugepages
Olivier Matz [Wed, 18 May 2016 11:04:42 +0000 (13:04 +0200)]
mem: lock pages when not using hugepages

Although the physical address won't be correct in memory segment,
this allows at least to retrieve the physical address using
rte_mem_virt2phy(). Indeed, if the page is not locked, the page
may not be present in physical memory.

With next commit, it allows a mempool to have properly filled physical
addresses when using --no-huge option.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: allocate in several memory chunks by default
Olivier Matz [Wed, 18 May 2016 11:04:41 +0000 (13:04 +0200)]
mempool: allocate in several memory chunks by default

Introduce rte_mempool_populate_default() which allocates
mempool objects in several memzones.

The mempool header is now always allocated in a specific memzone
(not with its objects). Thanks to this modification, we can remove
many specific behavior that was required when hugepages are not
enabled in case we are using rte_mempool_xmem_create().

This change requires to update how kni and mellanox drivers lookup for
mbuf memory. For now, this will only work if there is only one memory
chunk (like today), but we could make use of rte_mempool_mem_iter() to
support more memory chunks.

We can also remove RTE_MEMPOOL_OBJ_NAME that is not required anymore for
the lookup, as memory chunks are referenced by the mempool.

Note that rte_mempool_create() is still broken (it was the case before)
when there is no hugepages support (rte_mempool_create_xmem() has to be
used). This is fixed in next commit.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: get memory size with unspecified page size
Olivier Matz [Wed, 18 May 2016 11:04:40 +0000 (13:04 +0200)]
mempool: get memory size with unspecified page size

Update rte_mempool_xmem_size() so that when the page_shift argument is
set to 0, assume that memory is physically contiguous, allowing to
ignore page boundaries. This will be used in the next commits.

By the way, rename the variable 'n' as 'obj_per_page' and avoid the
affectation inside the if().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: introduce a free callback for memory chunks
Olivier Matz [Wed, 18 May 2016 11:04:39 +0000 (13:04 +0200)]
mempool: introduce a free callback for memory chunks

Introduce a free callback that is passed to the populate* functions,
which is used when freeing a mempool. This is unused now, but as next
commits will populate the mempool with several chunks of memory, we
need a way to free them properly on error.

Later in the series, we will also introduce a public rte_mempool_free()
and the ability for the user to populate a mempool with its own memory.
For that, we also need a free callback.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: simplify memory usage calculation
Olivier Matz [Wed, 18 May 2016 11:04:38 +0000 (13:04 +0200)]
mempool: simplify memory usage calculation

This commit simplifies rte_mempool_xmem_usage().

Since previous commit, the function rte_mempool_xmem_usage() is
now the last user of rte_mempool_obj_mem_iter(). This complex
code can now be moved inside the function. We can get rid of the
callback and do some simplification to make the code more readable.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: add function to iterate the memory chunks
Olivier Matz [Wed, 18 May 2016 11:04:37 +0000 (13:04 +0200)]
mempool: add function to iterate the memory chunks

In the same model than rte_mempool_obj_iter(), introduce
rte_mempool_mem_iter() to iterate the memory chunks attached
to the mempool.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: store memory chunks in a list
Olivier Matz [Wed, 18 May 2016 11:04:36 +0000 (13:04 +0200)]
mempool: store memory chunks in a list

Do not use paddr table to store the mempool memory chunks.
This will allow to have several chunks with different virtual addresses.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: remove macro to check if contiguous
Olivier Matz [Wed, 18 May 2016 11:04:35 +0000 (13:04 +0200)]
mempool: remove macro to check if contiguous

This commit removes MEMPOOL_IS_CONTIG().

The next commits will change the behavior of the mempool library so that
the objects will never be allocated in the same memzone than the mempool
header. Therefore, there is no reason to keep this macro that would
always return 0.

This macro was only used in app/test.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: store physical address in objects
Olivier Matz [Wed, 18 May 2016 11:04:34 +0000 (13:04 +0200)]
mempool: store physical address in objects

Store the physical address of the object in its header. It simplifies
rte_mempool_virt2phy() and prepares the removing of the paddr[] table
in the mempool header.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: create internal ring in a specific function
Olivier Matz [Wed, 18 May 2016 11:04:33 +0000 (13:04 +0200)]
mempool: create internal ring in a specific function

This makes the code of rte_mempool_create() clearer, and it will make
the introduction of external mempool handler easier (in another patch
series). Indeed, this function contains the specific part when a ring is
used, but it could be replaced by something else in the future.

This commit also adds a socket_id field in the mempool structure that
is used by this new function.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: use the list to initialize objects
Olivier Matz [Wed, 18 May 2016 11:04:32 +0000 (13:04 +0200)]
mempool: use the list to initialize objects

Before this patch, the mempool elements were initialized at the time
they were added to the mempool. This patch changes this to do the
initialization of all objects once the mempool is populated, using
rte_mempool_obj_iter() introduced in previous commits.

Thanks to this modification, we are getting closer to a new API
that would allow us to do:
  mempool_init()
  mempool_populate(mem1)
  mempool_populate(mem2)
  mempool_populate(mem3)
  mempool_init_obj()

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: use the list to audit all elements
Olivier Matz [Wed, 18 May 2016 11:04:31 +0000 (13:04 +0200)]
mempool: use the list to audit all elements

Use the new rte_mempool_obj_iter() instead the old rte_mempool_obj_iter()
to iterate among objects to audit them (check for cookies).

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: use the list to iterate the elements
Olivier Matz [Wed, 18 May 2016 11:04:30 +0000 (13:04 +0200)]
mempool: use the list to iterate the elements

Now that the mempool objects are chained into a list, we can use it to
browse them. This implies a rework of rte_mempool_obj_iter() API, that
does not need to take as many arguments as before. The previous function
is kept as a private function, and renamed in this commit. It will be
removed in a next commit of the patch series.

The only internal users of this function are the mellanox drivers. The
code is updated accordingly.

Introducing an API compatibility for this function has been considered,
but it is not easy to do without keeping the old code, as the previous
function could also be used to browse elements that were not added in a
mempool. Moreover, the API is already be broken by other patches in this
version.

The library version was already updated in
commit 213af31e0960 ("mempool: reduce structure size if no cache needed")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: remove const qualifier in dump and audit
Olivier Matz [Wed, 18 May 2016 11:04:29 +0000 (13:04 +0200)]
mempool: remove const qualifier in dump and audit

In next commits, we will use an iterator to walk through the objects in
mempool in rte_mempool_audit(). This iterator takes a "struct
rte_mempool *" as a parameter because it is assumed that the callback
function can modify the mempool.

The previous approach was to introduce a RTE_DECONST() macro, but
after discussion it seems that removing the const qualifier is better
to avoid fooling the compiler, and also because these functions are
not used in datapath (possible compiler optimizations due to const
are not critical).

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: remove const qualifier when browsing pools
Olivier Matz [Wed, 18 May 2016 11:04:28 +0000 (13:04 +0200)]
mempool: remove const qualifier when browsing pools

This commit removes the const qualifier for the mempool in
rte_mempool_walk() callback prototype.

Indeed, most functions that can be done on a mempool require a non-const
mempool pointer, except the dump and the audit. Therefore, the
mempool_walk() is more useful if the mempool pointer is not const.

This is required by next commit where the mellanox drivers use
rte_mempool_walk() to iterate the mempools, then rte_mempool_obj_iter()
to iterate the objects in each mempool.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: list objects when added
Olivier Matz [Wed, 18 May 2016 11:04:27 +0000 (13:04 +0200)]
mempool: list objects when added

Introduce a list entry in object header so they can be listed and
browsed. The objective is to introduce a more simple way to browse the
elements of a mempool.

The next commits will update rte_mempool_obj_iter() to use this list,
and remove the previous complex implementation.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: rename object constructor typedef
Olivier Matz [Wed, 18 May 2016 11:04:26 +0000 (13:04 +0200)]
mempool: rename object constructor typedef

This commit renames mempool_obj_ctor_t as mempool_obj_cb_t.

In next commits, we will add the ability to populate the
mempool and iterate through objects using the same function.
We will use the same callback type for that. As the callback is
not a constructor anymore, rename it into rte_mempool_obj_cb_t.

The rte_mempool_obj_iter_t that was used to iterate over objects
will be removed in next commits.

No functional change.
In this commit, the API is preserved through a compat typedef.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: use sizeof to get size of header and trailer
Olivier Matz [Wed, 18 May 2016 11:04:25 +0000 (13:04 +0200)]
mempool: use sizeof to get size of header and trailer

Since commits d2e0ca22f and 97e7e685b the headers and trailers
of the mempool are defined as a structure. We can get their
size using a sizeof instead of doing a calculation that will
become wrong at the first structure update.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: uninline function to check cookies
Olivier Matz [Wed, 18 May 2016 11:04:24 +0000 (13:04 +0200)]
mempool: uninline function to check cookies

There's no reason to keep this function inlined. Move it to
rte_mempool.c. We need to export the function for when compiling
with shared libraries + debug. We also need to keep the macro,
because we don't want to call an empty function when debug is
disabled.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomempool: rename element size variables
Olivier Matz [Wed, 18 May 2016 11:04:23 +0000 (13:04 +0200)]
mempool: rename element size variables

This commit replaces elt_size by total_elt_size when appropriate.

In some mempool functions, we use the size of the elements as arguments
or variables. There is a confusion between the size including or not
including the header and trailer.

To avoid this confusion:
- update the API documentation
- rename the variables and argument names as "elt_size" when the size
  does not include the header and trailer, or else as "total_elt_size".

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked by: Keith Wiles <keith.wiles@intel.com>

8 years agomempool: rework comments and style
Olivier Matz [Wed, 18 May 2016 11:04:22 +0000 (13:04 +0200)]
mempool: rework comments and style

No functional change, just fix some comments and styling issues.
Also avoid to duplicate comments between rte_mempool_create()
and rte_mempool_xmem_create().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked by: Keith Wiles <keith.wiles@intel.com>

8 years agombuf: decrease reference counter when detaching
Hiroyuki Mikita [Wed, 18 May 2016 14:41:03 +0000 (23:41 +0900)]
mbuf: decrease reference counter when detaching

The rte_pktmbuf_detach() function should decrease refcnt on a direct
buffer as stated in doc/guides/prog_guide/mbuf_lib.rst:
"whenever the indirect buffer is detached, the reference counter on the
direct buffer is decremented."

Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agocmdline: check initialization error
Marcin Kerlin [Tue, 17 May 2016 08:36:57 +0000 (10:36 +0200)]
cmdline: check initialization error

The value returned by rdline_init() was not checked in cmdline_new().
On error, free the allocated memory and return NULL.

This condition should not happen today, but it's safer to do the check
in case rdline_init() is updated.

Coverity issue: 13204
Fixes: af75078fece3 ("first public release")

Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agotools: allow binding to other network class devices
Thadeu Lima de Souza Cascardo [Fri, 6 May 2016 18:27:01 +0000 (15:27 -0300)]
tools: allow binding to other network class devices

dpdk_nic_bind will only handle Ethernet devices, but Mellanox ConnectX-3 Pro,
for example, is a Network class device, but not an Ethernet one. Even though
this allows other devices in the list, like Wireless devices, this should not be
a problem.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
8 years agolog: fix level/type retrieving from a standard thread
Maxime Leroy [Mon, 9 May 2016 16:13:36 +0000 (18:13 +0200)]
log: fix level/type retrieving from a standard thread

The functions rte_log_cur_msg_loglevel() and rte_log_cur_msg_logtype()
return the current log level/type for the message being processed. They
are used when implementing a user-defined logging stream.

The current log levels and types were stored in a table indexed by the
lcore_id, only returning a valid value for dataplane threads. Setting
and getting these values in a non dataplane thread was ignored, using
the global value instead.

To fix this issue, a per-thread variable could be used (with
RTE_DEFINE_PER_LCORE), allowing any pthread to set and retrieve its
current log level or type.

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
8 years agomk: add build directory to library search path
Ferruh Yigit [Tue, 3 May 2016 15:03:39 +0000 (16:03 +0100)]
mk: add build directory to library search path

Add default library output folder to the library search folder.

This is useful for development environment, in production environment
DPDK libraries already should be in know locations.

Patch removes requirement to set LD_LIBRARY_PATH variable when DPDK
compiled as shared library.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agomk: introduce NXP dpaa2 architecture based on armv8-a
Hemant Agrawal [Wed, 11 May 2016 13:47:59 +0000 (19:17 +0530)]
mk: introduce NXP dpaa2 architecture based on armv8-a

This patch introduces dpaa2 machine target to address difference
in cpu parameter, number of core to 8 and no numa support
w.r.t default armv8-a machine

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
8 years agoconfig: disable igb_uio for ARMv8
Hemant Agrawal [Wed, 11 May 2016 13:47:58 +0000 (19:17 +0530)]
config: disable igb_uio for ARMv8

IGB_UIO not supported for arm64 arch in kernel so disable.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
8 years agomempool: reduce structure size if no cache needed
Keith Wiles [Thu, 14 Apr 2016 09:42:36 +0000 (11:42 +0200)]
mempool: reduce structure size if no cache needed

The rte_mempool structure is changed, which will cause an ABI change
for this structure. Providing backward compat is not reasonable
here as this structure is used in multiple defines/inlines.

Allow mempool cache support to be dynamic depending on if the
mempool being created needs cache support. Saves about 1.5M of
memory used by the rte_mempool structure.

Allocating small mempools which do not require cache can consume
larges amounts of memory if you have a number of these mempools.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agombuf: add raw allocation function
Olivier Matz [Wed, 11 May 2016 14:43:46 +0000 (16:43 +0200)]
mbuf: add raw allocation function

Many drivers provide their own implementation of rte_mbuf_raw_alloc(),
duplicating the code. Introduce a new public function in rte_mbuf to
allocate a raw mbuf (uninitialized).

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agodoc: move release notes instructions as comments
Olivier Matz [Fri, 13 May 2016 13:27:59 +0000 (15:27 +0200)]
doc: move release notes instructions as comments

We don't want to have this instructions in the generated docs, so use
comments. It's also less confusing for people adding entries in the
documentation.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoexamples: remove useless check of port count
Mauricio Vasquez B [Tue, 3 May 2016 21:16:57 +0000 (23:16 +0200)]
examples: remove useless check of port count

The rte_eth_dev_count() function will never return a value greater
than RTE_MAX_ETHPORTS, so that checking is useless.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agoexamples/ip_pipeline: fix initialization of firewall bulk handler
Daniel Mrzyglod [Fri, 6 May 2016 17:54:44 +0000 (19:54 +0200)]
examples/ip_pipeline: fix initialization of firewall bulk handler

bulk functions expect that all memory is set with zeros

Fixes: 67ebdbef0c31 ("examples/ip_pipeline: add bulk update of firewall rules")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/ip_pipeline: fix options array overflow
Marcin Kerlin [Thu, 14 Apr 2016 09:53:47 +0000 (11:53 +0200)]
examples/ip_pipeline: fix options array overflow

In the function app_init_eal(struct app params * app) number of
entries into array exceeds the size of the array if the conditions
are fulfilled.

Coverity issue: 124567
Fixes: 7f64b9c004aa ("examples/ip_pipeline: rework config file syntax")

Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/distributor: check mempool error
Marcin Kerlin [Tue, 19 Apr 2016 12:31:48 +0000 (14:31 +0200)]
examples/distributor: check mempool error

Value returned from a function is not checked for errors before being used.

Coverity issue: 13207
Fixes: 07db4a975094 ("examples/distributor: new sample app")

Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
8 years agoexamples/netmap_compat: fix infinite loop
Michal Kobylinski [Wed, 27 Apr 2016 13:22:41 +0000 (15:22 +0200)]
examples/netmap_compat: fix infinite loop

Infinite loop: The loop does not have a normal termination condition,
so will continue until an abnormal condition arises.
In rte_netmap_poll: Infinite loop with unsatisfiable exit condition.

Coverity issue: 30701
Fixes: 06371afe ("examples/netmap_compat: import netmap compatibility example")

Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
8 years agoexamples/qos_meter: check flow configuration error
Slawomir Mrozowicz [Fri, 13 May 2016 08:35:07 +0000 (10:35 +0200)]
examples/qos_meter: check flow configuration error

Calling rte_meter_srtcm_config without checking return value.

Coverity issue: 30693
Fixes: e6541fdec8b2 ("meter: initial import")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/qos_sched: fix lcore limit
Slawomir Mrozowicz [Wed, 11 May 2016 08:48:05 +0000 (10:48 +0200)]
examples/qos_sched: fix lcore limit

In expression 1ULL << i, left shifting by more than 63 bits
has undefined behavior. The shift amount, i, is as much as 127.

Coverity issue: 30690
Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/qos_sched: fix error message
Slawomir Mrozowicz [Thu, 21 Apr 2016 13:08:12 +0000 (15:08 +0200)]
examples/qos_sched: fix error message

rx_port in pconf->rx_port looks like a copy-paste error.

Coverity issue: 30699
Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/qos_sched: fix negative loop bound in option parsing
Slawomir Mrozowicz [Thu, 21 Apr 2016 13:08:11 +0000 (15:08 +0200)]
examples/qos_sched: fix negative loop bound in option parsing

negative_returns: Using unsigned variable n_tokens in a loop exit condition.

Coverity issue: 30704
Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/qos_sched: fix out-of-bounds option parsing
Slawomir Mrozowicz [Thu, 21 Apr 2016 11:47:36 +0000 (13:47 +0200)]
examples/qos_sched: fix out-of-bounds option parsing

overrun-local: Overrunning array tokens of 8 8-byte elements
at element index 4294967294 (byte offset 34359738352)
using index i (which evaluates to 4294967294).

Coverity issue: 30708
Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>