dpdk.git
5 years agonet/ice/base: save user provided PHY config
Leyi Rong [Wed, 19 Jun 2019 15:17:49 +0000 (23:17 +0800)]
net/ice/base: save user provided PHY config

After the transition from cable-unplug to cable-plug events, FW will
clear the set-phy-cfg data, sent by user. Thus, we will need to
cache these info.
1. The submitted data when set-phy-cfg is called. This info will be used
later to check if FW clears out the PHY info, requested by user.
2. The FC, FEC and LinkSpeed, requested by user. This info will be used
later, by device driver, to construct the new input data for the
set-phy-cfg AQ command.

Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: move RSS replay list
Leyi Rong [Wed, 19 Jun 2019 15:17:48 +0000 (23:17 +0800)]
net/ice/base: move RSS replay list

1. Move the RSS list pointer and lock from the VSI context to the ice_hw
structure. This is to ensure that the RSS configurations added to the
list prior to reset and maintained until the PF is unloaded. This will
ensure that the configuration list is unaffected by VFRs that would
destroy the VSI context. This will allow the replay of RSS entries for
VF VSI, as against current method of re-adding default configurations
and also eliminates the need to re-allocate the RSS list and lock post-VFR.
2. Align RSS flow functions to the new position of the RSS list and lock.
3. Adding bitmap for flow type status.

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@intel.com>
Signed-off-by: Henry Tieman <henry.w.tieman@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: rollback AVF RSS configurations
Leyi Rong [Wed, 19 Jun 2019 15:17:47 +0000 (23:17 +0800)]
net/ice/base: rollback AVF RSS configurations

Adding support to remove RSS configurations added
prior to failing case in AVF.

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: save queue bandwidth for replay after reset
Leyi Rong [Wed, 19 Jun 2019 15:17:46 +0000 (23:17 +0800)]
net/ice/base: save queue bandwidth for replay after reset

Added code to save the queue bandwidth information when it is applied
and it is replayed when queue is re-enabled again. Earlier saved value
is used for replay purpose.
Added vsi_handle, tc, and q_handle argument to the ice_cfg_q_bw_lmt,
ice_cfg_q_bw_dflt_lmt.

Signed-off-by: Tarun Singh <tarun.k.singh@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: support removing advanced rule
Leyi Rong [Wed, 19 Jun 2019 15:17:45 +0000 (23:17 +0800)]
net/ice/base: support removing advanced rule

This patch also contains ice_remove_adv_rule function to remove existing
advanced rules. It also handles the case when we have multiple VSI using
the same rule using the following helper functions:

ice_adv_rem_update_vsi_list - function to remove VS from VSI list for
advanced rules.

Signed-off-by: Shivanshu Shukla <shivanshu.shukla@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: replay advanced rule after reset
Leyi Rong [Wed, 19 Jun 2019 15:17:44 +0000 (23:17 +0800)]
net/ice/base: replay advanced rule after reset

Code added to replay the advanced rule per VSI basis and remove the
advanced rule information from shared code recipe list.

Signed-off-by: Victor Raj <victor.raj@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: support programming a new switch recipe
Leyi Rong [Wed, 19 Jun 2019 15:17:43 +0000 (23:17 +0800)]
net/ice/base: support programming a new switch recipe

1. Added an interface to support adding advanced switch rules.
2. Advanced rules are provided in a form of protocol headers and values
to match in addition to actions (limited actions are current supported).
3. Retrieve field vectors for ICE configuration package to determine
extracted fields and extracted locations for recipe creation.
4. Chain multiple recipes together to match multiple protocol headers.
5. Add structure to manage the dynamic recipes.

Signed-off-by: Grishma Kotecha <grishma.kotecha@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: add functions to create new switch recipe
Leyi Rong [Wed, 19 Jun 2019 15:17:42 +0000 (23:17 +0800)]
net/ice/base: add functions to create new switch recipe

Add functions to support following admin queue commands:
1. 0x0208: allocate resource to hold a switch recipe. This is needed
when a new switch recipe needs to be created.
2. 0x0290: create a recipe with protocol header information and
other details that determine how this recipe filter work.
3. 0x0292: get details of an existing recipe.
4. 0x0291: associate a switch recipe to a profile.

Signed-off-by: Grishma Kotecha <grishma.kotecha@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: add more recipe commands
Leyi Rong [Wed, 19 Jun 2019 15:17:41 +0000 (23:17 +0800)]
net/ice/base: add more recipe commands

Add the Add Recipe (0x0290), Recipe to Profile (0x0291), Get Recipe
(0x0292) and Get Recipe to Profile (0x0293) Commands.

Signed-off-by: Lev Faerman <lev.faerman@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: fix DCBx initialization
Leyi Rong [Wed, 19 Jun 2019 15:17:40 +0000 (23:17 +0800)]
net/ice/base: fix DCBx initialization

When a port is not cabled, but DCBx is enabled in the firmware, the
status of DCBx will be NOT_STARTED. This is a valid state for FW
enabled and should not be treated as a is_fw_lldp true automatically.

Add the code to treat NOT_STARTED as another valid state.

Fixes: 1082f786547e ("net/ice/base: support DCB")
Cc: stable@dpdk.org
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: add function to configure MIB
Leyi Rong [Wed, 19 Jun 2019 15:17:39 +0000 (23:17 +0800)]
net/ice/base: add function to configure MIB

Decouple ice_cfg_lldp_mib_change from the ice_init_dcb function call.

Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice/base: include DIR flag in extraction sequence
Leyi Rong [Wed, 19 Jun 2019 15:17:38 +0000 (23:17 +0800)]
net/ice/base: include DIR flag in extraction sequence

Once upon a time, the ice_flow_create_xtrct_seq() function in ice_flow.c
extracted only protocol fields explicitly specified by the caller of the
ice_flow_add_prof() function via its struct ice_flow_seg_info instances.

However, to support different ingress and egress flow profiles with the
same matching criteria, it would be necessary to also match on the
packet Direction metadata. The primary reason was because there could
not be more than one HW profile with the same CDID, PTG, and VSIG. The
Direction metadata was not a parameter used to select HW profile IDs.

