dpdk.git
5 years agodoc: add IPsec library guide
Konstantin Ananyev [Thu, 10 Jan 2019 21:06:34 +0000 (21:06 +0000)]
doc: add IPsec library guide

Add IPsec library guide and update release notes.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agotest/ipsec: introduce functional test
Konstantin Ananyev [Thu, 10 Jan 2019 21:06:33 +0000 (21:06 +0000)]
test/ipsec: introduce functional test

Create functional test for librte_ipsec.
Note that the test requires null crypto pmd to pass successfully.

Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: add helpers to group completed crypto-ops
Konstantin Ananyev [Thu, 10 Jan 2019 21:06:32 +0000 (21:06 +0000)]
ipsec: add helpers to group completed crypto-ops

Introduce helper functions to process completed crypto-ops
and group related packets by sessions they belong to.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: rework SA replay window/SQN for MT environment
Konstantin Ananyev [Thu, 10 Jan 2019 21:06:31 +0000 (21:06 +0000)]
ipsec: rework SA replay window/SQN for MT environment

With these changes functions:
  - rte_ipsec_pkt_crypto_prepare
  - rte_ipsec_pkt_process
 can be safely used in MT environment, as long as the user can guarantee
 that they obey multiple readers/single writer model for SQN+replay_window
 operations.
 To be more specific:
 for outbound SA there are no restrictions.
 for inbound SA the caller has to guarantee that at any given moment
 only one thread is executing rte_ipsec_pkt_process() for given SA.
 Note that it is caller responsibility to maintain correct order
 of packets to be processed.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: implement SA data-path API
Konstantin Ananyev [Thu, 10 Jan 2019 21:06:30 +0000 (21:06 +0000)]
ipsec: implement SA data-path API

Provide implementation for rte_ipsec_pkt_crypto_prepare() and
rte_ipsec_pkt_process().
Current implementation:
 - supports ESP protocol tunnel mode.
 - supports ESP protocol transport mode.
 - supports ESN and replay window.
 - supports algorithms: AES-CBC, AES-GCM, HMAC-SHA1, NULL.
 - covers all currently defined security session types:
        - RTE_SECURITY_ACTION_TYPE_NONE
        - RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO
        - RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL
        - RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL

For first two types SQN check/update is done by SW (inside the library).
For last two type it is HW/PMD responsibility.

Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: add SA data-path API
Konstantin Ananyev [Thu, 10 Jan 2019 21:06:29 +0000 (21:06 +0000)]
ipsec: add SA data-path API

Introduce Security Association (SA-level) data-path API
Operates at SA level, provides functions to:
    - initialize/teardown SA object
    - process inbound/outbound ESP/AH packets associated with the given SA
      (decrypt/encrypt, authenticate, check integrity,
      add/remove ESP/AH related headers and data, etc.).

Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agolib: introduce IPsec library
Konstantin Ananyev [Thu, 10 Jan 2019 21:06:28 +0000 (21:06 +0000)]
lib: introduce IPsec library

Introduce librte_ipsec library.
The library is supposed to utilize existing DPDK crypto-dev and
security API to provide application with transparent IPsec processing API.
That initial commit provides some base API to manage
IPsec Security Association (SA) object.

Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agonet: add ESP trailer structure definition
Konstantin Ananyev [Thu, 10 Jan 2019 21:06:27 +0000 (21:06 +0000)]
net: add ESP trailer structure definition

define esp_tail structure.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agosecurity: add opaque userdata pointer into security session
Konstantin Ananyev [Thu, 10 Jan 2019 21:06:26 +0000 (21:06 +0000)]
security: add opaque userdata pointer into security session

Add 'uint64_t opaque_data' inside struct rte_security_session.
That allows upper layer to easily associate some user defined
data with the session.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples/fips_validation: add power on self test
Fan Zhang [Wed, 19 Dec 2018 23:39:04 +0000 (23:39 +0000)]
examples/fips_validation: add power on self test

This patch adds a sample power on self-test to fips_validate
sample application.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Damian Nowak <damianx.nowak@intel.com>
5 years agocryptodev: add opaque data field to symmetric session
Fan Zhang [Thu, 10 Jan 2019 14:50:22 +0000 (14:50 +0000)]
cryptodev: add opaque data field to symmetric session

This patch adds a opaque data field to cryptodev symmetric session.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocryptodev: add reference count to session private data
Fan Zhang [Thu, 10 Jan 2019 14:50:21 +0000 (14:50 +0000)]
cryptodev: add reference count to session private data

This patch adds a refcnt field to every session private data in the
cryptodev symmetric session. The counter is used to prevent freeing
symmetric session blindly before it is not cleared by every type of
crypto device in use.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocryptodev: add user data size to symmetric session
Fan Zhang [Thu, 10 Jan 2019 14:50:20 +0000 (14:50 +0000)]
cryptodev: add user data size to symmetric session

This patch adds a user_data_sz field to cryptodev symmetric session.
The field is used to check if reading or writing the session's user
data field is eligible.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocryptodev: update symmetric session structure
Fan Zhang [Thu, 10 Jan 2019 14:50:19 +0000 (14:50 +0000)]
cryptodev: update symmetric session structure

