dpdk.git
7 years agonet/mlx5: fix IPv6 flow pattern item
Nélio Laranjeiro [Tue, 25 Apr 2017 08:27:52 +0000 (10:27 +0200)]
net/mlx5: fix IPv6 flow pattern item

Only masked bits must be set in Verbs specification for a rule to be valid.

Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/i40e: fix array bounds
Jingjing Wu [Tue, 25 Apr 2017 05:01:01 +0000 (13:01 +0800)]
net/i40e: fix array bounds

Fix array bounds when set default ptype mapping.

Fixes: 62e94f7f66fb ("net/i40e: configure packet type mapping")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e: fix setup when bulk is disabled
Beilei Xing [Thu, 20 Apr 2017 08:51:36 +0000 (16:51 +0800)]
net/i40e: fix setup when bulk is disabled

Testpmd failed to start when CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC
is disabled, the root cause is the length of sw_ring and queue are
incorrect with the above configuration.

Fixes: 0be295312966 ("net/i40e: fix compile error")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
7 years agonet/sfc: fix LSC interrupt support for UIO cases
Andrew Rybchenko [Fri, 21 Apr 2017 12:16:42 +0000 (13:16 +0100)]
net/sfc: fix LSC interrupt support for UIO cases

Recently link status change interrupt was enabled by default in testpmd,
it has opened the driver bug with not working LSC interrupt if either
igb_uio or uio_pci_generic kernel driver is used.

Fixes: 06bc197796e2 ("net/sfc: interrupts support sufficient for event queue init")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
7 years agonet/sfc: correct estimation of max DMA descriptors required
Andrew Rybchenko [Fri, 21 Apr 2017 11:02:33 +0000 (12:02 +0100)]
net/sfc: correct estimation of max DMA descriptors required

Previous too pessimistic estimation made completely impossible to send
packets with many segments (more than 100 with minimum Tx ring size).

Fixes: 8b00f426eb66 ("net/sfc: implement EF10 native Tx datapath")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
7 years agonet/ixgbe: align register setting when RSC is disabled
Wei Dai [Thu, 20 Apr 2017 03:06:06 +0000 (11:06 +0800)]
net/ixgbe: align register setting when RSC is disabled

When Receive Side Coalescing (RSC) is not used, the RSC Disable
(RSC_DIS) filed of register Receive Filter Control Register (RFCTL)
should be set according to ixgbe datasheet.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/ixgbe/base: update version to 2017.03.29
Wei Dai [Tue, 18 Apr 2017 06:57:03 +0000 (14:57 +0800)]
net/ixgbe/base: update version to 2017.03.29

* Acquire PHY semaphore before device reset
* Add support for 2.5G KX physical layer
* Add MAC X550em/X557 LED on|off support

Signed-off-by: Wei Dai <wei.dai@intel.com>
7 years agonet/ixgbe/base: support MAC X550em/X557 LED on/off
Wei Dai [Tue, 18 Apr 2017 06:57:02 +0000 (14:57 +0800)]
net/ixgbe/base: support MAC X550em/X557 LED on/off

This patch updates ixgbe_led_[on|off]_t_X550em for MAC or PHY connected
LEDs. To support both MAC or PHY connected LEDs, both MAC and PHY led
control registers are configured.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
7 years agonet/ixgbe/base: support 2.5G KX physical layer
Wei Dai [Tue, 18 Apr 2017 06:57:01 +0000 (14:57 +0800)]
net/ixgbe/base: support 2.5G KX physical layer

Add another define for the 2.5G KX physical layer. This requires all
variables and support functions that deal with "physical_layer" to be
bumped to u64 as this is the 33rd define.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
7 years agonet/ixgbe/base: acquire PHY semaphore before device reset
Wei Dai [Tue, 18 Apr 2017 06:57:00 +0000 (14:57 +0800)]
net/ixgbe/base: acquire PHY semaphore before device reset

A recent firmware change fixed an issue to acquire the PHY semaphore
before accessing PHY registers. This led to a case where SW can issue
a device reset clearing the MDIO registers. This patch makes SW acquire
the PHY semaphore before issuing a device reset.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
7 years agodoc: add LSC and RMV interrupt to testpmd guide
Gaetan Rivet [Tue, 25 Apr 2017 10:18:17 +0000 (12:18 +0200)]
doc: add LSC and RMV interrupt to testpmd guide

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agodoc: add device removal event to release notes
Gaetan Rivet [Tue, 25 Apr 2017 10:18:16 +0000 (12:18 +0200)]
doc: add device removal event to release notes

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agodoc: fix missing backquotes in release notes
Gaetan Rivet [Tue, 25 Apr 2017 10:18:15 +0000 (12:18 +0200)]
doc: fix missing backquotes in release notes

Fixes: ea85e7d711b6 ("ethdev: retrieve xstats by ID")

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agodoc: correct the hugepage limitation on 32-bit
Qi Zhang [Fri, 28 Apr 2017 03:49:39 +0000 (23:49 -0400)]
doc: correct the hugepage limitation on 32-bit

The hugepage memory limitation of 32 bit application is
"1GB size" but not "1GB per page size".

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agocmdline: fix parsing
Wenzhuo Lu [Tue, 25 Apr 2017 03:11:25 +0000 (11:11 +0800)]
cmdline: fix parsing

When parsing a CLI, all the CLI instances are checked
one by one. Even if an instance already matches the CLI,
the parsing will not stop for ambiguous check.
The problem is that the following check may change the
parsing result of the previous one even if the following
instance doesn't match.

Use a temporary validate for the parsing result when
trying to match an instance and only store the result
when it matches, so the previous result has no chance
to be changed.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agolatency: fix missing includes in exported header
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:11 +0000 (14:07 +0200)]
latency: fix missing includes in exported header

This commit addresses the following errors:

 In file included from build/include/rte_latencystats.h:43:0,
                  from /tmp/check-includes.sh.6580.c:1:
 build/include/rte_metrics.h:91:2: error: unknown type name 'uint16_t'
 [...]
 In file included from /tmp/check-includes.sh.6580.c:1:0:
 build/include/rte_latencystats.h:66:19: error: expected declaration
    specifiers or '...' before '*' token
 [...]

