Commit Graph

11490 Commits

Author SHA1 Message Date
Chas Williams
b61d834002 net/bonding: do not early mark device as bonded
bonding immediately marks the incoming eth device as bonded and doesn't
clear this in later error paths.  Delay marking the dev until we are
certain that we are going to add this eth device to the bond group.

Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2018-01-29 10:04:28 +01:00
Matan Azrad
745b72dab9 net/failsafe: fix Rx burst infinite loop
In case of plugged out device, the fail-safe PMD uses failsafe_rx_burst
function for packet receiving.

This function iterates over the present sub-devices until it
receives a traffic from one of them or they are all cannot receive
packets.

The corrupted code didn't advance the sub-device pointer when the
sub-device was not present and caused to infinite loop.

Advance the sub-device pointer also in plugged-out sub-device case.

Fixes: 8052bbd9d5 ("net/failsafe: improve Rx sub-devices iteration")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-01-29 10:04:28 +01:00
Hyong Youb Kim
d26ddeaf11 net/enic: set L4 checksum flags for IPv6 packets
enic_cq_rx_to_pkt_flags() currently sets checksum good/bad flags only
for IPv4.  The hardware actually validates the TCP/UDP checksum of
IPv6 packets too. Set PKT_RX_L4_CKSUM_{GOOD,BAD} accordingly.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-01-29 10:04:28 +01:00
Hyong Youb Kim
1e81dbb532 net/enic: add Tx prepare handler
Like most NICs, this hardware (Cisco VIC) also requires partial
checksum in the packet for checksum offload and TSO. So, add
the tx_pkt_prepare handler like other PMDs do.

Technically, VIC has an offload mode that does not require partial
checksum for non-TSO packets. But, it has no such mode for TSO
packets, making tx_pkt_prepare unavoidable.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-01-29 10:04:28 +01:00
Hyong Youb Kim
6c45c33058 net/enic: fix crash due to static max number of queues
ENIC_CQ_MAX, ENIC_WQ_MAX and others are arbitrary values that
prevent the app from using more queues when they are available on
hardware. Remove them and dynamically allocate vnic_cq and such
arrays to accommodate all available hardware queues.

As a side effect of removing ENIC_CQ_MAX, this commit fixes a segfault
that would happen when the app requests more than 16 CQs, because
enic_set_vnic_res() does not consider ENIC_CQ_MAX. For example, the
following command causes a crash.

testpmd -- --rxq=16 --txq=16

Fixes: ce93d3c36d ("net/enic: fix resource check failures when bonding devices")
Cc: stable@dpdk.org

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-01-29 10:04:28 +01:00
Tomasz Duszynski
7d8f6c20cc net/mrvl: switch to the new Tx offload API
Since the old Tx offload API was depracated
update the driver to use the latest one.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2018-01-29 10:04:28 +01:00
Tomasz Duszynski
82c4f93279 net/mrvl: switch to the new Rx offload API
Since the old Rx offload API is now depracated
update the driver to use the latest one.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2018-01-29 10:04:28 +01:00
David Marchand
7be5c826bd ethdev: move internal callback list definition
This structure is not exposed through public apis, we should just move it
to the core header.

Fixes: 331c447ad9 ("ethdev: separate internal structures into own header")

Signed-off-by: David Marchand <david.marchand@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-01-29 10:04:28 +01:00
Olivier Matz
d10b09db0a net/mlx5: fix allocation when no memory on device NUMA node
When no memory is available on the same numa node than the device, the
initialization of the device fails. However, the use case where the
cores and memory are on a different socket than the device is valid,
even if not optimal.

To fix this issue, this commit introduces an infrastructure to select
the socket on which to allocate the verbs objects based on the ethdev
configuration and the object type, rather than the PCI numa node.

Fixes: 1e3a39f72d ("net/mlx5: allocate verbs object into shared memory")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-29 10:04:28 +01:00
Olivier Matz
80554894c4 net/mlx5: fix return value of start operation
On error, mlx5_dev_start() does not return a negative value
as it is supposed to do. The consequence is that the application
(ex: testpmd) does not notice that the port is not started
and begins the rxtx on an uninitialized port, which crashes.