This patch updates the rte_cryptodev_sym_session structure for
cryptodev library. The updates include a changed session private
data array and an added nb_drivers field. They are used to
calculate the correct session header size and ensure safe access
of the session private data.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocryptodev: add sym session header size function
Fan Zhang [Thu, 10 Jan 2019 14:50:18 +0000 (14:50 +0000)]
cryptodev: add sym session header size function

This patch adds a new API in Cryptodev Framework. The API is used
to get the header size for the created symmetric Cryptodev session.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agotest/crypto: use separate session mempools
Fan Zhang [Thu, 10 Jan 2019 14:50:17 +0000 (14:50 +0000)]
test/crypto: use separate session mempools

This patch uses the two session mempool approach to crypto unit
test. One mempool is for session header objects, and the other is
for session private data.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agovhost/crypto: use separate session mempools
Fan Zhang [Thu, 10 Jan 2019 14:50:16 +0000 (14:50 +0000)]
vhost/crypto: use separate session mempools

This patch uses the two session mempool approach to vhost crypto.
One mempool is for session header objects, and the other is for
session private data.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples: use separate crypto session mempools
Fan Zhang [Thu, 10 Jan 2019 14:50:15 +0000 (14:50 +0000)]
examples: use separate crypto session mempools

This patch uses the two session mempool approach to all cryptodev
sample applications. One mempool is for session header objects, and
the other is for session private data.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agonet/softnic: use separate session mempools
Fan Zhang [Thu, 10 Jan 2019 14:50:14 +0000 (14:50 +0000)]
net/softnic: use separate session mempools

This patch uses the two session mempool approach to softnic PMD.
One mempool is for session header objects, and the other is for
session private data.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoapp/crypto-perf: use separate session mempools
Fan Zhang [Thu, 10 Jan 2019 14:50:13 +0000 (14:50 +0000)]
app/crypto-perf: use separate session mempools

This patch uses the two session mempool approach to crypto perf
application. One mempool is for session header objects, and the other
is for session private data.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocryptodev: add sym session mempool create
Fan Zhang [Thu, 10 Jan 2019 14:50:12 +0000 (14:50 +0000)]
cryptodev: add sym session mempool create

This patch adds a new API "rte_cryptodev_sym_session_pool_create()" to
cryptodev library. All applications are required to use this API to
create sym session mempool as it adds private data and nb_drivers
information to the mempool private data.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocryptodev: change queue pair configure structure
Fan Zhang [Thu, 10 Jan 2019 14:50:11 +0000 (14:50 +0000)]
cryptodev: change queue pair configure structure

This patch changes the cryptodev queue pair configure structure
to enable two mempool passed into cryptodev PMD simutaneously.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocrypto/aesni_mb: support plain SHA
Fan Zhang [Thu, 20 Dec 2018 12:22:15 +0000 (12:22 +0000)]
crypto/aesni_mb: support plain SHA

This patch adds the plain SHA1, SHA224, SHA256, SHA384, and SHA512
algorithms support to AESNI-MB PMD. The cryptodev unit test and
documentation are updated accordingly.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agotest/crypto: fix misleading trace message
Fiona Trahe [Fri, 21 Dec 2018 00:01:25 +0000 (00:01 +0000)]
test/crypto: fix misleading trace message

Test was reporting digest verification failed for all operation errors.
Fixed so it only reports this if the PMD actually reports an auth failure.

Fixes: 9c0eed2f06ae ("app/test: rework crypto AES unit test")
Cc: stable@dpdk.org
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
5 years agocompress/qat: fix returned status on overflow
Tomasz Jozwiak [Thu, 27 Dec 2018 10:42:19 +0000 (11:42 +0100)]
compress/qat: fix returned status on overflow

This patch fixes correct status in case of overflow on
QAT is detected.
In that case RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED value is set in
rte_comp_op.status field instead of RTE_COMP_OP_STATUS_ERROR

Fixes: 32842f2a6d7d ("compress/qat: create FW request and process response")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocompress/qat: add compression on DH895x
Tomasz Jozwiak [Fri, 21 Dec 2018 09:15:22 +0000 (10:15 +0100)]
compress/qat: add compression on DH895x

This patch enables compression on DH895x HW series
and updates supported hardware accelerator devices list.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocrypto/aesni_mb: support AES-GMAC
Fan Zhang [Thu, 20 Dec 2018 12:07:55 +0000 (12:07 +0000)]
crypto/aesni_mb: support AES-GMAC

This patch adds the AES-GMAC authentication only support to AESNI-MB
PMD, including the driver code, cryptodev unit test, and documentation
updates.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Damian Nowak <damianx.nowak@intel.com>
5 years agodoc: update AESNI_MB guide
Fan Zhang [Thu, 20 Dec 2018 11:56:45 +0000 (11:56 +0000)]
doc: update AESNI_MB guide

This patch updates the AESNI-MB PMD document with the new intel-ipsec-mb
version number, the release note with new library version support, and
the deprecation notice for removing some library version support in
19.05 release.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
5 years agocrypto/aesni_mb: use architecture independent macros
Fan Zhang [Thu, 20 Dec 2018 11:56:44 +0000 (11:56 +0000)]
crypto/aesni_mb: use architecture independent macros