Fixes: 5cd3cac9ed22 ("latency: added new library for latency stats")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agobitrate: fix exported header
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:16 +0000 (14:07 +0200)]
bitrate: fix exported header

This commit addresses the following error:

 In file included from /tmp/check-includes.sh.28023.c:1:0:
 build/include/rte_bitrate.h:82:2: error: unknown type name 'uint8_t'
 [...]

It also adds C++ awareness to rte_bitrate.h.

Fixes: 2ad7ba9a6567 ("bitrate: add bitrate statistics library")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
7 years agometrics: fix exported header
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:18 +0000 (14:07 +0200)]
metrics: fix exported header

This commit addresses the following compilation errors:

 In file included from /tmp/check-includes.sh.21060.c:1:0:
 build/include/rte_metrics.h:91:2: error: unknown type name 'uint16_t'
 [...]

It also adds C++ awareness to rte_metrics.h.

Fixes: 349950ddb9c5 ("metrics: add information metrics library")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
7 years agoefd: fix missing include in exported header
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:17 +0000 (14:07 +0200)]
efd: fix missing include in exported header

This commit addresses the following compilation errors:

 In file included from /tmp/check-includes.sh.8373.c:1:0:
 build/include/rte_efd.h:133:9: error: unknown type name 'uint8_t'
 [...]

Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agoeventdev: fix headers for strict compilation flags
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:10 +0000 (14:07 +0200)]
eventdev: fix headers for strict compilation flags

Exported headers must allow compilation with the strictest flags. This
commit addresses the following errors:

 In file included from build/include/rte_eventdev_pmd.h:55:0,
                  from /tmp/check-includes.sh.25816.c:1:
 build/include/rte_eventdev.h:908:8: error: struct has no named members
    [-Werror=pedantic]
 [...]
 In file included from /tmp/check-includes.sh.25816.c:1:0:
 build/include/rte_eventdev_pmd.h:65:35: error: ISO C does not permit named
    variadic macros [-Werror=variadic-macros]
 [...]

Fixes: 71f238432865 ("eventdev: introduce event driven programming model")
Fixes: 4f0804bbdfb9 ("eventdev: implement the northbound APIs")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agocrypto/scheduler: fix missing includes
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:09 +0000 (14:07 +0200)]
crypto/scheduler: fix missing includes

This commit addresses the following compilation errors:

 In file included from build/include/rte_cryptodev_scheduler.h:37:0,
                  from /tmp/check-includes.sh.5355.c:1:
 build/include/rte_cryptodev_scheduler_operations.h:43:30: error: unknown
    type name 'uint8_t' struct rte_cryptodev *dev, uint8_t slave_id);
 [...]

Fixes: 097ab0bac017 ("crypto/scheduler: add API")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agovhost: fix header for strict compilation flags
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:13 +0000 (14:07 +0200)]
vhost: fix header for strict compilation flags

Exported headers must allow compilation with the strictest flags. This
commit addresses the following errors:

 In file included from /tmp/check-includes.sh.20132.c:1:0:
 build/include/rte_vhost.h:73:30: error: ISO C forbids zero-size array
    'regions' [-Werror=pedantic]
 [...]

Also:

- Add C++ awareness to rte_vhost.h for consistency with rte_eth_vhost.h.
- Move Linux includes into C++ block to prevent linking issues with
  exported symbols.
- Update check-includes.sh following the removal of rte_virtio_net.h.

Finally, update check-includes.sh to ignore rte_vhost.h and rte_eth_vhost.h
from now on since the Linux headers they depend on are not clean enough:

 In file included from /usr/include/linux/vhost.h:17:0,
                  from build/include/rte_vhost.h:43,
                  from build/include/rte_eth_vhost.h:44,
                  from /tmp/check-includes.sh.20132.c:1:
 /usr/include/linux/virtio_ring.h: In function 'vring_init':
 /usr/include/linux/virtio_ring.h:146:16: error: pointer of type 'void *'
    used in arithmetic [-Werror=pointer-arith]
 [...]
 In file included from build/include/rte_vhost.h:43:0,
                  from build/include/rte_eth_vhost.h:44,
                  from /tmp/check-includes.sh.20132.c:1:
 /usr/include/linux/vhost.h: At top level:
 /usr/include/linux/vhost.h:73:3: error: ISO C99 doesn't support unnamed
    structs/unions [-Werror=pedantic]
 [...]

Fixes: eb32247457fe ("vhost: export guest memory regions")
Fixes: a798beb47c8e ("vhost: rename header file")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agonet/avp: fix exported headers
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:15 +0000 (14:07 +0200)]
net/avp: fix exported headers

This commit addresses several errors related to missing includes such as:

 In file included from /tmp/check-includes.sh.15315.c:1:0:
 build/include/rte_avp_fifo.h:77:22: error: 'struct rte_avp_fifo' declared
    inside parameter list [-Werror]
 [...]
 build/include/rte_avp_fifo.h: In function 'avp_fifo_init':
 build/include/rte_avp_fifo.h:81:3: error: implicit declaration of function
    'rte_panic' [-Werror=implicit-function-declaration]
 [...]
 build/include/rte_avp_fifo.h:83:6: error: dereferencing pointer to
    incomplete type
 [...]
 build/include/rte_avp_fifo.h:109:2: error: implicit declaration of
    function 'rte_wmb' [-Werror=implicit-function-declaration]
 [...]
 In file included from /tmp/check-includes.sh.15315.c:1:0:
 build/include/rte_avp_common.h:104:2: error: unknown type name 'uint64_t'
 [...]
 build/include/rte_avp_common.h:386:15: error: 'ETHER_ADDR_LEN' undeclared
    here (not in a function)
 [...]

It addresses errors with strict compilation flags:

 In file included from /tmp/check-includes.sh.15315.c:1:0:
 build/include/rte_avp_common.h:122:3: error: ISO C99 doesn't support
    unnamed structs/unions [-Werror=pedantic]
 [...]
 build/include/rte_avp_common.h:136:17: error: ISO C forbids zero-size
    array 'buffer' [-Werror=pedantic]
 [...]

And also adds C++ awareness to both header files.

