Commit Graph

7706 Commits

Author SHA1 Message Date
Pablo de Lara
c1296f67b0 crypto/aesni_mb: support AES DOCSIS BPI
Underlying IPSec Multi buffer library implements
DOCSIS specification, so this commit adds support
for this new feature, which combines AES-CBC for full
AES blocks (16 bytes) and AES-CFB for last runt block
(less than 16 bytes).

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
1cdeb1c512 crypto/aesni_mb: support IPSec Multi-buffer lib v0.45
IPSec Multi-buffer library v0.45 has been released,
which includes, among other features, support for DOCSIS BPI
specification and include AVX512 optimizations.

This new version added const qualifiers to some of the function
prototypes, so the PMD has been updated to include these changes.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-06 00:17:44 +02:00
Declan Doherty
0f548b50a1 crypto/aesni_mb: process crypto op on dequeue
Moving the crypto processing from the enqueue burst to the dequeue burst,
to remove the requirement to continually call the
rte_cryptodev_burst_enqueue function to guarantee that all operations get
flushed from the multi-buffer managers buffers.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-06 00:17:44 +02:00
Sergio Gonzalez Monroy
ee7b601f1b crypto/aesni_gcm: do crypto op in dequeue function
There is bug when more crypto ops are enqueued than dequeued.
The return value is not checked when trying to enqueue the
processed crypto op into the internal ring, which in the case of being
full will results in crypto ops and mbufs being leaked.
The issue is more obvious with different cores doing enqueue/dequeue.

This patch moves the crypto operation to the dequeue function which
fixes the above issue without having to check for the number of free
entries in the ring.

Fixes: eec136f3c5 ("aesni_gcm: add driver for AES-GCM crypto operations")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-06 00:17:44 +02:00
Fan Zhang
37f075dad1 crypto/scheduler: add fail-over scheduling mode
Fail-over mode works with 2 slaves, primary slave and secondary slave.
In this mode, the scheduler will enqueue the incoming crypto op burst
to the primary slave. When one or more crypto ops are failed to be
enqueued, they then will be enqueued to the secondary slave.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-06 00:17:44 +02:00
Fan Zhang
a783aa6344 crypto/scheduler: add packet size based mode
Packet-size based distribution mode is a scheduling mode works with 2
slaves, primary slave and secondary slave, and distribute the enqueued
crypto ops to them based on their data lengths. A crypto op will be
distributed to the primary slave if its data length equals or bigger
than the designated threshold, otherwise it will be handled by the
secondary slave.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
a8eb964020 app/crypto-perf: reorg options structure
Reorganize options structure, to have all the parameters
used in a single run in the first bytes of the structure,
so all fit in a single cache line.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
fc4600fb25 app/crypto-perf: add extra option checks
When using the verify test, test name is necessary
to be passed when digest is needed.

Also, when using an block cipher algorithm (CBC, ECB),
the buffer size has to be aligned to the block size.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
f6cefe253c app/crypto-perf: add range/list of sizes
So far, the crypto performance application was only able to
test one buffer size and one burst size.

With this commit, multiple sizes can be passed, either as a range
of values or as a list of values.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
da40ebd6d3 app/crypto-perf: display results in test runner
Instead of printing the test results in the destructor
function, print them just after each run.
This will be useful for after the commit that allows
a range of buffer and burst sizes.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
b2085cce60 app/crypto-perf: do not append digest if not used
When testing cipher only operations, there is no need to append digest
at the end of the buffer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-04-06 00:17:44 +02:00
Sergio Gonzalez Monroy
df52cb3b6e app/crypto-perf: move verify as single test type
In order to simplify throughput and latency tests,
verify option has been removed from these and moved
as a separate test.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
8612836d6f app/crypto-perf: fix AES CBC 128 test vectors
Ciphertext and digests for different buffer sizes
were incorrect.

Fixes: 5f1d85c5a8 ("app/crypto-perf: add test vectors files")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
e40de34d6f app/crypto-perf: remove unused file
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
9f3ea3e4b9 app/crypto-perf: remove cyclecount test type
Cyclecount test was not implemented, so it is removed.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-04-06 00:17:44 +02:00
Akhil Goyal
c5aa9617c0 examples/ipsec-secgw: attach session-qp
adding support for attaching session to queue pairs.
This is required as underlying crypto driver may only
support limited number of sessions per queue pair
if max_nb_sessions_per_qp > 0, session should be
attached to a particular qp.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-04-06 00:17:44 +02:00
Akhil Goyal
d816fdea55 cryptodev: add API to associate session with queue pair
HW based crypto drivers may only support limited number of
sessions per queue pair. This requires support for attaching
sessions to specific queue pair.  New APIs  are introduced to
attach/detach a session with/from a particular queue pair.
These are optional APIs.