This patch duplicates the original rte_aesni_mb_pmd*.c files and replaces
the function calls provided by intel-ipsec-mb library into
architecture-independent macros. The build systems are updated to choose
compiling either rte_aesni_mb_pmd*.c or rte_aesni_mb_pmd*_compat.c based
on the installed intel-ipsec-mb version. For the intel-ipsec-mb older
than 0.52.0 rte_aesni_mb_pmd*_compat.c will be compiled, otherwise
rte_aesni_mb_pmd*.c will be compiled.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Acked-by: Damian Nowak <damianx.nowak@intel.com>
5 years agocrypto/aesni_mb: rename files
Fan Zhang [Thu, 20 Dec 2018 11:56:43 +0000 (11:56 +0000)]
crypto/aesni_mb: rename files

This patch renames the rte_aesni_mb_pmd*.c to
rte_aesni_mb_pmd*_compat.c to indicate those files are for
compatible with older versoin of intel-ipsec-mb library
only.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Acked-by: Damian Nowak <damianx.nowak@intel.com>
5 years agodoc: fix AESNI_MB guide
Fan Zhang [Wed, 9 Jan 2019 12:11:12 +0000 (12:11 +0000)]
doc: fix AESNI_MB guide

This patch fixes the incorrect intel multi buffer library support
version and missed limitation of GCM algorithm support.

Fixes: 0e9f8507afcb ("crypto/aesni_mb: support AES-GCM algorithm")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
5 years agodrivers/crypto: fix PMDs memory leak
Fan Zhang [Fri, 21 Dec 2018 14:11:05 +0000 (14:11 +0000)]
drivers/crypto: fix PMDs memory leak

This patch fixes the memory leak during queue pair release.
Originally the operation ring is not freed when releasing
queue pair, causing the next queue_pair configure call fail
and memory leak.

Fixes: eec136f3c54f ("aesni_gcm: add driver for AES-GCM crypto operations")
Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")
Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library")
Fixes: 3aafc423cf4d ("snow3g: add driver for SNOW 3G library")
Fixes: 94b0ad8e0aa5 ("null_crypto: add driver for null crypto operations")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
5 years agocompress/isal: enable checksum support
Lee Daly [Tue, 8 Jan 2019 16:20:44 +0000 (16:20 +0000)]
compress/isal: enable checksum support

This patch adds checksum support in the ISA-L PMD for both compression
and decompression.
CRC32 is supported as well as Adler32.

Signed-off-by: Lee Daly <lee.daly@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agotest/compress: add checksum tests
Lee Daly [Tue, 8 Jan 2019 16:20:43 +0000 (16:20 +0000)]
test/compress: add checksum tests

This patch adds a test which examines what type of checksum the PMD
supports, Adler, CRC32 or Adler32_CRC32
and tests that feature if the PMD supports it.

Signed-off-by: Lee Daly <lee.daly@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agoapp/procinfo: add --iter-mempool
Vipin Varghese [Thu, 10 Jan 2019 21:36:45 +0000 (03:06 +0530)]
app/procinfo: add --iter-mempool

Function iter_mempool is used for iterating slected mempool elements
and display the contents of elements for a max of 256 bytes. In case
of invalid or no name for mempool, no information is displayed.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agoapp/procinfo: add --show-mempool
Vipin Varghese [Thu, 10 Jan 2019 21:36:44 +0000 (03:06 +0530)]
app/procinfo: add --show-mempool

Function show_mempool is used for displaying valid MEMPOOL.
In case of invalid or no name, whole list is dump.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agoapp/procinfo: add --show-ring
Vipin Varghese [Thu, 10 Jan 2019 21:36:43 +0000 (03:06 +0530)]
app/procinfo: add --show-ring

Function show_ring is used for displaying information of RING instance
of the primary process.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agoapp/procinfo: add --show-crypto
Vipin Varghese [Thu, 10 Jan 2019 21:36:42 +0000 (03:06 +0530)]
app/procinfo: add --show-crypto

Function show_crypto is used for displaying the crypto PMD under primary
process.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agoapp/procinfo: add --show-tm
Vipin Varghese [Thu, 10 Jan 2019 21:36:41 +0000 (03:06 +0530)]
app/procinfo: add --show-tm

Function show_tm is used for displaying the tm PMD under the primary
process. This covers basic and per node|level details with statistics.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agoapp/procinfo: add --show-port
Vipin Varghese [Thu, 10 Jan 2019 21:36:40 +0000 (03:06 +0530)]
app/procinfo: add --show-port

Function show_port is used for displaying the port PMD information under
primary process. The information shows basic, per queue and security.
Also helper MACRO 'MAX_STRING_LEN, STATS_BDR_FMT and STATS_BDR_STR' and
meson build file is updated for new functionality.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agonet/softnic: support service cores
Cristian Dumitrescu [Thu, 10 Jan 2019 13:26:25 +0000 (13:26 +0000)]
net/softnic: support service cores

Add support to run the Soft NIC device on service cores, based on the
value of the sc parameter:

0: The current Soft NIC device is run explicitly by the application. The
   firmware creates one or several pipelines for this dev and maps them
   to CPU cores that should not be service cores. The app is required to
   call rte_pmd_softnic_run() to make this dev work.

1 (default): The current device is run on the service cores transparently
   to the app. The firmware creates one or several pipelines for this dev
   current device and maps them to CPU cores that should be service cores.
   Each of these service cores is calling rte_pmd_softnic_run()
   in order to make this dev work with no app intervention.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
5 years agodevtools: fix wrong headline lowercase for arm
Gavin Hu [Fri, 21 Dec 2018 06:02:56 +0000 (14:02 +0800)]
devtools: fix wrong headline lowercase for arm