Fixes: 8e680655e205 ("net/avp: add public header files")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
7 years agoethdev: fix incomplete items in flow API
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:21 +0000 (14:07 +0200)]
ethdev: fix incomplete items in flow API

E-Tag and NVGRE pattern items have been added hastily without updating
documentation nor testpmd.

This commit also adds default masks for these items based on the ixgbe
implementation.

Fixes: 99e7003831c3 ("net/ixgbe: parse L2 tunnel filter")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agoethdev: fix flow API for C++
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:19 +0000 (14:07 +0200)]
ethdev: fix flow API for C++

This commit addresses the following compilation errors:

 In file included from build/include/rte_flow_driver.h:50:0,
                  from /tmp/check-includes.sh.1397.cc:1:
 build/include/rte_flow.h:428:2: error: expected primary-expression before
    '.' token
 [...]
 build/include/rte_flow.h:469:1: sorry, unimplemented: non-trivial
    designated initializers not supported
 [...]

 In file included from build/include/rte_flow_driver.h:50:0,
                  from /tmp/check-includes.sh.1397.cc:1:
 build/include/rte_flow.h:631:1: error: C99 designator 'label_tc_s' outside
    aggregate initializer
 [...]
 build/include/rte_flow.h:631:1: error: initializer-string for array of
    chars is too long [-fpermissive]
 [...]
 build/include/rte_flow.h:650:1: sorry, unimplemented: non-trivial
    designated initializers not supported
 [...]

C++ does not support the C99-style designated initializers used in this
file for the default item masks. While the resulting symbols are primarily
useful to PMDs (written in C), they are exposed as part of the public API
for documentation purposes and to assist application writers.

Considering that:

- using pre-C99 initialization style for compatibility with C++ would
  render them difficult to understand (all struct members must be
  initialized)
- using both initialization styles would be needlessly verbose
- not exposing them at all would defeat their purpose
- applications do not normally need these symbols at run time

This commit hides these symbols from C++ applications. Specific C++
initializers will be added later if necessary.

Fixes: 6de5c0f1302c ("ethdev: define default item masks in flow API")
Fixes: 7cd048321d1d ("ethdev: add MPLS and GRE flow API items")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
7 years agonet: fix missing include in exported header
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:12 +0000 (14:07 +0200)]
net: fix missing include in exported header

This commit addresses the following errors:

 In file included from /tmp/check-includes.sh.18889.c:1:0:
 build/include/rte_net_crc.h:86:1: error: unknown type name 'uint32_t'
 [...]

Fixes: 986ff526fb84 ("net: add CRC computation API")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
7 years agombuf: fix missing includes in exported header
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:14 +0000 (14:07 +0200)]
mbuf: fix missing includes in exported header

This commit addresses the following errors:

 In file included from /tmp/check-includes.sh.681.c:1:0:
 build/include/rte_mbuf_ptype.h:587:35: error: unknown type name 'uint32_t'
 [...]
 build/include/rte_mbuf_ptype.h:662:51: error: unknown type name 'size_t'
 [...]

Fixes: 288541c8ff9e ("mbuf: add functions to dump packet type")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agoeal: fix debug macro redefinition
Adrien Mazarguil [Wed, 26 Apr 2017 12:07:22 +0000 (14:07 +0200)]
eal: fix debug macro redefinition

The RTE_FUNC_*_RET() and RTE_PROC_*_RET() macro definitions in rte_dev.h
require RTE_PMD_DEBUG_TRACE(). This macro is defined as needed by users of
rte_dev.h since its value depends on their own debug settings.

It may be defined multiple times as a result when including files from
various components simultaneously. Worse, these redefinitions may be
inconsistent. This causes the following compilation errors:

 In file included from /tmp/check-includes.sh.13890.c:27:0:
    build/include/rte_eventdev_pmd.h:58:0: error: "RTE_PMD_DEBUG_TRACE"
    redefined [-Werror]
 [...]
 In file included from build/include/rte_ethdev_pci.h:39:0,
                  from /tmp/check-includes.sh.13890.c:13:
    build/include/rte_ethdev.h:1042:0: note: this is the location of the
    previous definition
 [...]
 In file included from /tmp/check-includes.sh.13890.c:83:0:
    build/include/rte_cryptodev_pmd.h:65:0: error: "RTE_PMD_DEBUG_TRACE"
    redefined [-Werror]
 [...]
 In file included from /tmp/check-includes.sh.13890.c:27:0:
    build/include/rte_eventdev_pmd.h:58:0: note: this is the location of
    the previous definition
 [...]

This commit moves the RTE_PMD_DEBUG_TRACE() definition to rte_dev.h where
it is enabled consistently depending on global configuration settings and
removes redundant definitions.

Also when disabled, RTE_PMD_DEBUG_TRACE() is now defined as (void)0 to
avoid empty statements warnings if used outside { } blocks.

Fixes: b974e4a40cb5 ("ethdev: make error checking macros public")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agoconfig: make AVX and AVX512 configurable
Zhihong Wang [Thu, 27 Apr 2017 23:00:14 +0000 (19:00 -0400)]
config: make AVX and AVX512 configurable

Making AVX and AVX512 configurable is useful for performance and power
testing.

The similar kernel patch at https://patchwork.kernel.org/patch/9618883/.

AVX512 support like in rte_memcpy has been in DPDK since 16.04, but it's
still unproven in rich use cases in hardware. Therefore it's marked as
experimental for now, will enable it after enough field test and possible
optimization.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agoconfig: set cache line as 128B for generic arm64
Jerin Jacob [Wed, 26 Apr 2017 16:29:19 +0000 (21:59 +0530)]
config: set cache line as 128B for generic arm64

armv8 implementations may have 64B or 128B cache line.
Setting to the maximum available cache line size in generic config to
address minimum DMA alignment across all arm64 implementations.

Increasing the cacheline size has no negative impact to cache invalidation
on systems with a smaller cache line.

The need for the minimum DMA alignment has impact on functional aspects
of the platform so default config should cater the functional aspects.

There is an impact on memory usage with this scheme, but that's not too
important for the single image arm64 distribution use case.