Fixes: e1016cb733 ("net/mlx5: fix Rx interrupts management")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-29 10:04:28 +01:00
Nélio Laranjeiro
da646bd938 net/mlx5: fix all multi verification code position
All multi code should not be handled in exit part of the code but in the
mainline of the function.

Fixes: 0a40a1363a ("net/mlx5: fix flow type for allmulti rules")
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-01-29 10:04:28 +01:00
Wei Zhao
db449ae8da doc: add i40e queue region support to release notes
This patch adds information about i40e queue region related to
the release notes.

Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2018-01-29 10:04:28 +01:00
Beilei Xing
8fa90ab26e doc: add i40e tunnel support in release notes
Update release notes to declare MPLSoUDP/MPLSoGRE/GTP-U/GTP-C/PPPoE/
PPPoL2TP steering support in i40e driver.

Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2018-01-29 10:04:28 +01:00
Radu Nicolau
b97a13d883 net/ixgbe: check security enable bits
Check if the security enable bits are not fused before setting
offload capabilities for security.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2018-01-29 10:04:28 +01:00
Pablo de Lara
8f40d6cc6d maintainers: update for cryptodev
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-30 00:20:31 +01:00
Fiona Trahe
3b12d382db crypto/qat: fix truncated response ring value
Issue detected by coverity. Could never actually cause a
problem as truncated value (0x7f7f7f7f->0x7f) is what's needed.
But fix in code for correctness.

Coverity issue: 194998
Fixes: 571365dd4c ("crypto/qat: enable Rx head writes coalescing")
Cc: stable@dpdk.org

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
2018-01-29 20:22:33 +01:00
Fiona Trahe
3c60756c73 test/crypto: improve NULL authentication validation
Add comparison to make sure memory pointed to by
digest pointer is not overwritten in NULL auth case.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-01-29 20:22:33 +01:00
Fiona Trahe
4e0955bddb crypto/qat: fix null auth algo overwrite
If auth algorithm is RTE_CRYPTO_AUTH_NULL and digest_length is 0
in the xform and digest pointer is set in the op, then
the PMD may overwrite memory at the digest pointer.
With this patch the memory is not overwritten.

Fixes: db0e952a5c ("crypto/qat: add NULL capability")
Cc: stable@dpdk.org

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2018-01-29 20:22:33 +01:00
Zhiyong Yang
513942f07c cryptodev: fix session pointer cast
The wrong casts don't cause actual error, but they should conform to C
standard.

Fixes: c261d1431b ("security: introduce security API and framework")
Fixes: b3bbd9e5f2 ("cryptodev: support device independent sessions")
Cc: stable@dpdk.org

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-01-29 20:22:33 +01:00
Fan Zhang
7629b31f84 app/crypto-perf: fix out-of-bounds array access
Fixes: 27c2e74719 ("app/crypto-perf: support IMIX")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2018-01-29 20:22:33 +01:00
Fan Zhang
a6b57a534d examples/ipsec_secgw: fix security session
Fixes: 3da37f6821 ("examples/ipsec_secgw: create session mempools for ethdevs")

Some NICs do not have the rte_security context, this patch fixes the segment fault
caused by this.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2018-01-29 20:22:33 +01:00
Tomasz Jozwiak
c202320775 crypto/qat: fix parameter type
This commit fixes right cast from qat_cipher_get_block_size
function. This function can return -EFAULT in case of
any error, and that value must be cast to int instead of uint8_t

Fixes: d18ab45f76 ("crypto/qat: support DOCSIS BPI mode")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2018-01-29 20:22:33 +01:00
Tomasz Jozwiak
2c4e6fd19c crypto/qat: fix typo in error message
This commit fixes typo in bpi_cipher_decrypt error message

Fixes: d18ab45f76 ("crypto/qat: support DOCSIS BPI mode")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2018-01-29 20:22:33 +01:00
Tomasz Jozwiak
8aa8ee9d2d crypto/qat: fix out-of-bounds access
This commit fixes
  - bpi_cipher_encrypt to prevent before 'array subscript is
    above array bounds' error
  - bpi_cipher_decrypt to prevent before 'array subscript is
    above array bounds' error