Application can call attach API after creating a session
and can call detach API before deleting a session.

Application needs to check if max_nb_sessions_per_qp > 0,
then it should call the attach API.

max_nb_sessions_per_qp = 0 means infinite sessions per qp

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
59c51be41c examples/dpdk-qat: remove app
Remove DPDK QAT sample app, in favour of the newer applications
that use the cryptodev library: ipsec-gw and l2fwd-crypto,
which has support for Intel QuickAssist devices.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-04-06 00:17:44 +02:00
Fan Zhang
c281019bfb crypto/scheduler: improve slave configuration
Since the new device configuration API is updated, we can make use of
this feature to the crypto scheduler PMD to configure its slaves
automatically with the same configurations it got. As originally the
slaves have to be manually configured one by one, this patch should
help reducing the coding complexity.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-06 00:17:44 +02:00
Fan Zhang
60e686c223 cryptodev: change device configuration API
This patch changes the device configuration API for rte_cryptodev_ops
function prototype, and update all cryptodev PMDs for this change.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
807418f263 doc: reformat crypto drivers overview
Follow the approach in the network devices overview,
for the feature matrix, so it improves readibility
and maintainability.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
5d0bd2b31b doc: add missing supported crypto algos
AESNI MB supports MD5 and AES XCBC, but it wasn't reflected
in the driver documentation.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-06 00:17:44 +02:00
Fan Zhang
8a48e03943 crypto/scheduler: optimize crypto op ordering
This patch optimizes the crypto op ordering by replacing the
ordering method from using rte_reorder library to using rte_ring
to avoid unnecessary crypto op storing and recovering cost.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-06 00:17:44 +02:00
Fan Zhang
211e27a9c2 crypto/scheduler: change enqueue and dequeue functions
This patch changes the enqueue and dequeue methods to cryptodev
scheduler PMD. Originally a 2-layer function call is carried out
upon enqueuing or dequeuing a burst of crypto ops. This patch
removes one layer to improve the performance.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2017-04-06 00:17:44 +02:00
Tomasz Kulasek
884ed3ff8e app/crypto-perf: fix uninitialized values for null ops
Some values are uninitialized for "cipher null" and "auth null"
operations. It may cause unpredictable results for some crypto pmd
drivers, or even segmentation fault.

This patch sets values for null operations to zero.

Fixes: f8be1786b1 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-06 00:17:44 +02:00
Daniel Mrzyglod
5e66937631 app/crypto-perf: avoid wrong operation type for AEAD algos
When somebody use bad --optype with aead algorithms
segmentation fault could happen.

Fixes: f8be1786b1 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-06 00:17:44 +02:00
Slawomir Mrozowicz
5d75fb09d3 app/crypto-perf: fix invalid latency for QAT
Fixes invalid latency result when using the performance application and
hardware QAT PMD. It occurred when the number of processed packets was
higher then the size of the internal QAT PMD ring buffer and the buffer
was overflowed.
Fixed by correcting the registration of the enqueued packets and freeing
memory space for not enqueued packets.

Fixes: f8be1786b1 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
7c085e85c2 cryptodev: enable BPI for Cablelabs DOCSIS security spec
Extend the DPDK cryptodev API to enable processing of packets according
to the Baseline Privacy Interface Plus (BPI+) Specification described in
the security specification of the Cablelabs Data-over-Cable Service
Interface Specification (DOCSIS).

Brief summary of BPI+ symmetric cryptography requirements:
BPI+ cryptography uses a block cipher (AES-CBC/DES-CBC) to encrypt/decrypt
all the whole blocks in the packet. However the data length is not always
a block-multiple, so where there is a final block less than the full block
size this residual block requires special handling using AES-CFB/DES-CFB
mode. Similar special handling is specified where there is only one block,
smaller than the block size for the cipher. See spec for further details.
https://apps.cablelabs.com/specification/docsis-3-1-security-specification/

Two new elements are added to the enum rte_crypto_cipher_algorithm.
Note elements of this enum are actually a combination of an algorithm (AES,
3DES, etc) and mode (CBC, CTR, etc). The new DOCSISBPI mode is used to
convey to the PMD that the mode applied should be the specific combination
of CBC and CFB required by the DOCSIS Baseline Privacy Plus Spec.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
4790f99d2d examples/l2fwd-crypto: use cryptodev algorithm parser
L2fwd-crypto app was creating an array of strings for the
supported algorithms, which was different from the strings
that are now in cryptodev.