Change to the new wording according to Arm corp:
https://mails.dpdk.org/archives/dev/2018-October/115174.html
otherwise, "Wrong headline lowercase" may be falsely reported.

Fixes: f146ada21d1e ("scripts: add more git log checks")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agometer: support RFC4115 trTCM
Eelco Chaudron [Fri, 4 Jan 2019 13:59:42 +0000 (13:59 +0000)]
meter: support RFC4115 trTCM

This patch adds support for RFC4115 trTCM meters.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agonet/ice: fix build with debug enabled
Jerin Jacob [Thu, 27 Dec 2018 06:06:48 +0000 (06:06 +0000)]
net/ice: fix build with debug enabled

When RTE_LIBRTE_MBUF_DEBUG enabled, rte_mbuf_sanity_check()
function defined in rte_mbuf.so library,
add it while linking the librte_pmd_ice.so library to fix
the build issue.

error log:
/usr/bin/ld: ice_rxtx.o: in function `ice_recv_pkts':
ice_rxtx.c:(.text+0x1d97): undefined reference to
`rte_mbuf_sanity_check'
/usr/bin/ld: ice_rxtx.o: in function
`ice_tx_queue_release_mbufs':
ice_rxtx.c:(.text+0x21e0): undefined reference to
`rte_mbuf_sanity_check'
/usr/bin/ld: ice_rxtx.c:(.text+0x22b3): undefined reference
to `rte_mbuf_sanity_check'
/usr/bin/ld: ice_rxtx.c:(.text+0x24a0): undefined reference
to `rte_mbuf_sanity_check'
/usr/bin/ld: ice_rxtx.c:(.text+0x2640): undefined reference
to `rte_mbuf_sanity_check'
/usr/bin/ld: ice_rxtx.o:ice_rxtx.c:(.text+0x299f):
more undefined references to `rte_mbuf_sanity_check' follow

Fixes: 50370662b727 ("net/ice: support device and queue ops")

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/mlx5: add ConnectX-6 device IDs
Wisam Jaddo [Mon, 31 Dec 2018 12:43:48 +0000 (12:43 +0000)]
net/mlx5: add ConnectX-6 device IDs

This commit includes the add of:
- ConnectX-6 device ID
- ConnectX-6 SRIOV device ID

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: support flow w/o ETH spec and with VLAN
Dekel Peled [Thu, 20 Dec 2018 07:15:34 +0000 (09:15 +0200)]
net/mlx4: support flow w/o ETH spec and with VLAN

This patch adds to MLX4 PMD the option to set flow rules
with empty ether MAC and specific VLAN ID.

Note that this fix works with
1. CX-3 FW 2.42.5016 or higher.
2. mlxconfig configuration STEER_FORCE_VLAN set to 1.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/mlx5: support modify header using Direct Verbs
Dekel Peled [Thu, 27 Dec 2018 11:09:38 +0000 (13:09 +0200)]
net/mlx5: support modify header using Direct Verbs

This patch implements the set of actions to support offload
of packet header modifications to MLX5 NIC.

Implementation is based on RFC [1].

[1] http://mails.dpdk.org/archives/dev/2018-November/119971.html

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/ice: fix CRC strip
Qiming Yang [Tue, 25 Dec 2018 15:21:08 +0000 (23:21 +0800)]
net/ice: fix CRC strip

Fixes: 50370662b727 ("net/ice: support device and queue ops")

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: fix get RSS conf
Qiming Yang [Mon, 24 Dec 2018 15:34:02 +0000 (23:34 +0800)]
net/i40e: fix get RSS conf

rte_eth_dev_rss_hash_conf_get API doesn't force 'rss_conf.rss_key'
to be not NULL, so rss_key = NULL should be alllowed in i40e
driver.

Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and key")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agoversion: 19.02-rc1
Thomas Monjalon [Sat, 22 Dec 2018 23:21:13 +0000 (00:21 +0100)]
version: 19.02-rc1

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoapp/testpmd: expand RED queue thresholds to 64 bits
Rosen Xu [Mon, 26 Nov 2018 08:35:57 +0000 (16:35 +0800)]
app/testpmd: expand RED queue thresholds to 64 bits

There's very commonly that more than 4G DDR memory in NIC for HQoS,
so right now the queue threshold size of RED needs to expand to
uint64_t. For struct rte_tm_red_params, it has been fixed, but for
test-pmd TM configuration, it hasn't been fixed. This patch fixes it.

Fixes: bddc2f40b594 ("app/testpmd: add commands for shaper and wred profiles")
Cc: stable@dpdk.org
Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
5 years agosched: fix memory leak on init failure
Tonghao Zhang [Wed, 28 Nov 2018 13:55:55 +0000 (05:55 -0800)]
sched: fix memory leak on init failure

In some case, we may create sched port dynamically,
if err when creating so memory will leak.

Fixes: de3cfa2c9823 ("sched: initial import")
Cc: stable@dpdk.org
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
5 years agombuf: implement generic format for sched field
Reshma Pattan [Thu, 20 Dec 2018 12:16:09 +0000 (12:16 +0000)]
mbuf: implement generic format for sched field

This patch implements the changes proposed in the deprecation
notes [1][2].