The arm64 linux kernel followed the similar approach for single
arm64 image use case.
http://lxr.free-electrons.com/source/arch/arm64/include/asm/cache.h

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agomk: fix external builds with relative output dir
Jan Blunck [Wed, 26 Apr 2017 21:01:06 +0000 (23:01 +0200)]
mk: fix external builds with relative output dir

In case the output directory (O=) is undefined or a relative directory lets
turn it into an absolute path before passing it on. Otherwise the output
directory is created relative to the subdir, e.g. pktgen/app/build/... and
pktgen/lib/lua/src/build/...

Signed-off-by: Jan Blunck <jblunck@infradead.org>
7 years agomk: use extra cflags when linking with compiler
John Jacques [Tue, 25 Apr 2017 16:10:47 +0000 (11:10 -0500)]
mk: use extra cflags when linking with compiler

When using the compiler to link applications, include EXTRA_CFLAGS. This
is needed, for example, when cross-compiling, to pass --sysroot.
GCC cross-compilers built with Yocto don't use the --with-sysroot option,
making it necessary to pass --sysroot command-line option.

Signed-off-by: John Jacques <john.jacques@intel.com>
Signed-off-by: Gage Eads <gage.eads@intel.com>
7 years agombuf: fix 64-bit address alignment in 32-bit builds
Bruce Richardson [Fri, 28 Apr 2017 13:10:14 +0000 (14:10 +0100)]
mbuf: fix 64-bit address alignment in 32-bit builds

On i686 builds, the uin64_t type is 64-bits in size but is aligned to
32-bits only. This causes mbuf fields for rearm_data to not be 16-byte
aligned on 32-bit builds, which causes errors with some vector PMDs which
expect the rearm data to be aligned as on 64-bit.

Given that we cannot use the extra space in the data structures anyway, as
it's already used on 64-bit builds, we can just force alignment of the
physical address in the mbuf to 8-bytes in all cases. This has no effect on
64-bit systems, but fixes the updated PMDs on 32-bit.

Fixes: f4356d7ca168 ("net/i40e: eliminate mbuf write on rearm")
Fixes: f160666a1073 ("net/ixgbe: eliminate mbuf write on rearm")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agovfio: fix structures for sPAPR IOMMU
Alexey Kardashevskiy [Wed, 26 Apr 2017 08:06:41 +0000 (18:06 +1000)]
vfio: fix structures for sPAPR IOMMU

If Linux UAPI headers in the system do not have VFIO_SPAPR_TCE_v2_IOMMU
defined, DPDK define necessary structures itself. However the existing
definitions are different from ones pushed to the mainline kernel.

This copies structures passed via VFIO_IOMMU_SPAPR_TCE_CREATE and
VFIO_IOMMU_SPAPR_TCE_REMOVE ioctls.

No change in behaviour is expected if installed linux UAPI headers
have knowledge of VFIO_SPAPR_TCE_v2_IOMMU.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
7 years agovfio: fix device unplug when several devices per group
Alejandro Lucero [Wed, 26 Apr 2017 10:49:47 +0000 (11:49 +0100)]
vfio: fix device unplug when several devices per group

VFIO allows a secure way of assigning devices to user space and those
devices which can not be isolated from other ones are set in same VFIO
group. Releasing or unplugging a device should be aware of remaining
devices is the same group for avoiding to close such a group.

Fixes: 94c0776b1bad ("vfio: support hotplug")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
7 years agovfio: set IOMMU type for the container once
Andrew Rybchenko [Tue, 4 Apr 2017 16:06:16 +0000 (17:06 +0100)]
vfio: set IOMMU type for the container once

If more than one used PCI device belongs to one IOMMU group,
it is still one IOMMU group and the container IOMMU type
should be set only once.

Fixes: 94c0776b1bad ("vfio: support hotplug")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
7 years agopci: initialize generic driver pointer
Alexey Kardashevskiy [Wed, 26 Apr 2017 08:07:24 +0000 (18:07 +1000)]
pci: initialize generic driver pointer

The existing code initializes a PCI driver pointer but not the common one.
As the result, ring_dma_zone_reserve() in drivers/net/bnx2x/bnx2x_rxtx.c
crashed as dev->device->driver==NULL.

This adds missing initialization.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
7 years agousertools: fix CPU layout for more than 2 threads
Gowrishankar Muthukrishnan [Fri, 28 Apr 2017 10:34:35 +0000 (16:04 +0530)]
usertools: fix CPU layout for more than 2 threads

Current usertools/cpu_layout.py is broken to handle multithreads
of count more than 2 as in IBM powerpc P8 servers.
Below patch addressed this issue.

Also, added minor exception catch on failing to open unavailable
sys file in case of multithread=off configuration in server.

Patch has been verified not to break existing topology configurations
and also not changing anything in current output.

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Reviewed-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
7 years agousertools: add --status-dev option to devbind
Ferruh Yigit [Thu, 27 Apr 2017 17:55:37 +0000 (18:55 +0100)]
usertools: add --status-dev option to devbind

Script displays status for all device types and output is much
longer than it used to be. This makes harder to read script output.

This patch adds new --status-dev argument to the script to select
a device group to display status.

Supported device groups:
net
crypto
event
mempool

Sample usage:
./usertools/dpdk-devbind.py --status-dev mempool

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agousertools: fix device binding with kernel tools
Guduri Prathyusha [Wed, 26 Apr 2017 13:52:19 +0000 (19:22 +0530)]
usertools: fix device binding with kernel tools

The following sequence of operation gives error in binding devices
1) Bind a device using dpdk-devbind.py
2) Unbind the device using kernel tools(/sys/bus/pci/device/driver/unbind)
3) Bind the device using kernel tools(/sys/bus/pci/driver/new_id and
/sys/bus/pci/driver/bind)

The bind failure was due to cached driver name in 'driver_override'.
Fix it by writing 'null' to driver_override just after binding a
device so that any method of binding/unbinding can be used.

Fixes: 2fc350293570 ("usertools: use optimized driver override scheme to bind")

Reported-by: Lijuan A Tu <lijuanx.a.tu@intel.com>
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
7 years agodevtools: add tags and cscope index generation
Jerin Jacob [Sat, 29 Apr 2017 10:51:18 +0000 (16:21 +0530)]
devtools: add tags and cscope index generation

