dpdk.git
5 years agocommon/cpt: fix null auth only
Anoob Joseph [Wed, 13 Feb 2019 09:22:50 +0000 (09:22 +0000)]
common/cpt: fix null auth only

Fixes: 351fbee21986 ("common/cpt: support hash")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
5 years agonet/ixgbe: support VF promiscuous by PF driver
Wei Zhao [Fri, 8 Mar 2019 02:46:17 +0000 (10:46 +0800)]
net/ixgbe: support VF promiscuous by PF driver

The patch adds the PF counterpart changes to support VF promiscuous
mode by DPDK PF driver.

For ixgbe, in order to support VF VLAN promiscuous or unicast
promiscuous, PF need to set register PFVML2FLT of bit UPE and VPE.
The patch aligned to kernel driver's implementation.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbevf: enable promiscuous mode
Wei Zhao [Fri, 8 Mar 2019 02:46:16 +0000 (10:46 +0800)]
net/ixgbevf: enable promiscuous mode

Add promiscuous mode support on VF

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
5 years agonet/mlx5: fix sync when handling Tx completions
Dekel Peled [Thu, 28 Feb 2019 15:20:30 +0000 (17:20 +0200)]
net/mlx5: fix sync when handling Tx completions

Function mlx5_tx_complete() reads completion entry information
from Tx queue.
For some processors not having strongly-ordered memory model,
there has to be a memory barrier between reading the entry index
and the entry fields, in order to guarantee data is valid.

Fixes: 54d3fe948dba ("net/mlx5: poll completion queue once per a call")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix hex dump of error completion
Dekel Peled [Thu, 28 Feb 2019 15:18:45 +0000 (17:18 +0200)]
net/mlx5: fix hex dump of error completion

struct mlx5_cqe is defined in MLX5 PMD code (mlx5_prm.h).
It includes 64 bytes padding in case of (RTE_CACHE_LINE_SIZE == 128).

struct mlx5_err_cqe is defined in kernel, and doesn't include padding.

When running in debug mode, in case an error CQE is detected
it is printed using rte_hexdump().

The size of data to print should be sizeof(*cqe) instead of
sizeof(*err_cqe), to handle the case of (RTE_CACHE_LINE_SIZE == 128),
and print the full data in any case.

Fixes: c7714992092f ("net/mlx5: extend debug logs verbosity")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: call generic strlcpy
Thomas Monjalon [Sun, 24 Feb 2019 22:42:40 +0000 (23:42 +0100)]
net/mlx5: call generic strlcpy

The call to strlcpy uses either libc, libbsd or internal rte_strlcpy.
No need to call the DPDK flavor explicitly.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: fix default flow rule create
Dekel Peled [Sun, 24 Feb 2019 09:41:09 +0000 (11:41 +0200)]
net/mlx4: fix default flow rule create

Original patch changed logic of function mlx4_flow_merge_eth().
The setting of flow->promisc was wrongly removed.
This patch adds the removed setting of flow->promisc, to restore
the required behavior.

Fixes: c0d239263156 ("net/mlx4: support flow w/o ETH spec and with VLAN")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: fix flow priorities probing error path
Viacheslav Ovsiienko [Thu, 21 Feb 2019 09:02:16 +0000 (09:02 +0000)]
net/mlx5: fix flow priorities probing error path

The mlx5 PMD probes the Verbs flow priorities supported with
ibv_create_flow() function. If rdma-core or kernel fails for
some reason, the returned error causes the drop queue is not
destroyed, and pd is locked by not freed resource.

Also the mlx5_flow_discover_priorities() returned negative value
as error, and this code was reported "as is", without sign
changing (eventually causing assert(err > 0)).

Fixes: 2815702baea7 ("net/mlx5: replace verbs priorities by flow")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/i40e: fix negative check on unsigned queue pairs
Kevin Traynor [Tue, 5 Mar 2019 16:30:38 +0000 (16:30 +0000)]
net/i40e: fix negative check on unsigned queue pairs

Fix the check and associated log. Also, fix a typo in other log.

Fixes: 03d478e9609d ("net/i40e: support PF respond VF request more queues")
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbe: fix crash on remove
Yunjian Wang [Wed, 13 Feb 2019 02:48:52 +0000 (10:48 +0800)]
net/ixgbe: fix crash on remove

The NIC's interrupt source has some active handler when the
port removed. We should cancel the delay handler before removing
dev to prevent executing the delay handler.

Call Trace:
  #0  ixgbe_disable_intr (hw=0x0, hw=0x0)
      at /usr/src/debug/dpdk-18.11/drivers/net/ixgbe/ixgbe_ethdev.c:852
  #1  ixgbe_dev_interrupt_delayed_handler (param=0xadb9c0
      <rte_eth_devices@@DPDK_2.2+33024>)
      at /usr/src/debug/dpdk-18.11/drivers/net/ixgbe/ixgbe_ethdev.c:4386
  #2  0x00007f05782147af in eal_alarm_callback (arg=<optimized out>)
      at /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/
      eal_alarm.c:90
  #3  0x00007f057821320a in eal_intr_process_interrupts (nfds=1,
      events=0x7f056cbf3e88) at /usr/src/debug/dpdk-18.11/lib/
      librte_eal/linuxapp/eal/eal_interrupts.c:838
  #4  eal_intr_handle_interrupts (totalfds=<optimized out>, pfd=18)
      at /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/
      eal_interrupts.c:885
  #5  eal_intr_thread_main (arg=<optimized out>)
      at /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/
      eal_interrupts.c:965
  #6  0x00007f05708a0e45 in start_thread () from /usr/lib64/libpthread.so.0
  #7  0x00007f056eb4ab5d in clone () from /usr/lib64/libc.so.6

Fixes: 2866c5f1b87e ("ixgbe: support port hotplug")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agodoc: fix tag for inner RSS feature
Rami Rosen [Fri, 1 Mar 2019 11:10:10 +0000 (13:10 +0200)]
doc: fix tag for inner RSS feature

This patch fixes a wrong tag in guides/nics/features.rst.
The features tags should be, according to the
"Features Overview" section in this doc, one of the following:
"uses", "implements", "provides", or "related".
Hence in Inner RSS section, it should be "uses"
instead of "users".