librte_mbuf changes:
The mbuf->hash.sched field is updated to support generic
definition in line with the ethdev traffic manager and meter APIs.
The new generic format contains: queue ID, traffic class, color.

Added public APIs to set and get these new fields to and from mbuf.

librte_sched changes:
In addtion, following API functions of the sched library have
been modified with an additional parameter of type struct
rte_sched_port to accommodate the changes made to mbuf sched field.
(i)rte_sched_port_pkt_write()
(ii) rte_sched_port_pkt_read_tree_path()

librte_pipeline, qos_sched UT, qos_sched app are updated
to make use of new changes.

Also mbuf->hash.txadapter has been added for eventdev txq,
rte_event_eth_tx_adapter_txq_set and rte_event_eth_tx_adapter_txq_get()
are updated to use mbuf->hash.txadapter.txq.

doc:
Release notes updated.
Removed deprecation notice for mbuf->hash.sched and sched API.

[1] http://mails.dpdk.org/archives/dev/2018-February/090651.html
[2] https://mails.dpdk.org/archives/dev/2018-November/119051.html

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Nikhil Rao <nikhil.rao@intel.com>
Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
5 years agometer: unify packet color definition
Reshma Pattan [Thu, 20 Dec 2018 12:16:08 +0000 (12:16 +0000)]
meter: unify packet color definition

Added new rte_color definition in librte_meter to
consolidate color definition which is currently replicated
in various places such as rte_meter.h, rte_tm.h and rte_mtr.h

Created aliases for rte_tm_color, rte_mtr_color and rte_meter_color
to use new rte_color values.

The definitions of rte_tm_color, rte_mtr_color and rte_meter_color
will be deprecated in future.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agotelemetry: fix using ports of different types
Bruce Richardson [Wed, 19 Dec 2018 11:59:50 +0000 (11:59 +0000)]
telemetry: fix using ports of different types

Different NIC ports can have different numbers of xstats on them, which
means that we can't just use the xstats list from the first port registered
in the telemetry library. Instead, we need to check the type of each port -
by checking its ops structure pointer - and register each port type once
with the metrics lib.

Fixes: fdbdb3f9ce46 ("telemetry: add initial connection socket")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
5 years agonet/sfc: pass HW Tx queue index on creation
Andrew Rybchenko [Fri, 21 Dec 2018 12:15:39 +0000 (12:15 +0000)]
net/sfc: pass HW Tx queue index on creation

Software indexes are PMD internal and should not be passed outside.
Right now SW and HW indexes of the Tx queue match, so it is just
a cosmetic fix.

Fixes: dbdc82416b72 ("net/sfc: factor out libefx-based Tx datapath")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/failsafe: add default Tx mbuf fast free capability
Ivan Malov [Fri, 12 Oct 2018 11:36:27 +0000 (12:36 +0100)]
net/failsafe: add default Tx mbuf fast free capability

This capability is reported when supported by the current emitting
sub-device. Failsafe PMD itself does not exercise fast free logic.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoapp/testpmd: add boundary check in flow command
Wei Zhao [Thu, 6 Dec 2018 02:38:06 +0000 (10:38 +0800)]
app/testpmd: add boundary check in flow command

There is need to add boundary for input number from commandline,
If it beyond the definition, code will return error.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/avf/base: fix comment referencing internal data
Rami Rosen [Fri, 21 Dec 2018 12:16:59 +0000 (14:16 +0200)]
net/avf/base: fix comment referencing internal data

DCR is Intel internal information, no need to be in public code.
Related commit:
1a0833efde70 ("net/i40e/base: fix comment referencing internal data")

Fixes: e5b2a9e957e7 ("net/avf/base: add base code for avf PMD")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/tap: fix possible uninitialized variable access
Ferruh Yigit [Mon, 5 Nov 2018 15:31:21 +0000 (15:31 +0000)]
net/tap: fix possible uninitialized variable access

Fixes: 7c25284e30c2 ("net/tap: add netlink back-end for flow API")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/af_packet: fix setting MTU decrements sockaddr twice
Tiago Lam [Tue, 20 Nov 2018 10:26:29 +0000 (10:26 +0000)]
net/af_packet: fix setting MTU decrements sockaddr twice

When setting the MTU, eth_dev_mtu_set() is called to validate the
provided MTU. As part of that, it calculates the useful area to store
data and compares it against the MTU, to guarantee that there's enough
space to store the data. It calculates that as:
    "tp_frame_size - TPACKET2_HDRLEN - sizeof(struct sockaddr_ll)"

However, the TPACKET2_HDRLEN macro already increments sizeof(struct
sockaddr_ll) internally, meaning the useuful area of data above will
have sizeof(struct sockaddr_ll) decremented twice.

Instead, the useful area of data should be calculated as:
    "tp_frame_size - TPACKET2_HDRLEN"

This makes sure that there's enough useful area to fit the provided MTU
after excluding tpacket2_hdr and sockaddr_ll.

Fixes: cc68ac4847bc ("net/af_packet: support MTU change")
Cc: stable@dpdk.org
Signed-off-by: Tiago Lam <tiago.lam@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/virtio: improve batching in mergeable path
Maxime Coquelin [Thu, 20 Dec 2018 17:27:18 +0000 (18:27 +0100)]
net/virtio: improve batching in mergeable path