Thus, for ACL, the direction flag would need to be added to the
extraction sequence. This information will be use later as one criteria
for ACL scenario entry matching.

Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agoeal: fix positive error codes from probe/remove
Ilya Maximets [Thu, 6 Jun 2019 10:02:28 +0000 (13:02 +0300)]
eal: fix positive error codes from probe/remove

According to API, 'rte_dev_probe()' and 'rte_dev_remove()' must
return 0 or negative error code. Bus code returns positive values
if device wasn't recognized by any driver, so the result of
'bus->plug/unplug()' must be converted. 'local_dev_probe()' and
'local_dev_remove()' also has their internal API, so the conversion
should be done there.

Positive on remove means that device not found by driver.
Positive on probe means that there are no suitable buses/drivers,
i.e. device is not supported.

Users of these API fixed to provide a good example by respecting
DPDK API. This also will allow to catch such issues in the future.

Fixes: a3ee360f4440 ("eal: add hotplug add/remove device")
Fixes: 244d5130719c ("eal: enable hotplug on multi-process")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoenforce experimental tag at beginning of declarations
David Marchand [Sat, 29 Jun 2019 11:58:53 +0000 (13:58 +0200)]
enforce experimental tag at beginning of declarations

Putting a '__attribute__((deprecated))' in the middle of a function
prototype does not result in the expected result with gcc (while clang
is fine with this syntax).

$ cat deprecated.c
void * __attribute__((deprecated)) incorrect() { return 0; }
__attribute__((deprecated)) void *correct(void) { return 0; }
int main(int argc, char *argv[]) { incorrect(); correct(); return 0; }
$ gcc -o deprecated.o -c deprecated.c
deprecated.c: In function ‘main’:
deprecated.c:3:1: warning: ‘correct’ is deprecated (declared at
deprecated.c:2) [-Wdeprecated-declarations]
 int main(int argc, char *argv[]) { incorrect(); correct(); return 0; }
 ^

Move the tag on a separate line and make it the first thing of function
prototypes.
This is not perfect but we will trust reviewers to catch the other not
so easy to detect patterns.

sed -i \
     -e '/^\([^#].*\)\?__rte_experimental */{' \
     -e 's//\1/; s/ *$//; i\' \
     -e __rte_experimental \
     -e '/^$/d}' \
     $(git grep -l __rte_experimental -- '*.h')

Special mention for rte_mbuf_data_addr_default():

There is either a bug or a (not yet understood) issue with gcc.
gcc won't drop this inline when unused and rte_mbuf_data_addr_default()
calls rte_mbuf_buf_addr() which itself is experimental.
This results in a build warning when not accepting experimental apis
from sources just including rte_mbuf.h.

For this specific case, we hide the call to rte_mbuf_buf_addr() under
the ALLOW_EXPERIMENTAL_API flag.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agoremove experimental tags from all symbol definitions
David Marchand [Sat, 29 Jun 2019 11:58:52 +0000 (13:58 +0200)]
remove experimental tags from all symbol definitions

We had some inconsistencies between functions prototypes and actual
definitions.
Let's avoid this by only adding the experimental tag to the prototypes.
Tests with gcc and clang show it is enough.

git grep -l __rte_experimental |grep \.c$ |while read file; do
sed -i -e '/^__rte_experimental$/d' $file;
sed -i -e 's/  *__rte_experimental//' $file;
sed -i -e 's/__rte_experimental  *//' $file;
done

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agotelemetry: add missing header include
David Marchand [Sat, 29 Jun 2019 11:58:51 +0000 (13:58 +0200)]
telemetry: add missing header include

Fixes: 1b756087db93 ("telemetry: add parser for client socket messages")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agomem: remove incorrect experimental tag on static symbol
David Marchand [Sat, 29 Jun 2019 11:58:50 +0000 (13:58 +0200)]
mem: remove incorrect experimental tag on static symbol

This function is not visible from outside this code unit.

Fixes: 84e7477e10b1 ("mem: add thread unsafe version for DMA mask check")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agonet/atlantic: add missing experimental API tags
David Marchand [Sat, 29 Jun 2019 11:58:49 +0000 (13:58 +0200)]
net/atlantic: add missing experimental API tags

Those symbols are declared in the library map but the prototypes are
missing the experimental tag.
Without it, existing users won't notice it is experimental.

Fixes: ec0dec44ecb9 ("net/atlantic: enable MACsec configuration")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agobuildtools: detect discrepancies for experimental symbols
David Marchand [Sat, 29 Jun 2019 11:58:48 +0000 (13:58 +0200)]
buildtools: detect discrepancies for experimental symbols

When promoting those symbols as stable, there is no check to ensure that
the final result is consistent.

Add a little script to get the symbols per section from the library map
files.
Validate that all experimental symbols in object files are referenced by
library map files.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agoraw/dpaa2_qdma: remove incorrect experimental tag
David Marchand [Sat, 29 Jun 2019 11:58:47 +0000 (13:58 +0200)]
raw/dpaa2_qdma: remove incorrect experimental tag

The incriminated commit promoted this symbol as stable but the
prototype still has the tag.

Fixes: fb1a20331d70 ("raw/dpaa2_qdma: remove experimental tag from APIs")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agovfio: remove incorrect experimental tag
David Marchand [Sat, 29 Jun 2019 11:58:46 +0000 (13:58 +0200)]
vfio: remove incorrect experimental tag

The incriminated commit promoted this symbol as stable but the
definition still has the tag.

Fixes: 787ae736a3d9 ("vfio: remove experimental tag")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agodevargs: remove incorrect experimental tags
David Marchand [Sat, 29 Jun 2019 11:58:45 +0000 (13:58 +0200)]
devargs: remove incorrect experimental tags

The incriminated commit promoted those symbols as stable but the
prototypes still have the tag.

Fixes: 73eca2f77f4c ("devargs: promote experimental API as stable")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agoeal: hide internal hotplug function
David Marchand [Sat, 29 Jun 2019 11:58:44 +0000 (13:58 +0200)]
eal: hide internal hotplug function