Fixes: d18ab45f76 ("crypto/qat: support DOCSIS BPI mode")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2018-01-29 20:22:33 +01:00
Akhil Goyal
a74af788c6 crypto/dpaa_sec: support scatter gather
Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-29 20:22:33 +01:00
Akhil Goyal
37f96eb01b crypto/dpaa2_sec: support scatter gather
Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-29 20:22:33 +01:00
Akhil Goyal
42c3576d44 doc: update feature list for cryptodevs
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-01-29 20:22:33 +01:00
Thomas Monjalon
2ab9a94831 crypto/dpaa2_sec: fix build with GCC 7
Seen with GCC 7.2.0, a switch fall through is detected and
cannot be fixed with a fall-through comment or attribute:

drivers/crypto/dpaa2_sec/hw/rta/operation_cmd.h:89:6: error:
this statement may fall through [-Werror=implicit-fallthrough=]
   if (rta_sec_era < RTA_SEC_ERA_2)
      ^

The check is disabled in dpaa2_sec Makefile but not in dpaa_sec Makefile
which uses source code shared by dpaa2_sec.

The workaround is to disable the check at the beginning of the file.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:38:24 +01:00
Thomas Monjalon
d961c37439 crypto/mrvl: fix export map file name
Fixes: 8a61c83af2 ("crypto/mrvl: add mrvl crypto driver")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:35:29 +01:00
Neil Horman
2843cdd93a doc: add ABI experimental tag in versioning guide
Document the need to add the __experimental tag to appropriate functions

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:35:29 +01:00
Neil Horman
a6ec31597a mk: add experimental tag check
Add checks during build to ensure that all symbols in the EXPERIMENTAL
version map section have __experimental tags on their definitions, and
enable the warnings needed to announce their use.  Also add an
ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files
to declare the acceptability of experimental api usage

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:35:29 +01:00
Neil Horman
77b7b81e32 add experimental tag to appropriate functions
Append the __rte_experimental tag to api calls appearing in the
EXPERIMENTAL section of their libraries version map

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:35:29 +01:00
Neil Horman
7d540a3e73 compat: add experimental tag macro
The __rte_experimental macro tags a given exported function as being part of
the EXPERIMENTAL api.  Use of this tag will cause any caller of the
function (that isn't removed by dead code elimination) to emit a warning
that the user is making use of an API whos stabilty isn't guaranteed.
It also places the function in the .text.experimental section, which is
used to validate the tag against the corresponding library version map

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
2018-01-29 22:44:01 +01:00
Neil Horman
a4bcd61de8 buildtools: add script to check experimental API exports
This tools reads the given version map for a directory, and checks to
ensure that, for each symbol listed in the export list, the corresponding
definition is tagged as __rte_experimental, erroring out if its not.  In this
way, we can ensure that the EXPERIMENTAL api is kept in sync with the tags

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
2018-01-29 22:44:00 +01:00
Bruce Richardson
0d68533617 pmdinfogen: allow using stdin and stdout
Rather than having to work off files all the time, allow stdin and stdout
to be used as the source and destination for pmdinfogen. This will allow
other possible usages from scripts, e.g. taking files from ar archive and
building a single .pmd.c file from all the .o files in it.

	for f in `ar t librte_pmd_xyz.a` ; do
		ar p librte_pmd_xyz.a $f | pmdinfogen - - >> xyz_info.c
	done

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2018-01-29 20:48:16 +01:00
Harry van Haaren
67684d1e87 app/procinfo: call EAL cleanup before exit
This patch adds a call to the newly introduced cleanup()
function just before quitting the app.

Adding this function call before quitting from a secondary processes
is important, as otherwise it will leak hugepage memory. For a secondary
process that is run multiple times, this could cause hugepage memory
to become depleted and stop a secondary process from starting.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
2018-01-29 20:33:53 +01:00
Harry van Haaren
295d71095a app/pdump: call EAL cleanup before exit
This patch adds a call to the newly introduced cleanup()
function just before quitting the pdump app.

Adding this function call before quitting from a secondary processes
is important, as otherwise it will leak hugepage memory. For a secondary
process that is run multiple times, this could cause hugepage memory
to become depleted and stop a secondary process from starting.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
2018-01-29 20:33:53 +01:00
Harry van Haaren
aec9c13c52 eal: add function to release internal resources
This commit adds a new function rte_eal_cleanup().
The function serves as a hook to allow DPDK to release
internal resources (e.g.: hugepage allocations).

This function allows DPDK to become more like an ordinary
library, where the library context itself can be initialized
and cleaned up by the application.

The rte_exit() and rte_panic() functions must be considered,
particularly if they should call rte_eal_cleanup() to release any
resources or not. This patch adds the cleanup to rte_exit(),
but does not clean up on rte_panic(). The reason to not clean
up on panicing is that the developer may wish to inspect the
exact internal state of EAL and hugepages.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
2018-01-29 20:33:53 +01:00
Harry van Haaren
1dd133ae07 service: restrict finalize to internal usage
This commit moves the rte_service_finalize() function
to be in the component header, and marks it as @internal.
The function is only called internally by rte_eal_finalize().

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
2018-01-29 19:24:45 +01:00
Hemant Agrawal
8824b74d8f bus/fslmc: register platform HW mempool on runtime
Detect if the DPAA2 mempool objects are present and register
it as platform default hw mempool

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-29 19:02:05 +01:00
Hemant Agrawal
2bd0d5b951 bus/dpaa: register platform HW mempool on runtime
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-29 19:02:05 +01:00
Pavan Nikhilesh
0e79856795 app/testpmd: add log for preferred mempool ops
This patch adds the debug message to print the best selected
pktmbuf mempool ops name.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-01-29 19:02:05 +01:00
Hemant Agrawal
e5b45e9b2b mbuf: add pool create helper for specific mempool ops
Introduce a new helper for pktmbuf pool, which will allow
the application to optionally specify the mempool ops name
as well.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-01-29 19:02:05 +01:00
Hemant Agrawal
a3acc3144a mbuf: add pool ops selection functions
This patch add support for various mempool ops config helper APIs.

1.User defined mempool ops
2.Platform detected HW mempool ops (active).
3.Best selection of mempool ops by looking into user defined,
  platform registered and compile time configured.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-01-29 19:02:05 +01:00
Hemant Agrawal
8b0f7f4341 mbuf: maintain user and compile time mempool ops name
At present the userdefined mempool ops name overwrites
the default mempool ops name variable in internal_config.

This patch change the logic to maintain the value of
user defined only in the internal config.

The pktmbuf_create_pool is updated to reflect the same ie.
use user defined. If not present than use the default.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-01-29 18:52:34 +01:00
Hemant Agrawal
96fd032ba8 eal: prefix mbuf pool ops name with user defined
This patch prefix the mbuf pool ops name with "user" to indicate
that it is user defined.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-01-29 18:52:07 +01:00
Olivier Matz
de677ca0a9 mbuf: fix VLAN flags documentation
Fix inconsistency between mbuf structure documentation and flags
documentation.

Fixes: 380a7aab1a ("mbuf: rename deprecated VLAN flags")
Cc: stable@dpdk.org

Reported-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2018-01-29 18:51:45 +01:00
Olivier Matz
7a52bcf5d8 mbuf: rename Tx VLAN flags
For consistency with the Rx flags, the flags PKT_TX_VLAN_PKT and
PKT_TX_QINQ_PKT are respectively renamed as PKT_TX_VLAN and
PKT_TX_QINQ. The old defines are deprecated but will stay for some time
for compatibility.

Reported-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2018-01-29 18:51:42 +01:00
Olivier Matz
9f8d9b2ee3 mbuf: fix NULL freeing when debug enabled
Do not panic when calling rte_pktmbuf_free(NULL) with mbuf debug
enabled, it is a valid operation.

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

Reported-by: Keith Wiles <keith.wiles@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2018-01-29 18:32:19 +01:00
Konstantin Ananyev
096ffd811f eal/x86: use lock-prefixed instructions for SMP barrier
On x86 it is possible to use lock-prefixed instructions to get
the similar effect as mfence.
As pointed by Java guys, on most modern HW that gives a better
performance than using mfence:
https://shipilev.net/blog/2014/on-the-fence-with-dependencies/
That patch adopts that technique for rte_smp_mb() implementation.
On BDW 2.2 mb_autotest on single lcore reports 2X cycle reduction,
i.e. from ~110 to ~55 cycles per operation.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-01-29 16:50:04 +01:00