This patch improves both descriptors dequeue and refill,
by using the same batching strategy as done in in-order path.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
5 years agonet/virtio: add non-mergeable support to in-order path
Maxime Coquelin [Thu, 20 Dec 2018 17:27:17 +0000 (18:27 +0100)]
net/virtio: add non-mergeable support to in-order path

This patch adds support for in-order path when meargeable buffers
feature hasn't been negotiated.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: inline refill and offload helpers
Maxime Coquelin [Thu, 20 Dec 2018 17:27:16 +0000 (18:27 +0100)]
net/virtio: inline refill and offload helpers

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
5 years agovhost: batch used descs chains write-back with packed ring
Maxime Coquelin [Thu, 20 Dec 2018 16:47:55 +0000 (17:47 +0100)]
vhost: batch used descs chains write-back with packed ring

Instead of writing back descriptors chains in order, let's
write the first chain flags last in order to improve batching.

Also, move the write barrier in logging cache sync, so that it
is done only when logging is enabled. It means there is now
one more barrier for split ring when logging is enabled.

With Kernel's pktgen benchmark, ~3% performance gain is measured.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: avoid double accounting of bytes
Jens Freimann [Thu, 20 Dec 2018 10:56:24 +0000 (11:56 +0100)]
net/virtio: avoid double accounting of bytes

Accounting of bytes was moved to a common function, so at the moment we do
it twice. This patches fixes it for sending packets with packed virtqueues.

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: remove useless prefetch for packed ring descriptor
Maxime Coquelin [Wed, 19 Dec 2018 08:21:13 +0000 (09:21 +0100)]
vhost: remove useless prefetch for packed ring descriptor

This prefetch does not show any performance improvement.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: prefetch descriptor after the read barrier
Maxime Coquelin [Wed, 19 Dec 2018 08:21:12 +0000 (09:21 +0100)]
vhost: prefetch descriptor after the read barrier

This patch moves the prefetch after the available index
is read to avoid prefetching a descriptor not available yet.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: enforce desc flags and content read ordering
Maxime Coquelin [Wed, 19 Dec 2018 08:21:11 +0000 (09:21 +0100)]
vhost: enforce desc flags and content read ordering

A read barrier is required to ensure that the ordering between
descriptor's flags and content reads is enforced.

1. read flags = desc->flags
if (flags & AVAIL_BIT)
2.   read desc->id

There is a control dependency between steps 1 and step 2.
2 could be speculatively executed before 1, which could result
in 'id' to not be updated yet.

Fixes: 2f3225a7d69b ("vhost: add vector filling support for packed ring")
Cc: stable@dpdk.org
Reported-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: enforce avail index and desc read ordering
Maxime Coquelin [Wed, 19 Dec 2018 08:21:10 +0000 (09:21 +0100)]
vhost: enforce avail index and desc read ordering

A read barrier is required to ensure the ordering between
available index and the descriptor reads is enforced.

1. read avail_head = avail->idx
2. read cur_idx = last_avail_idx
if (cur_idx != avail_head) {
    3. read idx = avail->ring[cur_idx]
    4. read desc[idx]
}

There is a control dependency between step 1 and steps 3 & 4,
3 could be speculatively executed before 1, which could result
in 'idx' to not being updated yet.

Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
Cc: stable@dpdk.org
Reported-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/vhost: fix double free of MAC address
Hideyuki Yamashita [Wed, 19 Dec 2018 04:37:18 +0000 (13:37 +0900)]
net/vhost: fix double free of MAC address

The common data freeing has been moved to rte_eth_dev_release_port(),
so freeing mac_addrs like this in eth_dev_close() is unnecessary and
will cause double free.

Fixes: e16adf08e54d ("ethdev: free all common data when releasing port")
Cc: stable@dpdk.org
Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/cxgbe: implement reset hit counters for offloaded flows
Rahul Lakkireddy [Fri, 14 Dec 2018 19:01:23 +0000 (00:31 +0530)]
net/cxgbe: implement reset hit counters for offloaded flows

Implement logic to reset hit counters for offloaded flows.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/failsafe: remove unnecessary debug messages
Stephen Hemminger [Fri, 14 Dec 2018 19:35:52 +0000 (11:35 -0800)]
net/failsafe: remove unnecessary debug messages

The failsafe driver spews messages every time it is polling
making debugging other things more difficult. Just remove it.

Example:
net_failsafe: Hot-plug mutex was locked by thread 140182066431744 by the hot-plug alarm
net_failsafe: Hot-plug mutex was locked by thread 140182066431744 by the hot-plug alarm
...

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/tap: add buffer overflow checks before checksum
Bruce Richardson [Mon, 17 Dec 2018 15:50:05 +0000 (15:50 +0000)]
net/tap: add buffer overflow checks before checksum

The checksum calculation APIs take only the packet headers pointers as
parameters, so they assume that the lengths reported in those headers
are correct. However, a malicious packet could claim to be far larger
than it is, so we need to check the header lengths in the driver before
calling the checksum API.

A better fix would be to allow the lengths to be passed into the API
function, but that would be an API break, so fixing in TAP driver for
now.

Fixes: 8ae3023387e9 ("net/tap: add Rx/Tx checksum offload support")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
5 years agonet: fix underflow for checksum of invalid IPv4 packets
Bruce Richardson [Mon, 17 Dec 2018 15:50:04 +0000 (15:50 +0000)]
net: fix underflow for checksum of invalid IPv4 packets