This API was experimental and not properly marked in the map file.
But looking more closely, this is just an internal wrapper for EAL init.
Hide it in the hotplug code.

Fixes: 244d5130719c ("eal: enable hotplug on multi-process")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agotest/rcu: fix test case
Honnappa Nagarahalli [Fri, 28 Jun 2019 18:43:42 +0000 (13:43 -0500)]
test/rcu: fix test case

Test case for rte_rcu_qsbr_get_memsize is written specifically
for 128 threads. Do not use RTE_MAX_LCORE as it changes for
different configurations.

Fixes: e6a14121f4ae ("test/rcu: remove arbitrary limit on max core count")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agotest/rcu: increase size of core numbers
Honnappa Nagarahalli [Fri, 28 Jun 2019 18:43:41 +0000 (13:43 -0500)]
test/rcu: increase size of core numbers

num_cores is of type uint8_t. This results in the following
compilation error.

test_rcu_qsbr_perf.c:649:16: error: comparison is always false
due to limited range of data type [-Werror=type-limits]
  if (num_cores >= RTE_MAX_LCORE) {
                ^~

RTE_MAX_LCORE is set to 256 for armv8 config.

Fixes: e6a14121f4ae ("test/rcu: remove arbitrary limit on max core count")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoexamples/l3fwd-power: fix build with gcc 4
Thomas Monjalon [Sat, 29 Jun 2019 08:45:50 +0000 (10:45 +0200)]
examples/l3fwd-power: fix build with gcc 4

error: ‘for’ loop initial declarations are only allowed in C99 mode

Fixes: 609e79841fcf ("examples/l3fwd-power: add telemetry mode")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoeal: use 32-bit RDSEED to allow 32-bit x86 usage
Mattias Rönnblom [Fri, 28 Jun 2019 21:08:46 +0000 (23:08 +0200)]
eal: use 32-bit RDSEED to allow 32-bit x86 usage

When seeding the pseudo-random number generator, replace the 64-bit
RDSEED with two 32-bit RDSEED instructions to allow building and
running on 32-bit x86.

Fixes: faf8fd252785 ("eal: improve entropy for initial PRNG seed")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
5 years agoeal: introduce random generator with upper bound
Mattias Rönnblom [Fri, 28 Jun 2019 09:01:23 +0000 (11:01 +0200)]
eal: introduce random generator with upper bound

Add a function rte_rand_max() which generates an uniformly distributed
pseudo-random number less than a user-specified upper bound.

The commonly used pattern rte_rand() % SOME_VALUE creates biased
results (as in some values in the range are more frequently occurring
than others) if SOME_VALUE is not a power of 2.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoeal: improve entropy for initial PRNG seed
Mattias Rönnblom [Fri, 28 Jun 2019 09:01:22 +0000 (11:01 +0200)]
eal: improve entropy for initial PRNG seed

Replace the use of rte_get_timer_cycles() with getentropy() for
seeding the pseudo-random number generator. getentropy() provides a
more truly random value.

getentropy() requires glibc 2.25 and Linux kernel 3.17. In case
getentropy() is not found at compile time, or the relevant syscall
fails in runtime, the rdseed machine instruction will be used as a
fallback.

rdseed is only available on x86 (Broadwell or later). In case it is
not present, rte_get_timer_cycles() will be used as a second fallback.

On non-Meson builds, getentropy() will not be used.

Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoeal: replace libc-based random generation with LFSR
Mattias Rönnblom [Fri, 28 Jun 2019 09:01:20 +0000 (11:01 +0200)]
eal: replace libc-based random generation with LFSR

This commit replaces rte_rand()'s use of lrand48() with a DPDK-native
combined Linear Feedback Shift Register (LFSR) (also known as
Tausworthe) pseudo-random number generator.

This generator is faster and produces better-quality random numbers
than the linear congruential generator (LCG) of lib's lrand48(). The
implementation, as opposed to lrand48(), is multi-thread safe in
regards to concurrent rte_rand() calls from different lcore threads.
A LCG is still used, but only to seed the five per-lcore LFSR
sequences.

In addition, this patch also addresses the issue of the legacy
implementation only producing 62 bits of pseudo randomness, while the
API requires all 64 bits to be random.

This pseudo-random number generator is not cryptographically secure -
just like lrand48().

Bugzilla ID: 114
Bugzilla ID: 276

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/l3fwd-power: add telemetry mode
Reshma Pattan [Mon, 24 Jun 2019 16:45:51 +0000 (17:45 +0100)]
examples/l3fwd-power: add telemetry mode

Add new telemetry mode support for l3fwd-power.
This is a standalone mode, in this mode l3fwd-power
does simple l3fwding along with calculating
empty polls, full polls, and busy percentage for
each forwarding core. The aggregation of these
values of all cores is reported as application
level telemetry to metric library for every 500ms from the
master core.

The busy percentage is calculated by recording the poll_count
and when the count reaches a defined value the total
cycles it took is measured and compared with minimum and maximum
reference cycles and busy rate is set according to either 0% or
50% or 100%.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agotelemetry: fix build
Ferruh Yigit [Thu, 27 Jun 2019 19:51:44 +0000 (20:51 +0100)]
telemetry: fix build

Build error:
../lib/librte_telemetry/rte_telemetry.c:558:28:
  error: comparison of unsigned expression < 0 is always false
  [-Werror,-Wtautological-compare]

Build error not observed in default make build because telemetry library
disabled by default but easier to reproduce via meson.

Fixing by converting unsigned variables to signed.

Fixes: 0fe3a37924d4 ("telemetry: format json response when sending stats")
Fixes: 4080e46c8078 ("telemetry: support global metrics")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
5 years agobpf: fix check array size
Konstantin Ananyev [Fri, 21 Jun 2019 14:26:49 +0000 (15:26 +0100)]
bpf: fix check array size

Array ins_chk in lib/librte_bpf/bpf_validate.c has 255 entries.
So the instruction with opcode == 255 will reading beyond array
boundaries.
For more details please refer to:
https://bugs.dpdk.org/show_bug.cgi?id=283

Fixes: 6e12ec4c4d6d ("bpf: add more checks")
Cc: stable@dpdk.org
Reported-by: Michel Machado <michel@digirati.com.br>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agobus/vmbus: skip non-network devices
Stephen Hemminger [Thu, 6 Jun 2019 00:37:46 +0000 (17:37 -0700)]
bus/vmbus: skip non-network devices

The vmbus scan code can just skip non-network devices.
More importantly, this fixes the bug where some vmbus devices
don't have all the attributes (like monitor_id) and a single
failure would cause the scan to break the loop.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
5 years agotest: skip tests when missing requirements
David Marchand [Sat, 15 Jun 2019 06:42:30 +0000 (08:42 +0200)]
test: skip tests when missing requirements

Let's mark as skipped the tests when they are missing some requirements
like a number of used cores or specific hardware availability, like
compress, crypto or eventdev devices.

Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agotest: do not start tests in parallel
David Marchand [Sat, 15 Jun 2019 06:42:29 +0000 (08:42 +0200)]
test: do not start tests in parallel

Running the tests in parallel has two drawbacks:
- the tests are racing on the hugepages allocations,
- the tests are sharing the cores to run their checks which results in
  undeterministic execution time,

This results in random failures.
For better reproducibility in CI, start them all in a serialised way.

Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agotest: split into shorter subtests
David Marchand [Sat, 15 Jun 2019 06:42:28 +0000 (08:42 +0200)]
test: split into shorter subtests

Based on Michael initial idea of separating the file-prefix subtest in
the eal flags test.

Let's split the biggest tests into their subparts.
It is then easier to have them fit in the 10s timeout we have configured
in Travis.
We also get a better idea of which part fails in the previously big tests
we had.

Those new subtests are called from the meson testsuite.
The autotest tool is left untouched.

Note: we still have an issue with test_hash_readwrite_lf.c, any help from
the original authors would be appreciated.

Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agotest/eal: check number of cores before running subtests
Michael Santana [Sat, 15 Jun 2019 06:42:27 +0000 (08:42 +0200)]
test/eal: check number of cores before running subtests

The eal flags unit test assumes that a certain number of cores are
available (4 and 8 cores), however this may not always be the case.
Individual developers may run the unit test on their local desktop
which typically have 2 to 4 cores, in said case the test is bound
to fail for lacking 4 or 8 cores.

Additionally, as we push forward introducing CI into DPDK we are limited
to the hardware specification of CI services (e.g. Travis CI) that only
have 2 cores on their servers, in which case the test would fail.

To fix this we check available cores before running a subtest. This
applies to subtests that are dedicated to test that the -l and --lcore
flags work correctly. If not enough cores are available the subtest is
simply skipped, otherwise the subtest is run.

Signed-off-by: Michael Santana <msantana@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agotest/eal: set core mask/list config only in dedicated test
David Marchand [Sat, 15 Jun 2019 06:42:26 +0000 (08:42 +0200)]
test/eal: set core mask/list config only in dedicated test

Setting a coremask was mandatory a long time ago but has been optional
for a while.
The checks on PCI whitelist/blacklist, vdev, memory rank, memory channel,
HPET, memory size and other miscs options have no requirement wrt cores.

Let's remove those coremasks so that we only care about it in the
dedicated checks.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agotest/eal: set memory channel config only in dedicated test
David Marchand [Sat, 15 Jun 2019 06:42:25 +0000 (08:42 +0200)]
test/eal: set memory channel config only in dedicated test

The -n option is an optimisation configuration option that defaults to 0.
Such a default value makes the mempool library distributes objects as if
there was 4 memory channels, so -n 4 is the same as the default behavior.

This parameter was mandatory a long time ago, but has been optional for
a while. We check that setting this value works fine in its own test.
Remove it everywhere else.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agotest/stack: fix lock-free test name
David Marchand [Sat, 15 Jun 2019 06:42:24 +0000 (08:42 +0200)]
test/stack: fix lock-free test name

Fixes: 0420378bbfc4 ("test/stack: check lock-free implementation")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agotest/rcu: remove arbitrary limit on max core count
David Marchand [Sat, 15 Jun 2019 06:42:23 +0000 (08:42 +0200)]
test/rcu: remove arbitrary limit on max core count

We can have up to RTE_MAX_LCORE in a dpdk application.
Remove the limit on 128 cores and tests that are now always false.

Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agotest/latency: fix stack smashing
David Marchand [Sat, 15 Jun 2019 06:42:22 +0000 (08:42 +0200)]
test/latency: fix stack smashing

Caught in one Travis run:
 + ------------------------------------------------------- +
 + Test Suite : Latency Stats Unit Test Suite
 + ------------------------------------------------------- +
 + TestCase [ 0] : test_latency_init succeeded
 + TestCase [ 1] : test_latency_update succeeded
[snip]
 + TestCase [1601724781] : test_latencystats_get_names succeeded
[snip]
 + Tests Failed :      1601790830

htonl(1601724781) -> "m", "a", "x", "_"
htonl(1601790830) -> "n", "c", "y", "_"

Looks like someone went too far.

The test passes a bigger size than the array it passes along.

Fixes: 1e3676a06e4c ("test/latency: add unit tests for latencystats library")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agotest/hash: clean remaining trace of scaling autotest
David Marchand [Sat, 15 Jun 2019 06:42:21 +0000 (08:42 +0200)]
test/hash: clean remaining trace of scaling autotest

Fixes: 3c518ca41ffa ("test/hash: remove hash scaling unit test")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agotest/hash: rectify slave id to point to valid cores
Dharmik Thakkar [Sat, 15 Jun 2019 06:42:20 +0000 (08:42 +0200)]
test/hash: rectify slave id to point to valid cores

This patch rectifies slave_id to point to valid core indexes rather than
core ranks in read-write lock-free concurrency test.

It also replaces a 'for' loop with RTE_LCORE_FOREACH API.

Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency")
Cc: stable@dpdk.org
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
5 years agotest/hash: fix off-by-one check on core count
David Marchand [Sat, 15 Jun 2019 06:42:19 +0000 (08:42 +0200)]
test/hash: fix off-by-one check on core count

This subtest wants to start rwc_core_cnt[n] reader threads, while the
master core is waiting for them to report.

Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
5 years agotest/eventdev: move tests to the driver specific list
David Marchand [Sat, 15 Jun 2019 06:42:18 +0000 (08:42 +0200)]
test/eventdev: move tests to the driver specific list

Same treatment than crypto tests, move the eventdev drivers tests in the
driver list.

While at it:
- eventdev_octeontx_autotest has been renamed as
  eventdev_selftest_octeontx,
- eventdev_sw_autotest has been renamed as
  eventdev_selftest_sw,

Fixes: 50fb749a3972 ("event/octeontx: move test to driver")
Fixes: 85fb515b7318 ("event/sw: move test to driver")
Fixes: 123d67c73b06 ("test/event: register selftests")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agotest/crypto: move tests to the driver specific list
David Marchand [Sat, 15 Jun 2019 06:42:17 +0000 (08:42 +0200)]
test/crypto: move tests to the driver specific list

For consistency, put all specific crypto driver tests in the dedicated
list (in alphabetic order).

While at it:
- remove dead reference to cryptodev_sw_mrvl_autotest (renamed as
  cryptodev_sw_mvsam_autotest),
- call the crypto scheduler test only when built,

Fixes: 9eabcb682493 ("test: update autotest list")
Fixes: 3d20ffe6ddb1 ("test: reorder test cases in meson")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agotest/bonding: add missing sources for link bonding RSS
David Marchand [Sat, 15 Jun 2019 06:42:16 +0000 (08:42 +0200)]
test/bonding: add missing sources for link bonding RSS

Fixes: 3d20ffe6ddb1 ("test: reorder test cases in meson")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agoip_frag: fix IPv6 fragment size calculation
Konstantin Ananyev [Thu, 6 Jun 2019 11:33:28 +0000 (12:33 +0100)]
ip_frag: fix IPv6 fragment size calculation

Take into account IPv6 fragment extension header when
calculating data size for each fragment.

Fixes: 7a838c8798a9 ("ip_frag: fix IPv6 when MTU sizes not aligned to 8 bytes")
Fixes: 0aa31d7a5929 ("ip_frag: add IPv6 fragmentation support")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agostack: fix sign of list length
Phil Yang [Mon, 17 Jun 2019 07:41:30 +0000 (15:41 +0800)]
stack: fix sign of list length

clang raise 'pointer-sign' warnings in __atomic_compare_exchange
when passing 'uint64_t *' to parameter of type 'int64_t *' converts
between pointers to integer types with different sign.

Fixes: 7e6e609939a8 ("stack: add C11 atomic implementation")
Cc: stable@dpdk.org
Suggested-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Gage Eads <gage.eads@intel.com>
5 years agokernel/linux: fix modules install path
Igor Ryzhov [Tue, 11 Jun 2019 08:49:34 +0000 (11:49 +0300)]
kernel/linux: fix modules install path

Currently kernel modules are installed into /usr/src instead of
/lib/modules when meson build system is used. This patch fixes that.

Cc: stable@dpdk.org
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agokernel/freebsd: fix module build on latest head
Bruce Richardson [Thu, 6 Jun 2019 15:40:16 +0000 (16:40 +0100)]
kernel/freebsd: fix module build on latest head

Internal changes in the freebsd kernel have meant that additional includes
are now necessary to build the kernel modules for DPDK. Tested with latest
bsd HEAD revision.

Bugzilla ID: 282
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoeal/linux: fix return after alarm registration failure
Thomas Monjalon [Wed, 26 Jun 2019 10:12:00 +0000 (12:12 +0200)]
eal/linux: fix return after alarm registration failure

When adding an alarm, if an error happen when registering
the common alarm callback, it is not considered as a major failure.
The alarm is then inserted in the list.
However it was returning an error code after inserting the alarm.

The error code is not set anymore to be consistent with the behaviour.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agoeal: correct log for alarm error
Xiaolong Ye [Wed, 5 Jun 2019 07:18:29 +0000 (15:18 +0800)]
eal: correct log for alarm error

Fixes: af75078fece3 ("first public release")
Fixes: 764bf26873b9 ("add FreeBSD support")
Cc: stable@dpdk.org
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agomempool/octeontx2: fix build with icc
Stephen Hemminger [Wed, 26 Jun 2019 23:07:42 +0000 (16:07 -0700)]
mempool/octeontx2: fix build with icc

The Intel compiler is pickier about casts and generates:
otx2_mempool_ops.c(344):
     error #191: type qualifier is meaningless on cast type
   int64_t * const addr = (int64_t * const)
                           ^
This is because of the nature of const.
In this example, the expression is being cast into a pointer
that can not be modified. This is meaningless because the
expression is already a lvalue.

See https://en.wikipedia.org/wiki/Const_(computer_programming)

Fixes: d7a0da3c0043 ("mempool/octeontx2: add fast path mempool ops")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoeal: do not panic on shared memory init
Arnon Warshavsky [Mon, 10 Jun 2019 07:08:29 +0000 (10:08 +0300)]
eal: do not panic on shared memory init

This patch changes some void functions to return a value,
so that the init sequence may tear down orderly
instead of calling panic.

Signed-off-by: Arnon Warshavsky <arnon@qwilt.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agobuild: enable BSD features visibility for FreeBSD
Marcin Smoczynski [Tue, 14 May 2019 14:04:16 +0000 (16:04 +0200)]
build: enable BSD features visibility for FreeBSD

When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE macro
explicitly in its build recipe, it restricts visibility of a non POSIX
features subset, such as IANA protocol numbers (IPPROTO_* macros).
Non standard features are enabled by default for DPDK both for Linux
thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE. However
using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
__BSD_VISIBLE to be defined to 0 for FreeBSD, causing different feature
sets visibility for Linux and FreeBSD. It restricts from using IPPROTO
macros in public headers, such as rte_ip.h, despite the fact they are
already widely used in sources.

Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
which enforces feature sets visibility unification between Linux and
FreeBSD.

Add single -D_GNU_SOURCE to config/meson.build as a project argument
instead of adding separate directive for each project subtree.

This patch solves the problem of build breaks for [1] on FreeBSD [2]
following the discussion [3].

[1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
[2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
[3] https://mails.dpdk.org/archives/dev/2019-May/132110.html

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agonet/bnx2x: fix icc build
Rasesh Mody [Tue, 25 Jun 2019 23:11:00 +0000 (16:11 -0700)]
net/bnx2x: fix icc build

Fix a compilation issue seen with icc 19

Signed-off-by: Rasesh Mody <rmody@marvell.com>
5 years agomaintainers: claim maintainership of net-mrvl sub-tree
Jerin Jacob [Tue, 25 Jun 2019 05:42:41 +0000 (11:12 +0530)]
maintainers: claim maintainership of net-mrvl sub-tree

Claim the maintainership of the sub tree dpdk-next-net-mrvl,
which covers all the Marvell network PMDs.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodoc: add Marvell OCTEON TX2 mempool guide
Jerin Jacob [Sat, 22 Jun 2019 13:24:17 +0000 (18:54 +0530)]
doc: add Marvell OCTEON TX2 mempool guide

Add Marvell OCTEON TX2 mempool documentation.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agomempool/octeontx2: add devargs for max pool selection
Jerin Jacob [Sat, 22 Jun 2019 13:24:16 +0000 (18:54 +0530)]
mempool/octeontx2: add devargs for max pool selection

The maximum number of mempools per application needs to be configured
on HW during mempool driver initialization. HW can support up to 1M
mempools, Since each mempool costs set of HW resources, the max_pools
devargs parameter is being introduced to configure the number of
mempools required for the application.
For example:

-w 0002:02:00.0,max_pools=512

With the above configuration, the driver will set up only 512 mempools
for the given application to save HW resources.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Harman Kalra <hkalra@marvell.com>
5 years agomempool/octeontx2: add optimized dequeue operation for arm64
Pavan Nikhilesh [Sat, 22 Jun 2019 13:24:15 +0000 (18:54 +0530)]
mempool/octeontx2: add optimized dequeue operation for arm64

This patch adds an optimized arm64 instruction based routine to leverage
CPU pipeline characteristics of octeontx2. The theme is to fill the
pipeline with CASP operations as much HW can do so that HW can do alloc()
HW ops in full throttle.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agomempool/octeontx2: add fast path mempool ops
Jerin Jacob [Sat, 22 Jun 2019 13:24:14 +0000 (18:54 +0530)]
mempool/octeontx2: add fast path mempool ops

Add enqueue and dequeue mempool fastpath operations.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agomempool/octeontx2: add remaining slow path ops
Jerin Jacob [Sat, 22 Jun 2019 13:24:13 +0000 (18:54 +0530)]
mempool/octeontx2: add remaining slow path ops

Add remaining get_count(), calc_mem_size() and populate() slow path
mempool operations.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agomempool/octeontx2: add mempool free op
Jerin Jacob [Sat, 22 Jun 2019 13:24:12 +0000 (18:54 +0530)]
mempool/octeontx2: add mempool free op

The DPDK mempool free operation frees HW AURA
and POOL reserved in alloc operation. In addition to that it free all
the memory resources allocated in mempool alloc operations.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
5 years agomempool/octeontx2: add mempool alloc op
Jerin Jacob [Sat, 22 Jun 2019 13:24:11 +0000 (18:54 +0530)]
mempool/octeontx2: add mempool alloc op

The DPDK mempool allocation reserves a single HW AURA
and POOL in 1:1 map mode. Upon reservation, SW programs the slow path
operations such as allocate stack memory for DMA and
bunch HW configurations to respective HW blocks.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
5 years agomempool/octeontx2: add context dump support
Jerin Jacob [Sat, 22 Jun 2019 13:24:10 +0000 (18:54 +0530)]
mempool/octeontx2: add context dump support

Add a helper function to dump aura and pool context for NPA debugging.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
5 years agomempool/octeontx2: add NPA IRQ handler
Jerin Jacob [Sat, 22 Jun 2019 13:24:09 +0000 (18:54 +0530)]
mempool/octeontx2: add NPA IRQ handler

Register and implement NPA IRQ handler for RAS and all type of
error interrupts to get the fatal errors from HW.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Harman Kalra <hkalra@marvell.com>
5 years agomempool/octeontx2: add NPA HW operations
Jerin Jacob [Sat, 22 Jun 2019 13:24:08 +0000 (18:54 +0530)]
mempool/octeontx2: add NPA HW operations

Implement the low-level NPA HW operations such as
alloc, free memory, etc.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
5 years agodrivers: add init and fini on octeontx2 NPA object
Jerin Jacob [Sat, 22 Jun 2019 13:24:07 +0000 (18:54 +0530)]
drivers: add init and fini on octeontx2 NPA object

NPA object needs to initialize memory for queue interrupts context,
pool resource management, etc. This patch adds support for initializing
and finalizing the NPA object.

This patch also updates the otx2_npa_lf definition to meet the init/fini
requirements.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agomempool/octeontx2: add build infra and device probe
Jerin Jacob [Sat, 22 Jun 2019 13:24:06 +0000 (18:54 +0530)]
mempool/octeontx2: add build infra and device probe

Add the make and meson based build infrastructure along
with the mempool(NPA) device probe.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agodoc: add Marvell OCTEON TX2 platform guide
Jerin Jacob [Sat, 22 Jun 2019 13:24:05 +0000 (18:54 +0530)]
doc: add Marvell OCTEON TX2 platform guide

Platform specific guide for Marvell OCTEON TX2 SoC is added.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shally Verma <shallyv@marvell.com>
Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
5 years agocommon/octeontx2: add FLR IRQ handler
Nithin Dabilpuram [Sat, 22 Jun 2019 13:24:04 +0000 (18:54 +0530)]
common/octeontx2: add FLR IRQ handler

Upon receiving FLR request from VF, It is PF responsibly
forward to AF and enable FLR for VFs.

This patch adds support for VF FLR support in PF.

This patch also add otx2_dev_active_vfs() API to find
the number of active VF for given PF.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Harman Kalra <hkalra@marvell.com>
5 years agocommon/octeontx2: add uplink message support
Nithin Dabilpuram [Sat, 22 Jun 2019 13:24:03 +0000 (18:54 +0530)]
common/octeontx2: add uplink message support

The events like PHY link status change by AF or PHY configuration
change by PF would call for the uplink message.
The AF initiated uplink would land it in PF and PF would further
forward to VF(if it is intended for that specific VF)

The PF initiated uplink would be distributed to all active VFs.
This patch adds support for the same.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Harman Kalra <hkalra@marvell.com>
5 years agocommon/octeontx2: add VF mailbox IRQ and msg handler
Jerin Jacob [Sat, 22 Jun 2019 13:24:02 +0000 (18:54 +0530)]
common/octeontx2: add VF mailbox IRQ and msg handler

This patch adds support for PF <-> VF mailbox interrupt
mailbox message interrupt handling.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
5 years agocommon/octeontx2: add PF to VF mailbox IRQ and msg handlers
Nithin Dabilpuram [Sat, 22 Jun 2019 13:24:01 +0000 (18:54 +0530)]
common/octeontx2: add PF to VF mailbox IRQ and msg handlers

PF has additional responsibility being server for VF messages
and forward to AF and once AF process it then forward
the response back to VF.
otx2_vf_pf_mbox_irq() will process the VF mailbox request and
af_pf_wait_msg() will until getting a response back from AF.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
5 years agocommon/octeontx2: add AF to PF mailbox IRQ and msg handlers
Nithin Dabilpuram [Sat, 22 Jun 2019 13:24:00 +0000 (18:54 +0530)]
common/octeontx2: add AF to PF mailbox IRQ and msg handlers

This patch adds support for AF to PF mailbox interrupt and message
handling. PF writes the message on mapped mailbox region
followed by writing the mailbox doorbell register. Upon receiving,
the mailbox request in AF(In Linux kernel), It processes the messages
and update the counter memory and update the AF mbox doorbell
register. That would trigger a VFIO interrupt to userspace and
otx2_process_msgs() will handle it.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agocommon/octeontx2: handle intra device operations
Jerin Jacob [Sat, 22 Jun 2019 13:23:59 +0000 (18:53 +0530)]
common/octeontx2: handle intra device operations

The mempool device(NPA) may be provisioned as a standalone device or
it can be part of ethdev/eventdev device. In order to address
mempool as standalone or integrated with ethdev/eventdev device,
An intra device structure being introduced.

When the _first_ ethdev/eventdev PCIe device or standalone mempool(NPA)
devices get probed by the eal PCI subsystem,
The NPA object(struct otx2_npa_lf) stored in otx2_dev base class.
Once it is accomplished, the other consumer drivers like
ethdev driver or eventdev driver use otx2_npa_* API to operate on
shared NPA object.

The similar concept followed for SSO object, Which needs to share between
PCIe devices.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agocommon/octeontx2: introduce irq handling functions
Jerin Jacob [Sat, 22 Jun 2019 13:23:58 +0000 (18:53 +0530)]
common/octeontx2: introduce irq handling functions

All PCIe drivers(ethdev, mempool, cryptodev and eventdev) in octeontx2,
needs to handle interrupt for mailbox and error handling.
Create a helper function over rte interrupt API to register,
unregister, disable interrupts.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
5 years agocommon/octeontx2: introduce common device class
Jerin Jacob [Sat, 22 Jun 2019 13:23:57 +0000 (18:53 +0530)]
common/octeontx2: introduce common device class

Introduce otx2_dev class to hold octeontx2 PCIe device specific
information and operations.

All PCIe drivers(ethdev, mempool, cryptodev and eventdev) in octeontx2,
inherits this base object to avail the common functionalities such
as mailbox creation, interrupt registration, etc of the PCIe device.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agocommon/octeontx2: add mailbox send and receive support
Jerin Jacob [Sat, 22 Jun 2019 13:23:56 +0000 (18:53 +0530)]
common/octeontx2: add mailbox send and receive support

Each RVU device has a dedicated 64KB mailbox region
shared with its peer for communication. RVU AF has
a separate mailbox region shared with each of RVU PFs
and an RVU PF has a separate region shared with each of
it's VF.

This patch add use 64KB memory and implemented mailbox
send and receive support.

These set of APIs are used by this driver (RVU AF) and
other RVU PF/VF drivers eg ethdev, cryptodev e.t.c.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agocommon/octeontx2: add runtime log infra
Jerin Jacob [Sat, 22 Jun 2019 13:23:55 +0000 (18:53 +0530)]
common/octeontx2: add runtime log infra

Various consumers of this common code need runtime
logging infrastructure. This patch adds the same.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
5 years agocommon/octeontx2: add mailbox base support infra
Jerin Jacob [Sat, 22 Jun 2019 13:23:54 +0000 (18:53 +0530)]
common/octeontx2: add mailbox base support infra

This patch adds mailbox init and fini support.
Each RVU device has a dedicated 64KB mailbox region
shared with its peer for communication. RVU AF has
a separate mailbox region shared with each of RVU PFs
and an RVU PF has a separate region shared with
each of it's VF.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agocommon/octeontx2: add mbox request and response definition
Jerin Jacob [Sat, 22 Jun 2019 13:23:53 +0000 (18:53 +0530)]
common/octeontx2: add mbox request and response definition

The admin function driver sits in Linux kernel as mailbox
server. The DPDK AF mailbox client, send the message to mailbox
server to complete the administrative task such as get mac
address.

This patch adds mailbox request and response definition of
existing mailbox defined between AF driver and DPDK driver.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Signed-off-by: Zyta Szpak <zyta@marvell.com>
5 years agocommon/octeontx2: add IO handling APIs
Jerin Jacob [Sat, 22 Jun 2019 13:23:52 +0000 (18:53 +0530)]
common/octeontx2: add IO handling APIs

Various octeontx2 drivers use IO handling API, added octeontx2
specific IO handling routines in the common code.

Since some of those implementations are based on arm64 instructions
added the stub to compile the code on non arm64 ISA.
The non arm64 ISA stub is possible due to the fact that
it is an integrated controller i.e runs only on Marvell HW.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agocommon/octeontx2: add build infrastructure and HW definition
Jerin Jacob [Sat, 22 Jun 2019 13:23:51 +0000 (18:53 +0530)]
common/octeontx2: add build infrastructure and HW definition

Add the make and meson based build infrastructure along with
HW definition header file.

This patch adds skeleton otx2_mbox.c file to make sure
all header files are intact, subsequent patches add content
to otx2_mbox.c

This patch also updates CONFIG_RTE_MAX_VFIO_GROUPS
value to 128 as the system can have up to 128 PFs/VFs.
For octeontx2 meson build target, CONFIG_RTE_MAX_VFIO_GROUPS
defined as 128 so no additional changes required.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agotelemetry: support global metrics
Reshma Pattan [Tue, 18 Jun 2019 13:49:17 +0000 (14:49 +0100)]
telemetry: support global metrics

telemetry has support for fetching port based stats
from metrics library.

Metrics library also has global stats which are
not fetched by telemetry, so extend telemetry to
fetch the global metrics.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
5 years agomaintainers: update dpdk-next-net-intel
Qi Zhang [Wed, 19 Jun 2019 08:24:12 +0000 (16:24 +0800)]
maintainers: update dpdk-next-net-intel

Xiaolong Ye will replace Beilei Xing as co-maintainer of
dpdk-next-net-intel.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/qede: fix warnings from invalid assert
Stephen Hemminger [Wed, 19 Jun 2019 18:22:17 +0000 (11:22 -0700)]
net/qede: fix warnings from invalid assert

This driver had a bogus assert which could never happen.
This triggers "expression is always false warnings" with some
compilers which causes build failure.
Just remove it.

Fixes: 2af14ca79c0a ("net/qede: support 100G")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Rasesh Mody <rmody@marvell.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
5 years agonet/bnx2x: fix warnings from invalid assert
Stephen Hemminger [Wed, 19 Jun 2019 18:22:16 +0000 (11:22 -0700)]
net/bnx2x: fix warnings from invalid assert

This driver had a bogus assert which could never happen.
This triggers "expression is always false warnings" with some
compilers which causes build failure.
Just remove it.

Fixes: 6041aa619f9a ("net/bnx2x: fix poll link status")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Rasesh Mody <rmody@marvell.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
5 years agovhost/crypto: fix inferred misuse of enum
Fan Zhang [Wed, 15 May 2019 16:09:11 +0000 (17:09 +0100)]
vhost/crypto: fix inferred misuse of enum

This patch fixes the inferred misuse of enum of crypto algorithms.

Coverity issue: 325879
Fixes: e80a98708166 ("vhost/crypto: add session message handler")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost/crypto: fix logically dead code
Fan Zhang [Wed, 15 May 2019 16:19:48 +0000 (17:19 +0100)]
vhost/crypto: fix logically dead code

This patch fixes a few same class bugs that causes the
logically dead code in vhost_crypto.

Coverity issue: 277236, 277233, 277220, 277214
Fixes: 3bb595ecd682 ("vhost/crypto: add request handler")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agoexamples/vhost_crypto: remove unused function
Fan Zhang [Wed, 15 May 2019 16:25:48 +0000 (17:25 +0100)]
examples/vhost_crypto: remove unused function

This patch tries to fix the coverity issue of unchecked
return value. Since the function that causes the problem
is unused, it is removed completely.

Coverity issue: 336816
Fixes: f5188211c721 ("examples/vhost_crypto: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: fix missing include
Noa Ezra [Thu, 20 Jun 2019 05:44:41 +0000 (05:44 +0000)]
vhost: fix missing include

Add a missing include with the defines for vhost-user driver features.

Fixes: 5fbb3941da9f ("vhost: introduce driver features related APIs")
Cc: stable@dpdk.org
Signed-off-by: Noa Ezra <noae@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Matan Azrad <matan@mellanox.com>
5 years agonet/virtio: fix packets check in mergeable packed Rx
Tiwei Bie [Thu, 20 Jun 2019 02:34:36 +0000 (10:34 +0800)]
net/virtio: fix packets check in mergeable packed Rx

We should check the descriptor state instead of vq's internal
free count (i.e. the number of descriptors that we haven't made
available) for the remaining mergeable packets.

Fixes: a76290c8f1cf ("net/virtio: implement Rx path for packed queues")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: fix memory leak in mergeable packed Rx
Tiwei Bie [Thu, 20 Jun 2019 02:34:35 +0000 (10:34 +0800)]
net/virtio: fix memory leak in mergeable packed Rx

When there is no enough segments for a packet in mergeable
packed Rx path, we should free the whole mbuf chain instead
of just recycling the last segment.

Fixes: a76290c8f1cf ("net/virtio: implement Rx path for packed queues")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: fix memory leak in mergeable Rx
Tiwei Bie [Thu, 20 Jun 2019 02:34:34 +0000 (10:34 +0800)]
net/virtio: fix memory leak in mergeable Rx

When there is no enough segments for a packet in mergeable
Rx path, we should free the whole mbuf chain instead of just
recycling the last segment.

Fixes: bcac5aa207f8 ("net/virtio: improve batching in mergeable path")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: fix memory leak in in-order Rx
Tiwei Bie [Thu, 20 Jun 2019 02:34:33 +0000 (10:34 +0800)]
net/virtio: fix memory leak in in-order Rx

When there is no enough segments for a packet in in-order
mergeable Rx path, we should free the whole mbuf chain instead
of just recycling the last segment.

Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: move VLAN tag insertion to Tx prepare
Dilshod Urazov [Mon, 17 Jun 2019 11:31:38 +0000 (12:31 +0100)]
net/virtio: move VLAN tag insertion to Tx prepare

VLAN tag insertion should be in Tx prepare, not in Tx burst functions.
One of Tx prepare goals is to be able to do preparations in advance
(possibly on different CPU core) and then transmit it fast.
Also Tx prepare can report that a packet does not pass Tx offloads
check. E.g. has no enough headroom to insert VLAN header.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>