Fixes: d0a87d9aa8de ("doc: update mlx5 guide on tunnel offloading")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/enic: fix inner packet matching
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:51 +0000 (02:42 -0800)]
net/enic: fix inner packet matching

Inner packet matching is currently buggy in many cases.

1. Mishandling null spec ("match any").
The copy_item functions do nothing if spec is null. This is incorrect,
as all patterns should be appended to the L5 pattern buffer even for
null spec (treated as all zeros).

2. Accessing null spec causing segfault.

3. Not setting protocol fields.
The NIC filter API currently has no flags for "match inner IPv4, IPv6,
UDP, TCP, and so on". So, the driver needs to explicitly set EtherType
and IP protocol fields in the L5 pattern buffer to avoid false
positives (e.g. reporting IPv6 as IPv4).

Instead of keep adding "if inner, do something differently" cases to
the existing copy_item functions, introduce separate functions for
inner packet patterns and address the above issues in those
functions. The changes to the previous outer-packet copy_item
functions are mechanical, due to reduced indentation.

Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: fix endianness in VLAN match
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:50 +0000 (02:42 -0800)]
net/enic: fix endianness in VLAN match

The VLAN fields in the NIC filter use little endian. The VLAN item is
in big endian, so swap bytes.

Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: fix VXLAN match
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:49 +0000 (02:42 -0800)]
net/enic: fix VXLAN match

The filter API does not have flags for "match VXLAN". Explicitly set
the UDP destination port and mask in the L4 pattern. Otherwise, UDP
packets with non-VXLAN ports may be falsely reported as VXLAN.

1400 series VIC adapters have hardware VXLAN parsing. The L5 buffer on
the NIC starts with the inner Ethernet header, and the VXLAN header is
now in the L4 buffer following the UDP header. So the VXLAN spec/mask
needs to be in the L4 pattern, not L5. Older models still expect the
VXLAN spec/mask in the L5 pattern. Fix up the L4/L5 patterns
accordingly.

Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: reset VXLAN port regardless of overlay offload
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:48 +0000 (02:42 -0800)]
net/enic: reset VXLAN port regardless of overlay offload

Currently, the driver resets the vxlan port register only if overlay
offload is enabled. But, the register is actually tied to hardware
vxlan parsing, which is an independent feature and is always enabled
even if overlay offload is disabled. If left uninitialized, it can
affect flow rules that match vxlan. So always reset the port number
when HW vxlan parsing is available.

Fixes: 8a4efd17410c ("net/enic: add handlers to add/delete vxlan port number")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: enable limited support for raw flow item
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:47 +0000 (02:42 -0800)]
net/enic: enable limited support for raw flow item

Some apps like VPP use a raw item to match UDP tunnel headers like
VXLAN or GENEVE. The NIC hardware supports such usage via L5 match,
which does pattern match on packet data immediately following the
outer L4 header. Accept raw items for these limited use cases.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: move arguments into struct
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:46 +0000 (02:42 -0800)]
net/enic: move arguments into struct

There are many copy_item functions, all with the same arguments, which
makes it difficult to add/change arguments. Move the arguments into a
struct to help subsequent commits that will add/fix features. Also
remove self-explanatory verbose comments for these local functions.

These changes are purely mechanical and have no impact on
functionalities.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: enable limited passthru flow action
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:45 +0000 (02:42 -0800)]
net/enic: enable limited passthru flow action

Some apps like VPP use PASSTHRU+MARK flow rules to offload packet
matching to the NIC. Just like MARK+RSS used by OVS-DPDK and others,
PASSTHRU+MARK is used to "mark and then receive normally". Recent VIC
adapters support such flow rules, so enable PASSTHRU for this limited
use case.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: enable limited RSS flow action
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:44 +0000 (02:42 -0800)]
net/enic: enable limited RSS flow action

Some apps like OVS-DPDK use MARK+RSS flow rules in order to offload
packet matching to the NIC. The RSS action in such flow rules simply
indicates "receive packet normally", not trying to override the port
wide RSS. The action is included in the flow rules simply to terminate
them, as MARK is not a fate-deciding action. And, the RSS action has a
most basic config: default hash, level, types, null key, and identity
queue mapping.

Recent VIC adapters can support these "mark and receive" flow
rules. So, enable support for RSS action for this limited use case.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agonet/enic: check for unsupported flow item types
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:43 +0000 (02:42 -0800)]
net/enic: check for unsupported flow item types

Currently a pattern with an unsupported item type causes segfault,
because the flow handler is using the type as an array index without
checking bounds. Add an explicit check for unsupported item types and
avoid out-of-bound accesses.

Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agonet/enic: allow flow mark ID 0
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:42 +0000 (02:42 -0800)]
net/enic: allow flow mark ID 0

The driver currently accepts mark ID 0 but does not report it in
matching packet's mbuf. For example, the following testpmd command
succeeds. But, the mbuf of a matching IPv4 UDP packet does not have
PKT_RX_FDIR_ID set.

flow create 0 ingress pattern ... actions mark id 0 / queue index 0 / end

The problem has to do with mapping mark IDs (32-bit) to NIC filter
IDs. Filter ID is currently 16-bit, so values greater than 0xffff are
rejected. The firmware reserves filter ID 0 for filters that do not
mark (e.g. steer w/o mark). And, the driver reserves 0xffff for the
flag action. This leaves 1...0xfffe for app use.

It is possible to simply reject mark ID 0 as unsupported. But, 0 is
commonly used (e.g. OVS-DPDK and VPP). So, when adding a filter, set
filter ID = mark ID + 1 to support mark ID 0. The receive handler
subtracts 1 from filter ID to get back the original mark ID.

Fixes: dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agonet/enic: fix SCTP match for flow API
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:41 +0000 (02:42 -0800)]
net/enic: fix SCTP match for flow API

The driver needs to explicitly set the protocol number (132) in the IP
header pattern, as the current firmware filter API lacks "match SCTP
packet" flag. Otherwise, the resulting NIC filter may lead to false
positives (i.e. NIC reporting non-SCTP packets as SCTP packets). The
flow director handler does the same (enic_clsf.c).

Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agonet/enic: fix flow director SCTP matching
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:40 +0000 (02:42 -0800)]
net/enic: fix flow director SCTP matching