If we receive a packet with an invalid IP header, where the total packet
length is reported as less than the IP header length, we would end up
getting an underflow in the length subtraction.

This could cause us to checksum e.g. 4GB of data in the case where the
result of the subtraction was -1.

We fix this by having the function return 0 - an invalid sum - when
the length is less than the header length.

Fixes: af75078fece3 ("first public release")
Fixes: 6006818cfb26 ("net: new checksum functions")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/mlx5: fix Multi-Packet RQ mempool free
Yongseok Koh [Wed, 12 Dec 2018 11:11:32 +0000 (03:11 -0800)]
net/mlx5: fix Multi-Packet RQ mempool free

When MPRQ mempool is freed, the pointer stored in priv structure must be
reset to null. Otherwise, the mempool can be freed again if the port is
restarted.

Fixes: 7d6bf6b866b8 ("net/mlx5: add Multi-Packet Rx support")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agodoc: update queue number per VF for i40e
Zhirun Yan [Thu, 20 Dec 2018 11:01:30 +0000 (11:01 +0000)]
doc: update queue number per VF for i40e

Updated the doc and release notes on the support for requesting more
queues.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: support PF respond VF request more queues
Zhirun Yan [Thu, 20 Dec 2018 11:01:29 +0000 (11:01 +0000)]
net/i40e: support PF respond VF request more queues

This patch respond the VIRTCHNL_OP_REQUEST_QUEUES msg from VF, and
process to allocated more queues for the requested VF. If successful,
PF will notify VF to reset. If unsuccessful, PF will send message to
inform VF.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: support VF request more queues
Zhirun Yan [Thu, 20 Dec 2018 11:01:28 +0000 (11:01 +0000)]
net/i40e: support VF request more queues

Before this patch, VF gets a default number of queues from the PF.
This patch enables VF to request a different number. When VF configures
more queues, it will send VIRTCHNL_OP_REQUEST_QUEUES to PF to request
more queues, if success, PF will reset the VF.

User can run "port stop all", "port config port_id rxq/txq queue_num"
and "port start all" to reconfigure queue number.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: fix config name in comment
Rami Rosen [Wed, 19 Dec 2018 11:22:03 +0000 (13:22 +0200)]
net/i40e: fix config name in comment

This patch fixes I40E RxTx module to use the proper config setting,
CONFIG_RTE_LIBRTE_I40E_INC_VECTOR.

Fixes: 9ed94e5bb04e ("i40e: add vector Rx")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/cxgbe: fix other misc build issues for Windows
Rahul Lakkireddy [Wed, 19 Dec 2018 16:28:26 +0000 (21:58 +0530)]
net/cxgbe: fix other misc build issues for Windows

Fix following build errors reported by Intel C++ compiler in Windows
build.