This script generates cscope, gtags, and tags index files based on
EAL environment(architecture and OS(linux/bsd)).

Selection of the architecture and OS environment is based on dpdk
configuration target(T=).If EAL environment(T=) is not specified,
the script generates tag files based on available source code.

Usage: make tags|cscope|gtags|etags [T=config]

example usage:
make cscope
make tags T=x86_64-native-linuxapp-gcc
make gtags T=arm64-armv8a-linuxapp-gcc

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Thomas Monjalon <thomas@monjalon.net>
7 years agodevtools: list stable commits without fixline
Yuanhan Liu [Fri, 28 Apr 2017 07:21:54 +0000 (15:21 +0800)]
devtools: list stable commits without fixline

Some commits for stable releases (with Cc stable tag) may not have the
fixline.
Thus, this patch makes git-log-fixes.sh script also list those stable
commits do not have fixline.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agodevtools: add git log checks for acronyms
Ferruh Yigit [Mon, 17 Apr 2017 13:13:36 +0000 (14:13 +0100)]
devtools: add git log checks for acronyms

CRC, LSC and VSI must be uppercased.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agousertools: add mempool PCI functional device
Guduri Prathyusha [Wed, 22 Mar 2017 14:11:32 +0000 (19:41 +0530)]
usertools: add mempool PCI functional device

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agousertools: add eventdev PCI functional device
Guduri Prathyusha [Wed, 22 Mar 2017 14:11:31 +0000 (19:41 +0530)]
usertools: add eventdev PCI functional device

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agousertools: define DPDK PCI functional device
Guduri Prathyusha [Wed, 22 Mar 2017 14:11:30 +0000 (19:41 +0530)]
usertools: define DPDK PCI functional device

This patch creates the framework to define the DPDK PCI functional
device by specifying the pci attributes like Vendor ID, Device ID,
Sub Vendor ID, Sub Device ID and Class.This enables a flexible way to
add DPDK function devices based on PCI attributes.

Crypto devices can belong to Encryption class(0x10) or Processor
class(0x0b) based on the vendor preference.

Using this framework, The above disparity can be encoded in the following
format

encryption_class = [{'Class': '10', 'Vendor': None,
                     'Device': None, 'SVendor': None, 'SDevice': None}]

intel_processor_class = [{'Class': '0b', 'Vendor': '8086', 'Device': None,
                    'SVendor': None, 'SDevice': None}]

crypto_devices = [encryption_class, intel_processor_class]

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agousertools: use optimized driver override scheme to bind
Guduri Prathyusha [Wed, 22 Mar 2017 14:11:29 +0000 (19:41 +0530)]
usertools: use optimized driver override scheme to bind

The current device bind model uses /sys/bus/pci/driver/new_id scheme to
bind devices to the driver. This scheme has following operations to bind
a device to the driver.
1) Write device ID and vendor ID to /sys/bus/pci/driver/new_id
2) Write PCI BDF number to /sys/bus/pci/driver/bind
3) On step (1), _All_ the devices that match the device ID and vendor ID
get bound to the driver
4) Except for requested devices, Unbind the remaining devices

In kernels >= 3.15, An alternative scheme driver_override can be used to
bind a device to driver.This scheme has following operations to bind a
device to driver.
1) Write driver to /sys/bus/pci/device/driver_override
2) Write PCI BDF number to /sys/bus/pci/driver/bind

This script detects the presence of /sys/bus/pci/device/driver_override,
if available use optimized bind scheme to bind it

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agousertools: optimize lspci invocation
Guduri Prathyusha [Wed, 22 Mar 2017 14:11:28 +0000 (19:41 +0530)]
usertools: optimize lspci invocation

lspci invoked twice over all the pci devices in the system.
The first pass is to extract Numeric IDs and second pass to get extended
device details.

As an optimization, Used lspci with -nn option in get_device_details()
to obtain Numeric ID and extended device details in one shot.

In addition to this, After binding the PCI device, lspci needs to be
invoked again to confirm the proper bind operation. Used a boolean
argument to express this case in get_pci_device_details()

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agousertools: refactor binding status
Guduri Prathyusha [Wed, 22 Mar 2017 14:11:27 +0000 (19:41 +0530)]
usertools: refactor binding status

Identified and parameterized the common code in show_status() function as
show_device_status().This will enable to avoid code duplication when
additional devices added to the script.

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agousertools: refactor NIC and crypto binding details
Guduri Prathyusha [Wed, 22 Mar 2017 14:11:26 +0000 (19:41 +0530)]
usertools: refactor NIC and crypto binding details

get_nic_details() and get_crypto_details() shares a lot of common code.
Created a new unified get_device_details() function get the device details.

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agousertools: use sysfs for CPU layout
Andriy Berestovskyy [Fri, 31 Mar 2017 12:21:00 +0000 (14:21 +0200)]
usertools: use sysfs for CPU layout

Some platforms do not have core/socket info in /proc/cpuinfo.
Use /sys/devices/system/cpu instead.

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
7 years agocrypto/dpaa2_sec: update license and copyright
Akhil Goyal [Fri, 21 Apr 2017 10:56:13 +0000 (16:26 +0530)]
crypto/dpaa2_sec: update license and copyright

license and copyright for hw and mc files are made consistent
as per the other dpaa2 dual licensed files.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agoethdev: fix typos in API comments
Olivier Matz [Mon, 24 Apr 2017 12:44:28 +0000 (14:44 +0200)]
ethdev: fix typos in API comments

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
7 years agoexamples/performance-thread: fix compilation on Suse 11 SP2
Bruce Richardson [Mon, 24 Apr 2017 13:04:22 +0000 (14:04 +0100)]
examples/performance-thread: fix compilation on Suse 11 SP2

Fixes following compilation error, using uint64_t type,
instead of int128_t unnecessarily:

In file included from ./common/lthread.c:82:0:
./common/lthread_timer.h: In function ‘_ns_to_clks’:
./common/lthread_timer.h:49:20: error: expected ‘=’, ‘,’, ‘;’,
 ‘asm’ or ‘__attribute__’ before ‘clkns’
compilation terminated due to -Wfatal-errors.