The firmware filter API does not have flags indicating "match SCTP
packet". Instead, the driver needs to explicitly add an IP match and
set the protocol number (132 for SCTP) in the IP header.

The existing code (copy_fltr_v2) has two bugs.

1. It sets the protocol number (132) in the match value, but not the
mask. The mask remains 0, so the match becomes a wildcard match. The
NIC ends up matching all protocol numbers (i.e. thinks non-SCTP
packets are SCTP).

2. It modifies the input argument (rte_eth_fdir_input). The driver
tracks filters using rte_hash_{add,del}_key(input). So, addding
(RTE_ETH_FILTER_ADD) and deleting (RTE_ETH_FILTER_DELETE) must use the
same input argument for the same filter. But, overwriting the protocol
number while adding the filter breaks this assumption, and causes
delete operation to fail.

So, set the mask as well as protocol value. Do not modify the input
argument, and use const in function signatures to make the intention
clear. Also move a couple function declarations to enic_clsf.c from
enic.h as they are strictly local.

Fixes: dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agonet/enic: remove unused functions
Hyong Youb Kim [Sat, 2 Mar 2019 10:42:39 +0000 (02:42 -0800)]
net/enic: remove unused functions

Remove unused functions. Specifically, vnic_set_rss_key() is
obsolete. enic_{add,del}_vlan() has never been supported in the
firmware. And, remove vnic_rss.c altogether as it becomes empty. These
were discovered by cppcheck.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agoeal: fix core list validation with disabled cores
David Marchand [Wed, 13 Feb 2019 20:06:59 +0000 (21:06 +0100)]
eal: fix core list validation with disabled cores

-l and -c options are two ways to select the cores used by DPDK.
Their format differs, but the checks on the selected cores are the same.
Use an intermediate array to separate the specific parsing checks from
the common consistency checks.
The parsing functions now concentrate on validating the passed string
and do nothing more.

We can report all invalid core indexes rather than only the first error.
In the error log message, reporting [0, cfg->lcore_count - 1] as a valid
range is then wrong when the core list is not continuous.

Example on my 8 cpus laptop with core 2 and 6 disabled.
echo 0 > /sys/devices/system/cpu/cpu2/online
echo 0 > /sys/devices/system/cpu/cpu6/online

Before:
./master/app/testpmd -l 0-7 --no-huge -m 512 -- --total-num-mbufs 2048
EAL: Detected 6 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: invalid core list, please check core numbers are in [0, 5] range
...

After:
./master/app/testpmd -l 0-7 --no-huge -m 512 -- --total-num-mbufs 2048
EAL: Detected 6 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: lcore 2 unavailable
EAL: lcore 6 unavailable
EAL: invalid core list, please check specified cores are part of 0-1,3-5,7
...

Fixes: d888cb8b9613 ("eal: add core list input format")
Fixes: b38693b612b4 ("eal: fix core number validation")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: remove dead code in core list parsing
David Marchand [Wed, 13 Feb 2019 20:06:58 +0000 (21:06 +0100)]
eal: remove dead code in core list parsing

We don't need to look for trailing spaces.
This is a copy/paste block from eal_parse_coremask().
Remove it and the associated comment.

Fixes: d888cb8b9613 ("eal: add core list input format")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: restrict control threads to startup CPU affinity
David Marchand [Tue, 19 Feb 2019 20:41:11 +0000 (21:41 +0100)]
eal: restrict control threads to startup CPU affinity

Spawning the ctrl threads on anything that is not part of the eal
coremask is not that polite to the rest of the system, especially
when you took good care to pin your processes on cpu resources with
tools like taskset (linux) / cpuset (freebsd).

Rather than introduce yet another eal options to control on which cpu
those ctrl threads are created, let's take the startup cpu affinity
as a reference and remove the eal coremask from it.
If no cpu is left, then we default to the master core.

The cpuset is computed once at init before the original cpu affinity
is lost.

Introduced a RTE_CPU_AND macro to abstract the differences between linux
and freebsd respective macros.

Examples in a 4 cores FreeBSD vm:

$ ./build/app/testpmd -l 2,3 --no-huge --no-pci -m 512 \
 -- -i --total-num-mbufs=2048

$ procstat -S 1057
  PID    TID COMM                TDNAME              CPU CSID CPU MASK
 1057 100131 testpmd             -                     2    1 2
 1057 100140 testpmd             eal-intr-thread       1    1 0-1
 1057 100141 testpmd             rte_mp_handle         1    1 0-1
 1057 100142 testpmd             lcore-slave-3         3    1 3

$ cpuset -l 1,2,3 ./build/app/testpmd -l 2,3 --no-huge --no-pci -m 512 \
 -- -i --total-num-mbufs=2048

$ procstat -S 1061
  PID    TID COMM                TDNAME              CPU CSID CPU MASK
 1061 100131 testpmd             -                     2    2 2
 1061 100144 testpmd             eal-intr-thread       1    2 1
 1061 100145 testpmd             rte_mp_handle         1    2 1
 1061 100147 testpmd             lcore-slave-3         3    2 3

$ cpuset -l 2,3 ./build/app/testpmd -l 2,3 --no-huge --no-pci -m 512 \
 -- -i --total-num-mbufs=2048

$ procstat -S 1065
  PID    TID COMM                TDNAME              CPU CSID CPU MASK
 1065 100131 testpmd             -                     2    2 2
 1065 100148 testpmd             eal-intr-thread       2    2 2
 1065 100149 testpmd             rte_mp_handle         2    2 2
 1065 100150 testpmd             lcore-slave-3         3    2 3

Fixes: d651ee4919cd ("eal: set affinity for control threads")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
5 years agoeal: fix control threads pinnning
David Marchand [Tue, 19 Feb 2019 20:41:10 +0000 (21:41 +0100)]
eal: fix control threads pinnning

pthread_setaffinity_np returns a >0 value on error.
We could end up letting the ctrl threads on the current process cpu
affinity.