Use the new API in cryptodev to parse the string from the user,
to get the algorithm enum, instead, so it is not necessary to add
a new supported algorithm in the cryptodev library and this app.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
66be27121c app/crypto-perf: use cryptodev algorithm parser
Instead of going through the array of supported algorithms
in the app, to get the algorithm enum, use the new API in
cryptodev to parse this string, so it is not necessary to add
a new supported algorithm in the cryptodev library and this app.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
afe6050060 cryptodev: add algorithm string parsers
Adds functions to get the cipher/authentication
algorithm enums, given a string. This is useful for applications
which gets the algorithm required from the user, to have a common
string-enum mapping.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-06 00:17:44 +02:00
Pablo de Lara
e26690f4fc cryptodev: add missing algorithm strings
DES-CBC and AUTH NULL algorithms were missing in
the array of algorithm strings.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-04-06 00:17:44 +02:00
Olivier Matz
56086e9729 test/eventdev: fix build with crypto disabled
There is a compilation error in the following case:

  make config T=x86_64-native-linuxapp-gcc
  sed -i 's,CONFIG_RTE_LIBRTE_CRYPTODEV=y,CONFIG_RTE_LIBRTE_CRYPTODEV=n,' \
    build/.config
  sed -i 's,CONFIG_RTE_APP_CRYPTO_PERF=y,CONFIG_RTE_APP_CRYPTO_PERF=n,' \
    build/.config
  make -j4
  make -j4 test-build

  test_eventdev.c:39:27: fatal error:
  rte_cryptodev.h: No such file or directory
  #include <rte_cryptodev.h>
                           ^

Removing the include induces a new error, (missing declaration of
rte_eal_vdev_init()), which is fixed by including rte_dev.h.

Fixes: f8f9d233ea ("test/eventdev: add unit tests")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-06 17:55:54 +02:00
Ed Czeck
65d9e621fa ring: fix C++ cast error
build error:
include/rte_ring.h:459:22: error: invalid conversion from ‘void*’
to ‘void**’ [-fpermissive]
  ENQUEUE_PTRS(r, &r[1], prod_head, obj_table, n, void *);

Implicit casts of void* to void** are considered warnings in some
compilers.  E.g. g++ version 5.8.  Cast directly to object types

Fixes: a6619414 ("ring: make struct and macros type agnostic")

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-06 17:55:54 +02:00
Olivier Matz
ab338eb44e mk: fix lib filtering when linking app
I get the following error when linking the test application:
  build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o):
  In function `nicvf_qsize_regbit':
  drivers/net/thunderx/base/nicvf_hw.c:451: undefined reference to `log2'
  build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o):
  In function `nicvf_rss_reta_update':
  drivers/net/thunderx/base/nicvf_hw.c:804: undefined reference to `log2'
  build/lib/librte_pmd_thunderx_nicvf.a(nicvf_hw.o):
  In function `nicvf_rss_reta_query':
  drivers/net/thunderx/base/nicvf_hw.c:825: undefined reference to `log2'

While I don't know why it does not happen for a default build, the error
can be explained. The link command line is:

   gcc -o test ... *.o ... -Wl,-lm ... -Wl,-lrte_pmd_thunderx_nicvf ...

rte_pmd_thunderx_nicvf needs the math library, and it should be
added after. This is not the case because the test application also
adds the math library.

The makefile already filters the libraries, but it keeps the first
occurrence of the lib. Instead, the last one should be kept.

Fixes: edf4d331dc ("mk: eliminate duplicates from libraries list")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2017-04-06 16:50:17 +02:00
Olivier Matz
e629b8dbd9 mk: fix shell errors when building with clang
On my system, the version of the compiler is not properly retrieved,
resulting in strange logs when building the dpdk:
  /bin/sh: line 0: test: too many arguments

This happens when mk/toolchain/clang/rte.toolchain-compat.mk is included
from a directory that use gcc to build (ex: kernel modules). In that
case, the CLANG_VERSION variable contains spaces that breaks some shell
calls to the test program.

The error is because the output of "gcc -v" on my system contains 2 lines
that matches the "version" string:

  Configured with: ../src/configure -v \
    --with-pkgversion='Debian 6.3.0-6' [...]
  gcc version 6.3.0 20170205 (Debian 6.3.0-6)

This may be specific to Debian. Fix it by specializing the grep.

Fixes: 2ef6eea891 ("mk: add clang toolchain")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2017-04-06 16:50:17 +02:00
Thomas Monjalon
75206638ef mk: build examples list before each doxygen run
The file examples.dox was not re-generated when a file
is added or removed from examples/.
It is now removed on clean operation.
The ordering of operations (clean before generation) is also
better defined.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2017-04-06 16:29:32 +02:00
Pascal Mazon
947d949de7 net/tap: fix max queues redefinition
The macro RTE_PMD_TAP_MAX_QUEUES was defined twice.
On machines with kernel < 3.8, IFF_MULTI_QUEUE didn't exist, and thus
both definitions used different values.