Fixes: 116819b9ed0d ("examples/performance-thread: add lthread subsystem")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agoexamples/performance-thread: use a single build dir
Bruce Richardson [Fri, 21 Apr 2017 13:50:24 +0000 (14:50 +0100)]
examples/performance-thread: use a single build dir

When building any of the perf-thread examples, the output .o files were
placed in two separate directories for each app: the regular build dir and
a "common" build directory. This was due to the way the files to be built
were specified, using a relative path. Switching to use VPATH to find the
files causes Make to put all .o's into the one build directory.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoexamples/performance-thread: fix build on FreeBSD
Bruce Richardson [Fri, 21 Apr 2017 13:50:23 +0000 (14:50 +0100)]
examples/performance-thread: fix build on FreeBSD

This set of sample apps did not compile on FreeBSD due to use of a number
of Linux/glibc-specific APIs, or APIs which existed in different headers
on FreeBSD. Specifically, the following APIs has problems:
  * sched_getcpu() is a glibc extension, so use rte_lcore_id() on BSD
  * pthread_yield() returns int on Linux, but void on FreeBSD, so
    we have to create two slightly different copies of the function.
  * the type for managing cpu sets is cpuset_t on FreeBSD rather than
    cpu_set_t as on Linux, so use rte_cpuset_t from rte_lcore.h.
  * APIs for managing cpu affinity are in pthread_np.h on FreeBSD, rather
    than in pthread.h, also fixed by including rte_lcore.h

Fixes: 433ba6228f9a ("examples/performance-thread: add pthread_shim app")
Fixes: d48415e1fee3 ("examples/performance-thread: add l3fwd-thread app")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoexamples: fix build clean on FreeBSD
Bruce Richardson [Fri, 21 Apr 2017 13:50:22 +0000 (14:50 +0100)]
examples: fix build clean on FreeBSD

The "examples_clean" top-level build target calls "make clean" for each
individual example. However, for a number of those which were linux-only
examples, the "if" condition only had a dummy "all" target i.e. no "clean"
target, causing an error with examples_clean.

Fixes: 3417cd687e5e ("examples: ignore linux apps on bsd")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agonet/ark: fix build on FreeBSD
Bruce Richardson [Fri, 21 Apr 2017 13:50:21 +0000 (14:50 +0100)]
net/ark: fix build on FreeBSD

On FreeBSD it's not necessary to use -ldl to link apps which use
dlopen. This error only showed up with a shared library gcc build,
not standard build using static libs.

Fixes: 1131cbf0fb2b ("net/ark: stub PMD for Atomic Rules Arkville")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John Miller <john.miller@atomicrules.com>
7 years agoapp/procinfo: fix description of --xstats-name option
Michal Jastrzebski [Fri, 21 Apr 2017 11:21:54 +0000 (13:21 +0200)]
app/procinfo: fix description of --xstats-name option

fix proc-info xstats-name description string

Fixes: 1223608adb9b ("app/proc-info: support xstats by ID")

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agodoc: fix flow validate comments
John Daley [Thu, 20 Apr 2017 18:49:33 +0000 (11:49 -0700)]
doc: fix flow validate comments

Change comments for rte_flow_validate() function to indicate that flow
rule collision and resource validation is optional for PMDs and
therefore the return codes may have different meanings.

Fixes: b1a4b4cbc0a8 ("ethdev: introduce generic flow API")

Signed-off-by: John Daley <johndale@cisco.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agoversion: 17.05-rc2
Thomas Monjalon [Fri, 21 Apr 2017 01:27:07 +0000 (03:27 +0200)]
version: 17.05-rc2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agodoc: fix typo in PVP howto
Maxime Coquelin [Fri, 7 Apr 2017 15:06:14 +0000 (17:06 +0200)]
doc: fix typo in PVP howto

This patch adds missing backslash in host's testpmd command
line.

Without it the command works, but a single core is used
instead of four, which might create confusion.

Fixes: 58a2551a160f ("doc: introduce PVP reference benchmark")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agoexamples/performance-thread: support C++
Hiroki Shirokura [Wed, 22 Mar 2017 02:26:23 +0000 (11:26 +0900)]
examples/performance-thread: support C++

Lthread is awesome but it doesn't support C++.
So I write patch to support lthread to support C++.
Added "extern C {}" to lthread-headers

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
7 years agoexamples/ethtool: disable promiscuous mode by default
Qi Zhang [Wed, 12 Apr 2017 19:58:19 +0000 (15:58 -0400)]
examples/ethtool: disable promiscuous mode by default

Disable promiscuous mode by default since VLAN filter
does not work when promiscuous mode is enabled.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
7 years agoexamples: limit max frame size
Andriy Berestovskyy [Mon, 10 Apr 2017 14:30:54 +0000 (16:30 +0200)]
examples: limit max frame size

Some PMDs do not support 9,5K jumbo frames, so the example fails.
Limit the frame size to the maximum supported by the underlying NIC.

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
7 years agoport: fix minor typo
Andriy Berestovskyy [Fri, 31 Mar 2017 13:36:36 +0000 (15:36 +0200)]
port: fix minor typo

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agoport: fix file descriptor reader
Andriy Berestovskyy [Fri, 31 Mar 2017 13:36:35 +0000 (15:36 +0200)]
port: fix file descriptor reader

The code should return the actual number of packets read.

Fixes: 5a99f208 ("port: support file descriptor")

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agoport: use mbuf alloc bulk instead of mempool
Andriy Berestovskyy [Fri, 31 Mar 2017 13:36:34 +0000 (15:36 +0200)]
port: use mbuf alloc bulk instead of mempool

Makes code a bit cleaner and type-aware.

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agoexamples/ip_pipeline: avoid panic if link up/down not supported
Andriy Berestovskyy [Fri, 31 Mar 2017 13:36:33 +0000 (15:36 +0200)]
examples/ip_pipeline: avoid panic if link up/down not supported

Some PMDs (mostly VFs) do not provide link up/down functionality.

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agoexamples/ip_pipeline: support more than 32 CPUs
Andriy Berestovskyy [Fri, 31 Mar 2017 13:36:32 +0000 (15:36 +0200)]
examples/ip_pipeline: support more than 32 CPUs