Fixes: d651ee4919cd ("eal: set affinity for control threads")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
5 years agoeal: fix check when retrieving current CPU affinity
David Marchand [Tue, 19 Feb 2019 20:38:13 +0000 (21:38 +0100)]
eal: fix check when retrieving current CPU affinity

pthread_getaffinity_np returns a >0 value when failing.

This is mainly for the sake of correctness.
The only case where it could fail is when passing an incorrect cpuset
size wrt to the kernel.

Fixes: 2eba8d21f3c9 ("eal: restrict cores auto detection")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agobus/vdev: fix hotplug twice
Raslan Darawsheh [Thu, 21 Feb 2019 19:01:25 +0000 (20:01 +0100)]
bus/vdev: fix hotplug twice

In case vdev was already probed, it shouldn't be probed again,
and it should return -EEXIST as error.
There are some checks in vdev_probe() and insert_vdev(),
but a check was missing in vdev_plug().
The check is moved in vdev_probe_all_drivers() which is called
in all code paths.

Fixes: e9d159c3d534 ("eal: allow probing a device again")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agobus/vdev: fix debug message on probing
Thomas Monjalon [Thu, 21 Feb 2019 19:01:24 +0000 (20:01 +0100)]
bus/vdev: fix debug message on probing

The log was printing the device name two times,
first one being supposed to be the driver name.
As we don't know yet the driver name, the log is simplified.

Fixes: 9bf4901d1a11 ("bus/vdev: remove probe with driver name option")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agomk: fix AVX512 disabled warning on non x86
Jerin Jacob [Sun, 24 Feb 2019 18:27:10 +0000 (18:27 +0000)]
mk: fix AVX512 disabled warning on non x86

AVX512 is a x86 specific feature, So, enable AVX512
warning only on x86.

Fixes: a32ca9a4ebc1 ("mk: fix scope of disabling AVX512F support")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: fix PCI whitelist typo in prog guide
Thomas Monjalon [Sun, 24 Feb 2019 22:32:59 +0000 (23:32 +0100)]
doc: fix PCI whitelist typo in prog guide

The placeholder for PCI address should be named DBDF
which stands for Domain/Bus/Device/Function.

Fixes: 33af337773ac ("ethdev: add common devargs parser")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agodoc: fix link in Linux getting started guide
Rami Rosen [Fri, 1 Mar 2019 11:50:13 +0000 (13:50 +0200)]
doc: fix link in Linux getting started guide

This patch fixes a wrong link in gsg. The
Documentation/kernel-parameters.txt file from the kernel
source tree was moved quite a time ago to
Documentation/admin-guide/kernel-parameters.txt.

Fixes: 1ab07743b21b ("doc: getting started guide for linux")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoexamples/ethtool: fix two typos
Rami Rosen [Mon, 25 Feb 2019 19:21:37 +0000 (21:21 +0200)]
examples/ethtool: fix two typos

This patch fixes 2 typos in examples/ethtool:

There is no such thing as ethtool_ops::get_driverinfo
It should be get_drvinfo:
see include/linux/ethtool.h in the kernel tree.

rte_net_change_mtu should be ndo_change_mtu:
see include/linux/netdevice.h in the kernel tree.

Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Remy Horton <remy.horton@intel.com>
5 years agodoc: remove reference to rte.doc.mk in programmers guide
Rami Rosen [Mon, 25 Feb 2019 15:37:03 +0000 (17:37 +0200)]
doc: remove reference to rte.doc.mk in programmers guide

This patch removes the reference to rte.doc.mk in
DPDK programmers guide.

Fixes: ee801f6cc7b8 ("mk: clean dead doc rules")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodevtools: fix index generation
Ferruh Yigit [Mon, 4 Mar 2019 11:04:19 +0000 (11:04 +0000)]
devtools: fix index generation

build-tags.sh is broken because of removed 'test' folder, this breaks
helper make targets like 'make cscope', 'make tags', etc...

Fixing it by removing 'test' from source directories list.

Fixes: a9de470cc7c0 ("test: move to app directory")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agodevtools: fix result of svg include check
Michael Santana [Mon, 4 Mar 2019 19:07:16 +0000 (14:07 -0500)]
devtools: fix result of svg include check

Fix trivial bug. In sh shell, 'foo = 1' is not the same as
'foo=1'. Using 'foo = 1' makes the shell attempt to interpret foo
as a command, rather than a simple variable assignment.

Fixes: dafc04c15174 ("devtools: fix return of forbidden addition checks")
Cc: stable@dpdk.org
Signed-off-by: Michael Santana <msantana@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agodevtools: enable codespell in checkpatch
Michael Santana [Mon, 4 Mar 2019 19:07:15 +0000 (14:07 -0500)]
devtools: enable codespell in checkpatch

Enable codespell by default.
codespell is a feature by checkpatch.pl that
checks for common spelling mistakes in patches.

This feature is disabled by default. To enable it one must add
the '--codespell' flag to the $options variable in
checkpatches.sh. With this change codespell is enabled by default.
The user can decide to turn off codespell from a one of the config
files read by checkpatches.sh.

Signed-off-by: Michael Santana <msantana@redhat.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodrivers/net: fix shifting 32-bit signed variable 31 times
Andrius Sirvys [Tue, 19 Feb 2019 13:24:50 +0000 (13:24 +0000)]
drivers/net: fix shifting 32-bit signed variable 31 times

Shifting signed 32-bit values by 31-bits has the potential for
unexpected  outcomes as compiler can overwrite a bit.
Specified that values are unsigned.

Errors are observed from running cppcheck.

Bugzilla ID: 58
Fixes: 69e209be5464 ("net/axgbe: add register map and related macros")
Fixes: b5bf7719221d ("bnx2x: driver support routines")
Fixes: ed2ced6fe927 ("net/bnxt: check initialization before accessing stats")
Fixes: 6fda3f0ddda9 ("net/cxgbe: add API to program hardware MPS table")
Fixes: bdb244b96920 ("e1000: whitespace changes")
Fixes: 5a32a257f957 ("e1000: more NICs in base driver")
Fixes: 2fe669f4bcd2 ("net/nfp: support MAC address change")
Fixes: defb9a5dd156 ("nfp: introduce driver initialization")
Fixes: ec94dbc57362 ("qede: add base driver")
Fixes: d2e7d931d0ad ("net/qede/base: formatting changes")
Fixes: cdc07e83bb24 ("net/tap: add eBPF program file")
Cc: stable@dpdk.org
Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/softnic: fix possible buffer overflow
Pallantla Poornima [Mon, 4 Feb 2019 07:23:48 +0000 (07:23 +0000)]
net/softnic: fix possible buffer overflow

sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used.

Fixes: daabf2fb949b ("net/softnic: map flow action to table action")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ixgbe: support loopback for X540/X550
Julien Meunier [Wed, 20 Feb 2019 21:05:30 +0000 (23:05 +0200)]
net/ixgbe: support loopback for X540/X550

Loopback mode is also supported on X540 and X550 NICs, according to
their datasheet (section 15.2). The way to set it up is a little
different of the 82599.

Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
5 years agonet/ixgbe: do not start on unsupported loopback mode
Julien Meunier [Wed, 20 Feb 2019 21:05:29 +0000 (23:05 +0200)]
net/ixgbe: do not start on unsupported loopback mode

Only TX->RX loopback is supported currently on 82599EB. If a user wants
to apply an another loopback configuration (!= IXGBE_LPBK_82599_TX_RX),
ixgbe PMD ignores it and continues the configuration without raising
any error.

Let's increase robustness of this part by checking if the requested
loopback mode is correct for the current device, before starting it.
If it is not valid, PMD will refuse to start.

Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
5 years agonet/sfc: do not use PMD log type
Stephen Hemminger [Wed, 27 Feb 2019 16:08:03 +0000 (16:08 +0000)]
net/sfc: do not use PMD log type

The sfc driver was still using RTE_LOGTYPE_PMD which was superseded
by local logging.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoeal: remove legacy PMD log macro
Stephen Hemminger [Tue, 26 Feb 2019 21:34:23 +0000 (13:34 -0800)]
eal: remove legacy PMD log macro

The RTE_PMD_DEBUG_TRACE was only enabled for EVENTDEV_DEBUG and
that configuration is now handled by RTE_EDEV_LOG macros.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoeventdev: use same log macro for all unsupported calls
Stephen Hemminger [Tue, 26 Feb 2019 21:34:22 +0000 (13:34 -0800)]
eventdev: use same log macro for all unsupported calls

The driver already has RTE_EDEV_XXX log macros so use
them in two more places.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agocrypto/virtio: use local log type
Stephen Hemminger [Tue, 26 Feb 2019 21:34:21 +0000 (13:34 -0800)]
crypto/virtio: use local log type

The virtio crypto driver was using PMD log type and it should
be using the local log type.

Fixes: 25500d4b8076 ("crypto/virtio: support device init")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoeal: drop unused macros for primary process check
Stephen Hemminger [Tue, 26 Feb 2019 21:34:20 +0000 (13:34 -0800)]
eal: drop unused macros for primary process check

No usage in current DPDK code base.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/pdump: remove only created vdevs
Gage Eads [Tue, 26 Feb 2019 16:04:37 +0000 (10:04 -0600)]
app/pdump: remove only created vdevs

This commit fixes a bug in which a unidirectional pdump could attempt to
remove devices it didn't create.

Fixes: 35cb223ab7be ("app/pdump: fix vdev cleanup")
Cc: stable@dpdk.org
Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
5 years agovhost: remove vhost-net requirements from generic APIs
Darek Stojaczyk [Sun, 24 Feb 2019 23:35:55 +0000 (00:35 +0100)]
vhost: remove vhost-net requirements from generic APIs

The rte_vhost API to put data into virtqueues operates
on mbufs and hence it is strictly vhost-net specific.
External backends need to implement virtqueue handling
from scratch and that's just not possible without APIs
to get/set vring base addresses.

Those relevant APIs are there, but they have a check that
prevents them from working with any non-vhost-net device.
This patch removes those checks.

rte_vhost_get_log_base() is not necessarily needed for
external backends, as other, higher level vhost APIs for
live migration are available and could be used instead.
We remove the extra check from it anyway for consistency.

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agodoc: improve vhost zero copy guide
Tiwei Bie [Fri, 22 Feb 2019 02:42:09 +0000 (10:42 +0800)]
doc: improve vhost zero copy guide

Highlight that vhost zero copy mbufs should be consumed
as soon as possible.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: fix potential use-after-free for memory region
Tiwei Bie [Fri, 22 Feb 2019 02:42:08 +0000 (10:42 +0800)]
vhost: fix potential use-after-free for memory region

Reclaim outstanding zmbufs first before freeing memory regions,
otherwise there could be use-after-free.

Fixes: b0a985d1f340 ("vhost: add dequeue zero copy")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: fix potential use-after-free for zero copy mbuf
Tiwei Bie [Fri, 22 Feb 2019 02:42:07 +0000 (10:42 +0800)]
vhost: fix potential use-after-free for zero copy mbuf

Don't free the zero copy mbufs before they have been consumed,
otherwise there could be use-after-free.

Fixes: b0a985d1f340 ("vhost: add dequeue zero copy")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: restore mbuf first when freeing zmbuf
Tiwei Bie [Fri, 22 Feb 2019 02:42:06 +0000 (10:42 +0800)]
vhost: restore mbuf first when freeing zmbuf

The mbufs should also be restored in free_zmbufs().

Fixes: b0a985d1f340 ("vhost: add dequeue zero copy")
Fixes: 3ebd930588b7 ("vhost: fix mbuf free")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/dpaa2: support generic flow
Sunil Kumar Kori [Fri, 22 Feb 2019 11:16:05 +0000 (11:16 +0000)]
net/dpaa2: support generic flow

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: support low level loopback tester
Hemant Agrawal [Fri, 22 Feb 2019 11:16:04 +0000 (11:16 +0000)]
net/dpaa2: support low level loopback tester

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: support 16 Rx queues per traffic class
Ashish Jain [Fri, 22 Feb 2019 11:16:02 +0000 (11:16 +0000)]
net/dpaa2: support 16 Rx queues per traffic class