C:\> t4_hw.c(5105): warning #147: declaration is incompatible with
"int t4_bar2_sge_qregs(struct adapter *, unsigned int, unsigned int,
u64={uint64_t={unsigned __int64}} *, unsigned int *)"
(declared at line 524 of "..\..\..\..\drivers\net\cxgbe\base\common.h")
    int t4_bar2_sge_qregs(struct adapter *adapter, unsigned int qid,
        ^

C:\> cxgbe_filter.c(42): error : expected an expression
        n_user_filters = mult_frac(adap->tids.nftids,
                         ^

C:\> sge.c(400): error : expression must be a pointer to a complete
object type
                  (uint16_t)(RTE_PTR_ALIGN((char *)mbuf->buf_addr +
                             ^

Build Environment:
1. Target OS: Microsoft Windows Server 2016
2. Compiler: Intel C++ Compiler from Intel Parallel Studio XE 2019 [1]
3. Development Tools:
   3.1 Microsoft Visual Studio 2017 Professional
   3.2 Windows Software Development Kit (SDK) v10.0.17763
   3.3 Windows Driver Kit (WDK) v10.0.17763

[1] https://software.intel.com/en-us/parallel-studio-xe

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: define symbols only when not available
Rahul Lakkireddy [Wed, 19 Dec 2018 16:28:25 +0000 (21:58 +0530)]
net/cxgbe: define symbols only when not available

Define symbols only when they are not available.

This fixes following types of issues reported by Intel C++ compiler
in Windows build.

C:\> cxgbe_compat.h(154): warning #47: incompatible redefinition of
macro "min"
        #define min(a, b) RTE_MIN(a, b)
                ^

C:\> t4_hw.c(338): warning #266: function "bzero" declared implicitly
            bzero(p, 0, size);
            ^

C:\> t4_hw.c(5337): warning #266: function "htonl" declared implicitly
            rvc.op_to_viid = htonl(V_FW_CMD_OP(FW_RSS_VI_CONFIG_CMD) |
                             ^

C:\> sge.c(361): error : expected an expression
        struct sge_eth_rxq *rxq = container_of(q, struct sge_eth_rxq, fl);
                                  ^

C:\> sge.c(1350): error : identifier "caddr_t" is undefined
  static void inline_tx_mbuf(const struct sge_txq *q, caddr_t from,
                                                      ^
[...]

Build Environment:
1. Target OS: Microsoft Windows Server 2016
2. Compiler: Intel C++ Compiler from Intel Parallel Studio XE 2019 [1]
3. Development Tools:
   3.1 Microsoft Visual Studio 2017 Professional
   3.2 Windows Software Development Kit (SDK) v10.0.17763
   3.3 Windows Driver Kit (WDK) v10.0.17763

[1] https://software.intel.com/en-us/parallel-studio-xe

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: fix macros related to logs for Windows
Rahul Lakkireddy [Wed, 19 Dec 2018 16:28:24 +0000 (21:58 +0530)]
net/cxgbe: fix macros related to logs for Windows

Replace "args..." with "fmt, ..." and directly use __VA_ARGS__.

This fixes following errors reported by Intel C++ compiler in Windows
build.

C:\> cxgbe_compat.h(28): error : expected a ")"
        #define dev_printf(level, fmt, args...) \
                                       ^

C:\> cxgbe_compat.h(31): error : expected a ")"
        #define dev_err(x, args...) dev_printf(ERR, args)
                           ^
[...]

Build Environment:
1. Target OS: Microsoft Windows Server 2016
2. Compiler: Intel C++ Compiler from Intel Parallel Studio XE 2019 [1]
3. Development Tools:
   3.1 Microsoft Visual Studio 2017 Professional
   3.2 Windows Software Development Kit (SDK) v10.0.17763
   3.3 Windows Driver Kit (WDK) v10.0.17763

[1] https://software.intel.com/en-us/parallel-studio-xe

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: use relative paths for includes
Rahul Lakkireddy [Wed, 19 Dec 2018 16:28:23 +0000 (21:58 +0530)]
net/cxgbe: use relative paths for includes

The Intel C++ compiler is not able to locate the header files without
relative paths in Windows build. Following errors are seen for these
header files.

C:\> base\common.h(9): error : cannot open source file "cxgbe_compat.h"
        #include "cxgbe_compat.h"
                                 ^
[...]

Fix by explicitly stating header file location using relative paths.
Also, remove automatically including header files for Linux, to keep
it consistent across both OS.

Build Environment:
1. Target OS: Microsoft Windows Server 2016
2. Compiler: Intel C++ Compiler from Intel Parallel Studio XE 2019 [1]
3. Development Tools:
   3.1 Microsoft Visual Studio 2017 Professional
   3.2 Windows Software Development Kit (SDK) v10.0.17763
   3.3 Windows Driver Kit (WDK) v10.0.17763

[1] https://software.intel.com/en-us/parallel-studio-xe

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/ice: support descriptor ops
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:40 +0000 (16:46 +0800)]
net/ice: support descriptor ops

Add below ops,
rx_descriptor_status
tx_descriptor_status

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: support statistics
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:39 +0000 (16:46 +0800)]
net/ice: support statistics

Add below ops,
stats_get
stats_reset
xstats_get
xstats_get_names
xstats_reset

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: support advance Rx/Tx
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:38 +0000 (16:46 +0800)]
net/ice: support advance Rx/Tx

Add Rx functions, scatter and bulk.
Add Tx function, simple.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: support EEPROM information getting
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:37 +0000 (16:46 +0800)]
net/ice: support EEPROM information getting

Add below ops,
get_eeprom_length
get_eeprom

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: support FW version getting
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:36 +0000 (16:46 +0800)]
net/ice: support FW version getting

Add ops fw_version_get.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: support Rx queue interruption
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:35 +0000 (16:46 +0800)]
net/ice: support Rx queue interruption

Add below ops,
rx_queue_intr_enable
rx_queue_intr_disable

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: support RSS
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:34 +0000 (16:46 +0800)]
net/ice: support RSS

Add below ops,
reta_update
reta_query
rss_hash_update
rss_hash_conf_get

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: support VLAN ops
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:33 +0000 (16:46 +0800)]
net/ice: support VLAN ops

Add below ops,
ice_vlan_filter_set
ice_vlan_offload_set
ice_vlan_tpid_set
ice_vlan_pvid_set

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: support MAC ops
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:32 +0000 (16:46 +0800)]
net/ice: support MAC ops

Add below ops,
mac_addr_set
mac_addr_add
mac_addr_remove

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: support MTU setting
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:31 +0000 (16:46 +0800)]
net/ice: support MTU setting

Add ops mtu_set.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: support basic Rx/Tx
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:30 +0000 (16:46 +0800)]
net/ice: support basic Rx/Tx

Add basic RX & TX support.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: support packet type getting
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:29 +0000 (16:46 +0800)]
net/ice: support packet type getting

Add ops dev_supported_ptypes_get.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: support queue information getting
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:28 +0000 (16:46 +0800)]
net/ice: support queue information getting

Add below ops,
rxq_info_get
txq_info_get
rx_queue_count

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: support link update
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:27 +0000 (16:46 +0800)]
net/ice: support link update

Add ops link_update.
LSC interrupt is also enabled in this patch.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: support getting device information
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:26 +0000 (16:46 +0800)]
net/ice: support getting device information

Add ops dev_infos_get.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: support device and queue ops
Wenzhuo Lu [Tue, 18 Dec 2018 08:46:25 +0000 (16:46 +0800)]
net/ice: support device and queue ops

Normally when starting/stopping the device the queue
should be started and stopped. Support them both in
this patch.

Below ops are added,
dev_configure
dev_start
dev_stop
dev_close
dev_reset
rx_queue_start
rx_queue_stop
tx_queue_start
tx_queue_stop
rx_queue_setup
rx_queue_release
tx_queue_setup
tx_queue_release

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>