At the moment ip_pipeline example uses 32 during the initialization,
which leads to an error on systems with more than 32 CPUs.

Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agoexamples/ip_pipeline: fix port range filtering
Shyam Kumar Shrivastav [Wed, 22 Mar 2017 01:35:35 +0000 (21:35 -0400)]
examples/ip_pipeline: fix port range filtering

Firewall ACL definition need to use same input index for source and
destination ports as these are 16 bits and would fit in one ACL
field of 32 bits. This is required as per librte_acl API. Without this
UDP/TCP source and destination ports filtering (and for that
matter ICMP type/code filtering) does not work.

Signed-off-by: Shyam Kumar Shrivastav <shrivastav.shyam@gmail.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agotable: fix stats update
Aleksey Katargin [Sat, 11 Mar 2017 07:41:26 +0000 (12:41 +0500)]
table: fix stats update

Fixed stats double update.

Signed-off-by: Aleksey Katargin <gureedo@gmail.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agokni: fix possible memory leak
Ferruh Yigit [Tue, 18 Apr 2017 14:21:44 +0000 (15:21 +0100)]
kni: fix possible memory leak

alloc_q and rx_q fifos holds physical address of the mbufs, and not able
to free those mbufs explicitly.

But kernel thread reads from rx_q and puts used mbufs into free_q (with
their virtual addresses.) And kernel thread stopped when application
close the /dev/kni file on exit. So rx_q has time to be consumed by
kernel thread but leak is technically possible.

Another fifo, alloc_q has physical addresses too, but all those coming
from same mempool provided by application, when application quit, all
mempool already returned back, so this leak can be ignored.

Added check and wait logic for rx_q to be sure kernel consumed the fifo,
an error message printed after some ammount of wait, and an explicit
mempool free added for alloc_q.

Fixes: 8451269e6d7b ("kni: remove continuous memory restriction")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoapp/testpmd: enable NUMA support by default
Bruce Richardson [Fri, 24 Mar 2017 17:00:38 +0000 (17:00 +0000)]
app/testpmd: enable NUMA support by default

There is little reason for NUMA support in testpmd to be off by default, so
enable it, and add in a new commandline parameter to disable it, if that is
wanted by users.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoapp/testpmd: consolidate duplicate ifdefs into one
Rami Rosen [Mon, 17 Apr 2017 22:56:30 +0000 (18:56 -0400)]
app/testpmd: consolidate duplicate ifdefs into one

Cnsolidate the duplicate #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
into one #ifdef.

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
7 years agoapp/testpmd: fix duplicated metrics header include
Pascal Mazon [Tue, 11 Apr 2017 08:22:54 +0000 (10:22 +0200)]
app/testpmd: fix duplicated metrics header include

Fixes: 62d3216d6194 ("app/testpmd: add latency statistics calculation")

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agobitrate: fix integer roundoff
Remy Horton [Wed, 19 Apr 2017 13:26:48 +0000 (14:26 +0100)]
bitrate: fix integer roundoff

In the absence of traffic, it is possible for the bitrate moving average
to get stuck at a non-zero value, due to the calculated delta being less
than what an integer can represent.

Fixes: 2ad7ba9a6567 ("bitrate: add bitrate statistics library")

Signed-off-by: Remy Horton <remy.horton@intel.com>
7 years agodistributor: fix crash in flush
David Hunt [Fri, 14 Apr 2017 08:59:53 +0000 (09:59 +0100)]
distributor: fix crash in flush

Occasionally, the distributor single-packet-at-a-time mode will
segfault because it inadvertently calls some burst mode code when
flushing packets.

This patch ensures that only the v20 (single mode) codepath is used, and
returns without falling through to the burst mode code.

Fixes: 775003ad2f96 ("distributor: add new burst-capable library")

Signed-off-by: David Hunt <david.hunt@intel.com>
Tested-by: Yong Liu <yong.liu@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoapp/testpmd: request device removal interrupt
Gaetan Rivet [Tue, 18 Apr 2017 12:17:42 +0000 (14:17 +0200)]
app/testpmd: request device removal interrupt

Enable device removal event for PMD supporting it.
Add the --no-rmv-interrupt parameter to explicitly disable it.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Signed-off-by: Elad Persiko <eladpe@mellanox.com>
7 years agoapp/testpmd: request link status interrupt
Gaetan Rivet [Tue, 18 Apr 2017 12:17:41 +0000 (14:17 +0200)]
app/testpmd: request link status interrupt

For drivers supporting the LSC event, enable it.
This allows to test LSC event support.

Add the --no-lsc-interrupt parameter to explicitly disable the link status
change interrupt.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agoapp/testpmd: add generic event handler
Gaetan Rivet [Tue, 18 Apr 2017 12:17:40 +0000 (14:17 +0200)]
app/testpmd: add generic event handler

This is a rather simple handler that prints a message with the name of
the current event. It can be used to check PMD callback registration and
triggers.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agonet/mlx4: support device removal event
Gaetan Rivet [Tue, 18 Apr 2017 12:17:39 +0000 (14:17 +0200)]
net/mlx4: support device removal event

Extend the LSC event handling to support the device removal as well. The
Verbs library will send several related events, that can conflict
with the LSC event itself.

The event handling has thus been made capable of receiving and signaling
several event types at once.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Signed-off-by: Elad Persiko <eladpe@mellanox.com>
7 years agoethdev: introduce device removal event
Gaetan Rivet [Tue, 18 Apr 2017 12:17:38 +0000 (14:17 +0200)]
ethdev: introduce device removal event

This new API allows reacting to a device removal.
A device removal is the sudden disappearance of a device from its
bus.

PMDs implementing support for this notification guarantee that the removal
of the underlying device does not incur a risk to the application.

In particular, Rx/Tx bursts and all other functions can still be called
(albeit likely returning errors) without triggering a crash, irrespective
of an application handling this event.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Signed-off-by: Elad Persiko <eladpe@mellanox.com>
7 years agonet/ixgbe: support xstats by ID
Jacek Piasecki [Thu, 13 Apr 2017 14:59:28 +0000 (16:59 +0200)]
net/ixgbe: support xstats by ID