Adding support for 16 queues per TC per DPNI port
which is required for LX2 platform.

Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
5 years agobus/fslmc: add enqueue response read in qbman
Nipun Gupta [Fri, 22 Feb 2019 11:16:01 +0000 (11:16 +0000)]
bus/fslmc: add enqueue response read in qbman

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
5 years agomempool/dpaa2: fix continuous print on empty pool
Hemant Agrawal [Fri, 22 Feb 2019 11:15:59 +0000 (11:15 +0000)]
mempool/dpaa2: fix continuous print on empty pool

Changing the print to DP_DEBUG to avoid continuous prints when
buffer pools runs out of buffers

Fixes: 3646ccf0b036 ("mempool/dpaa2: support dynamic logging")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: support VLAN TPID config
Hemant Agrawal [Fri, 22 Feb 2019 11:15:58 +0000 (11:15 +0000)]
net/dpaa2: support VLAN TPID config

This patch add support to config custom tpid in dpni.
i.e. value other than 0x8100 and 0x88A8

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/tap: fix multi-process request
Raslan Darawsheh [Tue, 26 Feb 2019 09:50:56 +0000 (09:50 +0000)]
net/tap: fix multi-process request

The structure was not initialized.

Fixes: c9aa56edec8e ("net/tap: access primary process queues from secondary")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agoapp/compress-perf: call generic strlcpy
Thomas Monjalon [Sun, 24 Feb 2019 22:42:01 +0000 (23:42 +0100)]
app/compress-perf: call generic strlcpy

The call to strlcpy uses either libc, libbsd or internal rte_strlcpy.
No need to call the DPDK flavor explicitly.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agonet/bnx2x: fix segfaults due to stale interrupt status
Shahed Shaikh [Thu, 21 Feb 2019 19:24:44 +0000 (11:24 -0800)]
net/bnx2x: fix segfaults due to stale interrupt status

Previous ungraceful exit may leave behind un-acked stale
interrupts for slowpath and fastpath.

Interrupt status polling function is started before FLR is
initiated, so we don't have a real way to protect this polling
function invoking an interrupt handler caused due to stale
interrupt status from previous ungraceful exit.

So, check uninitialized status block variables in interrupt
handling path which may lead to segfault.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
5 years agonet/mlx: prefix private structure
Thomas Monjalon [Thu, 21 Feb 2019 09:29:14 +0000 (10:29 +0100)]
net/mlx: prefix private structure

The private structure stored in rte_eth_dev->data->dev_private
was named "struct priv".
In order to ease code browsing, the structure is renamed
"struct mlx[45]_priv".

Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/iavf: rename remaining avf strings
Leyi Rong [Mon, 25 Feb 2019 17:18:52 +0000 (01:18 +0800)]
net/iavf: rename remaining avf strings

This is the main patch which renames the macros, functions,
structs and any remaining strings in the iavf code.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/iavf: rename avf to iavf
Leyi Rong [Mon, 25 Feb 2019 17:18:51 +0000 (01:18 +0800)]
net/iavf: rename avf to iavf

Rename Intel Ethernet Adaptive Virtual Function driver avf to iavf.

This is the first patch which will only renames the directory name,
lib name, filenames and updates the new name in makefile and meson
files. Also updates the #include files in source files.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodevtools: add verbose option to meson build test
Bruce Richardson [Tue, 26 Feb 2019 14:15:33 +0000 (14:15 +0000)]
devtools: add verbose option to meson build test

When running ninja, the commands are, by default, always printed on top of
each other. For those who want more detail in the output, two levels of
verbose output has been added to the test-meson-builds script. When "-v" is
passed, or the "TEST_MESON_BUILD_VERBOSE" flag is set in the environment,
then the output of ninja is passed through "cat" to prevent each line
overwriting the next. If "-vv" is passed, or
"TEST_MESON_BUILD_VERY_VERBOSE" is set in the environment, then ninja is
called with the "-v" flag to print out each command in full as it is
executing.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: support Cortex a55 and a76 platforms
Phil Yang [Thu, 31 Jan 2019 10:11:52 +0000 (18:11 +0800)]
build: support Cortex a55 and a76 platforms

Enable native/cross compiling for Cortex-A55 and Cortex-A76 on meson.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
5 years agobuild: improve pcap dependency handling
Luca Boccassi [Tue, 26 Feb 2019 17:46:37 +0000 (17:46 +0000)]
build: improve pcap dependency handling

pcap has historically shipped a custom pcap-config binary tool which
does the job of pkg-config. It was never compatible with cross
compilation.
Meson uses it when using dependency(), which then means cross
compilation fails.
Set pcap-config to empty in the meson cross compilation files so
that Meson will not use it, and add a fallback in case
dependency() fails.
libpcap 1.9.0 finally ships a pkg-config file so everything will
work out of the box in the future.

Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
5 years agomaintainers: resign from keepalive, metrics and ethtool
Remy Horton [Fri, 1 Mar 2019 07:15:17 +0000 (07:15 +0000)]
maintainers: resign from keepalive, metrics and ethtool

After today I will no longer be with Intel, so I am
removing my name from all related maintainer roles.

Signed-off-by: Remy Horton <remy.horton@intel.com>
5 years agoexamples/vhost_scsi: disable build if missing dependency
Aaron Conole [Thu, 7 Feb 2019 22:01:13 +0000 (17:01 -0500)]
examples/vhost_scsi: disable build if missing dependency

The vhost_scsi example code is set to build, even if the requisite header
file virtio_scsi.h isn't available.  This happens on some Ubuntu systems
when some versions of the libc-dev package aren't available.

Check whether the virtio_scsi.h file exists, and if not, set the build
flag to false.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agodoc: add meson build to contributing guide
Vipin Varghese [Wed, 13 Feb 2019 05:41:06 +0000 (11:11 +0530)]
doc: add meson build to contributing guide

Patches has to be validated for meson devtool script for
code and document changes. Updating documentation for meson
build steps in checking Compilation category.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Tested-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agobuild: use integers for numerical options
Luca Boccassi [Tue, 26 Feb 2019 17:46:36 +0000 (17:46 +0000)]
build: use integers for numerical options