Fixes: cf56436611 ("net/tap: move private elements to external header")

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-04-06 16:29:32 +02:00
Nelio Laranjeiro
4e66a6fef3 net/mlx5: fix an uninitialized variable
Since patch "mbuf: structure reorganization" the compiler complains
sometimes (in some conditions):

 .../drivers/net/mlx5/mlx5_rxtx.c: In function ‘mlx5_rx_burst’:
 .../drivers/net/mlx5/mlx5_rxtx.c:2082:17: error: ‘len’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]

len is not initialised as it will be at the first segment of a received
packet, but it remains hard for the compiler to determine it.

Fixes: 9964b965ad ("net/mlx5: re-add Rx scatter support")
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-06 13:08:24 +02:00
Bruce Richardson
8b2928c978 ethdev: fix missing function in version map file
The function rte_eth_find_next is missing in the map file, which causes
errors with shared library builds.

  .../test-pmd/testpmd.c:1693: undefined reference to `rte_eth_find_next'

Adding function to map file fixes the issue.

Fixes: 5588909af2 ("ethdev: add device iterator")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-04-06 12:52:52 +02:00
Keith Wiles
793d3320e2 maintainers: handoff ownership of Tap PMD
Pascal has added many features to the Tap PMD and the code
is now mostly his code. We talked and he suggested I send
the patch to change ownership.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Pascal Mazon <pascal.mazon@6wind.com>
2017-04-06 10:02:16 +02:00
Shrikrishna Khare
d3da3159fb maintainers: update for vmxnet3
Taking over DPDK vmxnet3 driver maintainer role.

Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2017-04-06 10:02:16 +02:00
Jasvinder Singh
9c77b848b1 test: add CRC computation
This patch provides a set of tests for verifying the functional
correctness of 16-bit and 32-bit CRC APIs.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-05 23:03:25 +02:00
Jasvinder Singh
986ff526fb net: add CRC computation API
APIs for selecting the architecure specific implementation and computing
the crc (16-bit and 32-bit CRCs) are added. For CRCs calculation, scalar
as well as x86 intrinsic(sse4.2) versions are implemented.

The scalar version is based on generic Look-Up Table(LUT) algorithm,
while x86 intrinsic version uses carry-less multiplication for
fast CRC computation.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2017-04-05 23:03:23 +02:00
Gaetan Rivet
7d89b26103 app/testpmd: use ethdev iterator to list devices
This commit replaces redundant code with public ethdev layer calls.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-04-05 22:47:57 +02:00
Gaetan Rivet
5588909af2 ethdev: add device iterator
This iterator helps applications iterate over the device list and skip
holes caused by invalid or detached devices.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-04-05 22:47:57 +02:00
Gaetan Rivet
d52268a8b2 ethdev: expose device states
The hotplug API introduced multiple states for a device with possible
values defined internally, while the related field in struct rte_eth_dev
was made public.

Exposing those states improves consistency because applications have to
deal with the device list directly.

"DEV_DETACHED" is renamed "RTE_ETH_DEV_UNUSED" to better reflect that
the emptiness of a slot is not necessarily the result of detaching a
device.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-04-05 22:47:57 +02:00
Ferruh Yigit
fa865c012b event/sw: fix build with icc
build error:
.../drivers/event/sw/sw_evdev_scheduler.c(379):
error #300: const variable "dummy_rob" requires an initializer
        static const struct reorder_buffer_entry dummy_rob;
                                                          ^

Variable "dummy_rob" defined as const but already cast to another
pointer and its content updated. Remove const qualifier from variable.

Fixes: 617995dfc5 ("event/sw: add scheduling logic")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-04-05 18:20:42 +02:00
Ferruh Yigit
a175e38f2e event/octeontx: fix build with icc
build error:
.../drivers/event/octeontx/ssovf_worker.c(212):
error #592: variable "get_work0" is used before its value is set
        RTE_SET_USED(get_work0);
        ^

.../drivers/event/octeontx/ssovf_worker.c(213):
error #592: variable "get_work1" is used before its value is set
        RTE_SET_USED(get_work1);
        ^
For x86 these variables set but not used, move macros below
where values assigned.

Fixes: f61808eaa9 ("event/octeontx: add start function")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-04-05 18:20:42 +02:00
Ferruh Yigit
3061d0d961 ring: fix build with icc
build error:
In file included from .../lib/librte_ring/rte_ring.c(90):
.../lib/librte_ring/rte_ring.h(162):
error #1366: a reduction in alignment without the "packed" attribute
is ignored
  } __rte_cache_aligned;
      ^

Alignment attribute moved to first element of the struct

Fixes: a6619414e0 ("ring: make struct and macros type agnostic")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-04-05 18:20:42 +02:00