To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
ixgbe_dev_xstats_get_by_ids() which retrieve
values of statistics specified by ids array
and ixgbe_dev_xstats_get_names_by_ids() which retrieve
names of statistics specified by ids array.

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agonet/e1000: support xstats by ID
Jacek Piasecki [Thu, 13 Apr 2017 14:59:27 +0000 (16:59 +0200)]
net/e1000: support xstats by ID

To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
eth_igb_xstats_get_by_ids() which retrieve
values of statistics specified by ids array
and eth_igb_xstats_get_names_by_ids() which retrieve
names of statistics specified by ids array.

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/proc-info: support xstats by ID
Kuba Kozak [Thu, 13 Apr 2017 14:59:26 +0000 (16:59 +0200)]
app/proc-info: support xstats by ID

There is a new argument --xstats-ids and --xstats-name
in proc_info command line to retrieve statistics given by ids
and by name.
E.g. --xstats-ids="1,3,5,7,8"
E.g. --xstats-name rx_errors

ethdev: mark functions as deprecated

Functions rte_eth_xstats_get_all and rte_eth_xstats_get_names_all
are marked as deprecated

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoethdev: get xstats ID by name
Kuba Kozak [Thu, 13 Apr 2017 14:59:25 +0000 (16:59 +0200)]
ethdev: get xstats ID by name

Introduced new function: rte_eth_xstats_get_id_by_name
to retrieve xstats ids by its names.

doc: added release note

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoethdev: retrieve xstats by ID
Jacek Piasecki [Thu, 13 Apr 2017 14:59:24 +0000 (16:59 +0200)]
ethdev: retrieve xstats by ID

Extended xstats API in ethdev library to allow grouping of stats
logically so they can be retrieved per logical grouping  managed
by the application.
Changed existing functions rte_eth_xstats_get_names and
rte_eth_xstats_get to use a new list of arguments: array of ids
and array of values. ABI versioning mechanism was used to
support backward compatibility.
Introduced two new functions rte_eth_xstats_get_all and
rte_eth_xstats_get_names_all which keeps functionality of the
previous ones (respectively rte_eth_xstats_get and
rte_eth_xstats_get_names) but use new API inside.

test-pmd: add support for new xstats API retrieving by id in
testpmd application: xstats_get() and
xstats_get_names() call with modified parameters.

doc: add description for modified xstats API
Documentation change for modified extended statistics API functions.
The old API only allows retrieval of *all* of the NIC statistics
at once. Given this requires a MMIO read PCI transaction per statistic
it is an inefficient way of retrieving just a few key statistics.
Often a monitoring agent only has an interest in a few key statistics,
and the old API forces wasting CPU time and PCIe bandwidth in retrieving
*all* statistics; even those that the application didn't explicitly
show an interest in.
The new, more flexible API allow retrieval of statistics per ID.
If a PMD wishes, it can be implemented to read just the required
NIC registers. As a result, the monitoring application no longer wastes
PCIe bandwidth and CPU time.

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agotest/crypto: add DPAA2 crypto functional test
Akhil Goyal [Thu, 20 Apr 2017 05:44:27 +0000 (11:14 +0530)]
test/crypto: add DPAA2 crypto functional test

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agotest/crypto: add DPAA2 crypto performance test
Akhil Goyal [Thu, 20 Apr 2017 05:44:26 +0000 (11:14 +0530)]
test/crypto: add DPAA2 crypto performance test

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agodoc: add NXP DPAA2 SEC
Akhil Goyal [Thu, 20 Apr 2017 05:44:24 +0000 (11:14 +0530)]
doc: add NXP DPAA2 SEC

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agocrypto/dpaa2_sec: support statistics
Akhil Goyal [Thu, 20 Apr 2017 05:44:23 +0000 (11:14 +0530)]
crypto/dpaa2_sec: support statistics

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/dpaa2_sec: support crypto operation
Akhil Goyal [Thu, 20 Apr 2017 05:44:22 +0000 (11:14 +0530)]
crypto/dpaa2_sec: support crypto operation

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agobus/fslmc: add packet frame list entry definitions
Akhil Goyal [Thu, 20 Apr 2017 05:44:21 +0000 (11:14 +0530)]
bus/fslmc: add packet frame list entry definitions

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/dpaa2_sec: add sample descriptors
Akhil Goyal [Thu, 20 Apr 2017 05:44:20 +0000 (11:14 +0530)]
crypto/dpaa2_sec: add sample descriptors

algo.h provides APIs for constructing non-protocol offload SEC
descriptors like hmac, blkciphers etc.
ipsec.h provides APIs for IPSEC offload descriptors.
common.h is a common helper file which for all descriptors

In future, additional algorithms' descriptors(PDCP etc.) will be
added in the desc/

Signed-off-by: Horia Geanta Neag <horia.geanta@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/dpaa2_sec: add run-time assembler for descriptor
Akhil Goyal [Thu, 20 Apr 2017 05:44:19 +0000 (11:14 +0530)]
crypto/dpaa2_sec: add run-time assembler for descriptor

A set of header files(hw) which helps in making the descriptors
that are understood by NXP's SEC hardware.
This patch provides header files for command words which can be
used for descriptor formation.

Signed-off-by: Horia Geanta Neag <horia.geanta@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/dpaa2_sec: add basic operations
Akhil Goyal [Thu, 20 Apr 2017 05:44:18 +0000 (11:14 +0530)]
crypto/dpaa2_sec: add basic operations

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/dpaa2_sec: support mc dpseci object
Akhil Goyal [Thu, 20 Apr 2017 05:44:17 +0000 (11:14 +0530)]
crypto/dpaa2_sec: support mc dpseci object

add support for dpseci object in MC driver.
DPSECI represent a crypto object in DPAA2.

Signed-off-by: Cristian Sovaiala <cristian.sovaiala@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/dpaa2_sec: introduce poll mode driver
Akhil Goyal [Thu, 20 Apr 2017 05:44:16 +0000 (11:14 +0530)]
crypto/dpaa2_sec: introduce poll mode driver

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: add type for DPAA2
Akhil Goyal [Thu, 20 Apr 2017 05:44:15 +0000 (11:14 +0530)]
cryptodev: add type for DPAA2

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>