Now that the minimum Meson version has been bumped past 0.45 we can use
integer as an option type directly.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: improve libbsd dependency handling
Luca Boccassi [Tue, 26 Feb 2019 17:46:35 +0000 (17:46 +0000)]
build: improve libbsd dependency handling

Use dependency() instead of manual append to ldflags.

Move libbsd inclusion to librte_eal, so that all other libraries and
PMDs will inherit it.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: reorder cmdline library after EAL
Luca Boccassi [Tue, 26 Feb 2019 17:46:34 +0000 (17:46 +0000)]
build: reorder cmdline library after EAL

Most libraries and PMDs depend on eal, and eal depends only on kvargs,
so reorder the list in Meson to reflect this and take advantage of this
dependency chain.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: improve dependency handling
Luca Boccassi [Tue, 26 Feb 2019 17:46:33 +0000 (17:46 +0000)]
build: improve dependency handling

Whenever possible (if the library ships a pkg-config file) use meson's
dependency() function to look for it, as it will automatically add it
to the Requires.private list if needed, to allow for static builds to
succeed for reverse dependencies of DPDK. Otherwise the recursive
dependencies are not parsed, and users doing static builds have to
resolve them manually by themselves.
When using this API avoid additional checks that are superfluous and
take extra time, and avoid adding the linker flag manually which causes
it to be duplicated.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: bump minimum Meson version to 0.47.1
Luca Boccassi [Tue, 26 Feb 2019 17:46:32 +0000 (17:46 +0000)]
build: bump minimum Meson version to 0.47.1

Meson 0.47.1 fixed a bug that is difficult to work around, which causes
the linker flag of dependencies to be repeated dozens of times, which
causes issues especially when using the built-in dependency() API.
Bump the minimum version and remove obsolete version checks.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: fix options ordering
Chas Williams [Thu, 7 Feb 2019 15:53:18 +0000 (10:53 -0500)]
build: fix options ordering

Sort the options alphabetically and make a note of the preferred
order at the top of the file.

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: add option to override max ethdev ports
Chas Williams [Thu, 7 Feb 2019 15:53:17 +0000 (10:53 -0500)]
build: add option to override max ethdev ports

Allow users and packagers to override the default RTE_MAX_ETHPORTS.
This adds a new meson option, max_ethports which defaults to the
current value.

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: set RTE_ARCH_64 based on pointer size
Bruce Richardson [Wed, 26 Sep 2018 09:15:36 +0000 (10:15 +0100)]
build: set RTE_ARCH_64 based on pointer size

Rather than relying on the target machine architecture, use the
size of a pointer from the compiler to determine if we are 64-bits
or not. This allows correct behaviour when you pass -m32 as a compile
option. It also allows us to use this value repeatedly throughout the
repo rather than continually testing for the sizeof(void*).

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Luca Boccassi <bluca@debian.org>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agodevtools: fix build test on FreeBSD
Bruce Richardson [Mon, 25 Feb 2019 15:40:01 +0000 (15:40 +0000)]
devtools: fix build test on FreeBSD

readlink option "-m" is not supported on FreeBSD (checked on BSD 11),
so change to the largely-equivalent "-f" flag.

Fixes: a55277a788df ("devtools: add test script for meson builds")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/vhost_crypto: fix dependency on vhost library
Bruce Richardson [Mon, 25 Feb 2019 15:23:04 +0000 (15:23 +0000)]
examples/vhost_crypto: fix dependency on vhost library

The vhost_crypto example app can't be used without the DPDK vhost
library, so disable the build of the example if the lib hasn't been
built.

Fixes: f5188211c721 ("examples/vhost_crypto: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agoexamples/ip_pipeline: disable build when no epoll
Bruce Richardson [Mon, 25 Feb 2019 15:23:03 +0000 (15:23 +0000)]
examples/ip_pipeline: disable build when no epoll

The ip_pipeline example requires the epoll.h header from linux, so
disable building the example if the header cannot be found.

Fixes: 4bbf8e30aa5e ("examples/ip_pipeline: add CLI interface")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agotest/compress: fix missing header include
Bruce Richardson [Mon, 25 Feb 2019 15:23:02 +0000 (15:23 +0000)]
test/compress: fix missing header include

usleep() is defined in unistd.h, which is missing from include list
in test_compressdev.c, causing compiler errors on FreeBSD.

Fixes: b06aa643cac4 ("test/compress: add initial unit tests")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agotest: move to app directory
Bruce Richardson [Tue, 26 Feb 2019 12:19:03 +0000 (12:19 +0000)]
test: move to app directory

Since all other apps have been moved to the "app" folder, the autotest app
remains alone in the test folder. Rather than having an entire top-level
folder for this, we can move it back to where it all started in early
versions of DPDK - the "app/" folder.

This move has a couple of advantages:
* This reduces clutter at the top level of the project, due to one less
  folder.
* It eliminates the separate build task necessary for building the
  autotests using make "make test-build" which means that developers are
  less likely to miss something in their own compilation tests
* It re-aligns the final location of the test binary in the app folder when
  building with make with it's location in the source tree.

For meson builds, the autotest app is different from the other apps in that
it needs a series of different test cases defined for it for use by "meson
test". Therefore, it does not get built as part of the main loop in the
app folder, but gets built separately at the end.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/bpf: move from test directory
Bruce Richardson [Tue, 26 Feb 2019 12:19:02 +0000 (12:19 +0000)]
examples/bpf: move from test directory

The bpf folder didn't actual contain a test application, but instead
basic examples of BPF code for use with testpmd. Therefore we can
move it to the `examples` folder. Being different, it also needs
a README with it, explaining what it is and how to use it. References
to the code from the testpmd docs are suitably updated.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoapp/pipeline: move from test directory
Bruce Richardson [Tue, 26 Feb 2019 12:19:01 +0000 (12:19 +0000)]
app/pipeline: move from test directory

Move to the app directory, and add to meson build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoapp/acl: move from test directory
Bruce Richardson [Tue, 26 Feb 2019 12:19:00 +0000 (12:19 +0000)]
app/acl: move from test directory

Move to "app" directory and enable with meson build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoapp/cmdline: move from test directory
Bruce Richardson [Tue, 26 Feb 2019 12:18:59 +0000 (12:18 +0000)]
app/cmdline: move from test directory

Move app to "app" directory and enable with meson build. For consistency of
naming, the subdirectory is also renamed from cmdline_test to test-cmdline.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agocompat: merge compat library into EAL
Bruce Richardson [Wed, 6 Feb 2019 11:01:30 +0000 (11:01 +0000)]
compat: merge compat library into EAL

Since compat library is only a single header, we can easily move it into
the EAL common headers instead of tracking it separately. The downside of
this is that it becomes a little more difficult to have any libs that are
built before EAL depend on it. Thankfully, this is not a major problem as
the only library which uses rte_compat.h and is built before EAL (kvargs)
already has the path to the compat.h header file explicitly called out as
an include path.

However, to ensure that we don't hit problems later with this, we can add
EAL common headers folder to the global include list in the meson build
which means that all common headers can be safely used by all libraries, no
matter what their build order.

As a side-effect, this patch also fixes an issue with building on BSD using
meson, due to compat lib no longer needing to be listed as a dependency.

Fixes: a8499f65a1d1 ("log: add missing experimental tag")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: David Marchand <david.marchand@redhat.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agomaintainers: update Marvell PMDs
Liron Himi [Wed, 20 Feb 2019 15:01:59 +0000 (17:01 +0200)]
maintainers: update Marvell PMDs

Natalie and Dmitri are no longer involved in PMDs maintenance hence
update the list.
Also append new active maintainers to the list.

Signed-off-by: Liron Himi <lironh@marvell.com>
Acked-by: Tomasz Duszynski <tdu@semihalf.com>
5 years agodevtools: add git log checks for DCB, TOS and TTL
Ferruh Yigit [Tue, 29 Jan 2019 13:55:33 +0000 (13:55 +0000)]
devtools: add git log checks for DCB, TOS and TTL

Add case check to DCB, TOS and TTL abbreviations.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodevtools: fix test of some build options
Thomas Monjalon [Tue, 12 Feb 2019 22:20:37 +0000 (23:20 +0100)]
devtools: fix test of some build options

CONFIG_RTE_LIBRTE_PMD_ISAL was not tested because of a typo.

CONFIG_RTE_LIBRTE_PMD_QAT_SYM was not tested since it has been
introduced and made CONFIG_RTE_LIBRTE_PMD_QAT enabled by default.

While at it, DPDK_DEP_JSON is now checked for "y",
as other DPDK_DEP_* variables, instead of non-empty.

Fixes: 3c32e89f68e1 ("compress/isal: add skeleton ISA-L compression PMD")
Fixes: 7a34c2155716 ("compress/qat: add empty driver")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agodevtools: test build of zlib PMD
Thomas Monjalon [Tue, 12 Feb 2019 22:18:54 +0000 (23:18 +0100)]
devtools: test build of zlib PMD

The PMD zlib was not enabled in devtools/test-build.sh.
It is fixed by using the environment variable DPDK_DEP_ZLIB.

Fixes: 0c4e4c16b004 ("compress/zlib: introduce zlib PMD")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodevtools: add libelf dependency to build test
Thomas Monjalon [Tue, 12 Feb 2019 22:10:39 +0000 (23:10 +0100)]
devtools: add libelf dependency to build test

The option CONFIG_RTE_LIBRTE_BPF_ELF was never enabled
with test-build.sh.
It is fixed with the environment variable DPDK_DEP_ELF.

Fixes: 5dba93ae5f2d ("bpf: add ability to load eBPF program from ELF object file")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agomk: fix build of shared library with libbsd
Thomas Monjalon [Tue, 12 Feb 2019 22:07:05 +0000 (23:07 +0100)]
mk: fix build of shared library with libbsd

When building DPDK with "make" and options
CONFIG_RTE_USE_LIBBSD=y
and
CONFIG_RTE_BUILD_SHARED_LIB=y
libbsd was not linked, resulting in compilation errors:
undefined reference to `strlcpy'

The link option -lbsd is added in a common place for both
Linux apps and libs.
It is used in app linkage via EXECENV_LDLIBS,
and in lib linkage via the added variable EXECENV_LDLIBS-y.

Fixes: 5364de644a4b ("eal: support strlcpy function")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agovhost: fix sprintf with snprintf
Pallantla Poornima [Mon, 4 Feb 2019 07:28:06 +0000 (07:28 +0000)]
vhost: fix sprintf with snprintf

sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used.

Fixes: d7280c9fffcb ("vhost: support selective datapath")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: fix deadlock in driver unregister
Wenjie Sun [Mon, 28 Jan 2019 06:55:49 +0000 (14:55 +0800)]
vhost: fix deadlock in driver unregister

In rte_vhost_driver_unregister(), the connection fd is
removed from the fdset using fdset_try_del(). Call to
this function may fail if the corresponding fd is in
busy state, indicating that event dispatcher is
executing the read or write callback on this fd.
When it happens, rte_vhost_driver_unregister() keeps
trying to remove the fd from the set until it is no
more busy.

This situation is causing a deadlock, because
rte_vhost_driver_unregister() keeps trying to remove
the fd from the set with vhost_user.mutex held, while
the callback executed by the dispatcher,
vhost_user_read_cb(), also takes this mutex at
numerous places.

The fix consists in releasing vhost_user.mutex between
each retry in vhost_driver_unregister().

Fixes: 8b4b949144b8 ("vhost: fix dead lock on closing in server mode")
Cc: stable@dpdk.org
Signed-off-by: Wenjie Sun <findtheonlyway@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: optimize Tx enqueue for packed ring
Tiwei Bie [Tue, 19 Feb 2019 10:59:51 +0000 (18:59 +0800)]
net/virtio: optimize Tx enqueue for packed ring

This patch introduces an optimized enqueue function in packed
ring for the case that virtio net header can be prepended to
the unchained mbuf.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: introduce helper for clearing net header
Tiwei Bie [Tue, 19 Feb 2019 10:59:50 +0000 (18:59 +0800)]
net/virtio: introduce helper for clearing net header

This patch introduces a helper for clearing the virtio net header
to avoid the code duplication. Macro is used as it shows slightly
better performance.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>