dpdk.git
5 years agonet/octeontx2: enable Tx through traffic manager
Krzysztof Kanas [Sun, 26 May 2019 17:34:42 +0000 (23:04 +0530)]
net/octeontx2: enable Tx through traffic manager

This patch enables pkt transmit through traffic manager
hierarchy by clearing software XOFF on the nodes and linking
tx queues to corresponding leaf nodes.
It also adds support to start and stop tx queue using
traffic manager.

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agonet/octeontx2: configure TM HW resources
Nithin Dabilpuram [Sun, 26 May 2019 16:49:40 +0000 (22:19 +0530)]
net/octeontx2: configure TM HW resources

This patch sets up and configure hierarchy in hw
nodes. Since all the registers are with RVU AF,
register configuration is also done using mbox
communication.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
5 years agonet/octeontx2: alloc and free TM HW resources
Krzysztof Kanas [Sun, 26 May 2019 06:56:36 +0000 (12:26 +0530)]
net/octeontx2: alloc and free TM HW resources

Allocate and free shaper/scheduler hardware resources for
nodes of hierarchy levels in sw.

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agonet/octeontx2: introduce traffic manager
Nithin Dabilpuram [Wed, 29 May 2019 17:19:53 +0000 (22:49 +0530)]
net/octeontx2: introduce traffic manager

Introduce traffic manager infra and default hierarchy
creation.

Upon ethdev configure, a default hierarchy is
created with one-to-one mapped tm nodes. This topology
will be overridden when user explicitly creates and commits
a new hierarchy using rte_tm interface.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
5 years agonet/octeontx2: add queue start and stop operations
Nithin Dabilpuram [Wed, 29 May 2019 17:04:51 +0000 (22:34 +0530)]
net/octeontx2: add queue start and stop operations

Add queue start and stop operations. Tx queue needs
to update the flow control value, Which will be
added in sub subsequent patch.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agonet/octeontx2: handle port reconfigure
Vamsi Attunuru [Wed, 29 May 2019 16:45:32 +0000 (22:15 +0530)]
net/octeontx2: handle port reconfigure

setup tx & rx queues with the previous configuration during
port reconfig, it handles cases like port reconfigure without
reconfiguring tx & rx queues.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agonet/octeontx2: add Tx queue setup and release
Jerin Jacob [Wed, 29 May 2019 13:00:23 +0000 (18:30 +0530)]
net/octeontx2: add Tx queue setup and release

Add Tx queue setup and release.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agonet/octeontx2: add Rx queue setup and release
Jerin Jacob [Wed, 29 May 2019 12:44:20 +0000 (18:14 +0530)]
net/octeontx2: add Rx queue setup and release

Add Rx queue setup and release.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agonet/octeontx2: support RSS
Vamsi Attunuru [Wed, 29 May 2019 11:36:05 +0000 (17:06 +0530)]
net/octeontx2: support RSS

Add RSS support and expose RSS related functions
to implement RSS action for rte_flow driver.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
5 years agonet/octeontx2: add unicast MAC filter
Sunil Kumar Kori [Wed, 29 May 2019 11:21:55 +0000 (16:51 +0530)]
net/octeontx2: add unicast MAC filter

Add unicast MAC filter for PF device and
update the respective feature list.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agonet/octeontx2: add promiscuous and allmulticast mode
Vamsi Attunuru [Wed, 29 May 2019 10:27:54 +0000 (15:57 +0530)]
net/octeontx2: add promiscuous and allmulticast mode

Add promiscuous and allmulticast mode for PF devices and
update the respective feature list.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agonet/octeontx2: add extended stats operations
Kiran Kumar K [Wed, 29 May 2019 09:29:27 +0000 (14:59 +0530)]
net/octeontx2: add extended stats operations

Add extended operations and updated the feature list.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agonet/octeontx2: add basic stats operation
Kiran Kumar K [Wed, 29 May 2019 08:59:29 +0000 (14:29 +0530)]
net/octeontx2: add basic stats operation

Add basic stat operation and updated the feature list.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agonet/octeontx2: add link stats operations
Vamsi Attunuru [Wed, 29 May 2019 08:05:08 +0000 (13:35 +0530)]
net/octeontx2: add link stats operations

Add link stats related operations and mark respective
items in the documentation.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agonet/octeontx2: support register dump
Kiran Kumar K [Wed, 29 May 2019 06:29:17 +0000 (11:59 +0530)]
net/octeontx2: support register dump

Add register dump support and mark Registers dump in features.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
5 years agonet/octeontx2: add context debug utils
Jerin Jacob [Wed, 29 May 2019 05:19:41 +0000 (10:49 +0530)]
net/octeontx2: add context debug utils

Add RQ,SQ,CQ context and CQE structure dump utils.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
5 years agonet/octeontx2: handle queue specific error interrupts
Jerin Jacob [Wed, 29 May 2019 05:00:14 +0000 (10:30 +0530)]
net/octeontx2: handle queue specific error interrupts

Handle queue specific error interrupts.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agonet/octeontx2: add device configure operation
Jerin Jacob [Wed, 29 May 2019 03:38:14 +0000 (09:08 +0530)]
net/octeontx2: add device configure operation

Add device configure operation. This would call lf_alloc
mailbox to allocate a NIX LF and upon return, AF will
return the attributes for the select LF.

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 agonet/octeontx2: add info get operation
Jerin Jacob [Tue, 28 May 2019 15:55:50 +0000 (21:25 +0530)]
net/octeontx2: add info get operation

Add device information get operation.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Harman Kalra <hkalra@marvell.com>
5 years agonet/octeontx2: handle device error interrupts
Jerin Jacob [Tue, 28 May 2019 14:20:07 +0000 (19:50 +0530)]
net/octeontx2: handle device error interrupts

Handle device specific error and ras interrupts.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Harman Kalra <hkalra@marvell.com>
5 years agonet/octeontx2: add devargs parsing functions
Jerin Jacob [Tue, 28 May 2019 14:02:32 +0000 (19:32 +0530)]
net/octeontx2: add devargs parsing functions

add various devargs command line options supported by this 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>
5 years agonet/octeontx2: add device init and uninit
Jerin Jacob [Tue, 28 May 2019 12:38:35 +0000 (18:08 +0530)]
net/octeontx2: add device init and uninit

Add basic init and uninit function which includes
attaching LF device to probed PCIe device.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agonet/octeontx2: add ethdev probe and remove
Jerin Jacob [Tue, 28 May 2019 11:13:13 +0000 (16:43 +0530)]
net/octeontx2: add ethdev probe and remove

add basic PCIe ethdev probe and remove.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
5 years agonet/octeontx2: add build and doc infrastructure
Jerin Jacob [Tue, 28 May 2019 08:55:22 +0000 (14:25 +0530)]
net/octeontx2: add build and doc infrastructure

Adding bare minimum PMD library and doc build infrastructure
and claim the maintainership for octeontx2 PMD.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
5 years agonet/i40e: fix crash when TxQ/RxQ set to 0 in VF
Andy Pei [Thu, 4 Jul 2019 01:38:39 +0000 (09:38 +0800)]
net/i40e: fix crash when TxQ/RxQ set to 0 in VF

Testpmd would stuck and result in core dump when user specifies an
invalid VF queue number, for example when setting txq or rxq to 0.
When txq or rxq is set to 0, pointer of pointer rxq or txq in
function i40evf_configure_vsi_queues is NULL. The usage of txq[i]
or rxq[0] is valid. This patch fixes this issue.

Fixes: d6b19729093e ("i40evf: support configurable crc stripping")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/netvsc: fix definition of offload values
Stephen Hemminger [Wed, 3 Jul 2019 15:50:01 +0000 (08:50 -0700)]
net/netvsc: fix definition of offload values

The definition of ipsec and rsc offloads was incorrect.
Neither one of these is used by current driver, but the values
should be fixed now for future RSC support.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agomaintainers: update for Mellanox
Shahaf Shuler [Thu, 4 Jul 2019 10:01:04 +0000 (10:01 +0000)]
maintainers: update for Mellanox

Due to position change, cannot be a full time maintainer anymore.
The git tree dpdk-next-net-mlx will be managed by Raslan,
as approved by the DPDK Technical Board.
For mlx5 PMD, Slava is added as additional maintainer.

Will continue to be involved in the DPDK community in different ways.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: fix MPLS IPv4 encapsulation fields
Saleh Alsouqi [Thu, 4 Jul 2019 07:33:22 +0000 (07:33 +0000)]
app/testpmd: fix MPLS IPv4 encapsulation fields

Having version and ihl set to 0 would result in a
corrupted/incorrect encapsulating packet for MPLS,
this commit sets these fields to 4 and 5 respectively
as defined in librte_net/rte_ip.h.

Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation")
Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation")
Cc: stable@dpdk.org
Signed-off-by: Saleh Alsouqi <salehals@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet: define IPv4 IHL and VHL
Saleh Alsouqi [Thu, 4 Jul 2019 07:33:19 +0000 (07:33 +0000)]
net: define IPv4 IHL and VHL

Define IPv4 Minimum IHL and VHL according to rfc791 (see [1])

    "The Version field indicates the format of the
    internet header."

    "Internet Header Length (ihl) is the length of the
    internet header in 32 bit words, and thus points
    to the beginning of the data. Note that
    the minimum value for a correct header is 5."

[1] https://tools.ietf.org/html/rfc791

Signed-off-by: Saleh Alsouqi <salehals@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoethdev: support dynamic configuration of QinQ strip
Vivek Sharma [Tue, 2 Jul 2019 03:37:07 +0000 (09:07 +0530)]
ethdev: support dynamic configuration of QinQ strip

Enable missing support for runtime configuration (setting/getting)
of QinQ strip rx offload for a given ethdev.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: allow action with any config object type
Dekel Peled [Tue, 2 Jul 2019 14:17:26 +0000 (17:17 +0300)]
ethdev: allow action with any config object type

In current implementation, an action which requires parameters
must accept them enclosed in a structure.
Some actions require a single, trivial type parameter, but it still
must be enclosed in a structure.
This obligation results in multiple, action-specific structures, each
containing a single trivial type parameter.

This patch introduces a new approach, allowing an action configuration
object of any type, trivial or a structure.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
5 years agonet/af_packet: set default block size to page size
Krzysztof Kanas [Mon, 24 Jun 2019 14:32:00 +0000 (16:32 +0200)]
net/af_packet: set default block size to page size

Kernel validates block size to be aligned to page size. Code works on
platforms with page size 4k, but on others e.g. Arm64 fails with default
parameters.

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/mlx5: modify TCP header using Direct Verbs
Dekel Peled [Tue, 2 Jul 2019 14:44:28 +0000 (17:44 +0300)]
net/mlx5: modify TCP header using Direct Verbs

This patch implements additional actions of packet header
modifications.

Add actions:
- INC_TCP_SEQ - Increase sequence number in the outermost TCP header.
- DEC_TCP_SEQ - Decrease sequence number in the outermost TCP header.
- INC_TCP_ACK - Increase acknowledgment number in the outermost TCP
header.
- DEC_TCP_ACK - Decrease acknowledgment number in the outermost TCP
header.

Original work by Xiaoyu Min.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
5 years agoapp/testpmd: add actions to modify TCP header fields
Dekel Peled [Tue, 2 Jul 2019 14:44:27 +0000 (17:44 +0300)]
app/testpmd: add actions to modify TCP header fields

Add actions:
- INC_TCP_SEQ - Increase sequence number in the outermost TCP header.
- DEC_TCP_SEQ - Decrease sequence number in the outermost TCP header.
- INC_TCP_ACK - Increase acknowledgment number in the outermost TCP
                header.
- DEC_TCP_ACK - Decrease acknowledgment number in the outermost TCP
                header.

Original work by Xiaoyu Min.

This patch uses the new approach introduced by [1], using a new
macro ARG_ENTRY_HTON to pass a single integer argument to each of
the new actions.

[1] http://patches.dpdk.org/patch/55882/

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
5 years agoethdev: add actions to modify TCP header fields
Dekel Peled [Tue, 2 Jul 2019 14:44:26 +0000 (17:44 +0300)]
ethdev: add actions to modify TCP header fields

Add actions:
- INC_TCP_SEQ - Increase sequence number in the outermost TCP header.
- DEC_TCP_SEQ - Decrease sequence number in the outermost TCP header.
- INC_TCP_ACK - Increase acknowledgment number in the outermost TCP
header.
- DEC_TCP_ACK - Decrease acknowledgment number in the outermost TCP
header.

Original work by Xiaoyu Min.

This patch uses the new approach introduced by [1], using a simple
integer instead of using an action-specific structure for each of
the new actions.

[1] http://patches.dpdk.org/patch/55882/

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
5 years agodoc: announce infinite Rx pcap
Cian Ferriter [Wed, 3 Jul 2019 11:04:16 +0000 (12:04 +0100)]
doc: announce infinite Rx pcap

This feature was added in the following commit:
commit a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")

Signed-off-by: Cian Ferriter <cian.ferriter@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/sfc: release port upon close
Andrew Rybchenko [Fri, 21 Jun 2019 09:40:41 +0000 (10:40 +0100)]
net/sfc: release port upon close

Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the resources
for the port can be freed by rte_eth_dev_close() and the ethdev
port freed.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
5 years agonet/sfc: ensure that device is closed on removal
Andrew Rybchenko [Fri, 21 Jun 2019 09:40:40 +0000 (10:40 +0100)]
net/sfc: ensure that device is closed on removal

PCI device may be unplugged when ethdev is not closed yet.

Fixes: aaa3f5f0f79d ("net/sfc: add configure and close stubs")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
5 years agoethdev: avoid error on PCI unplug of closed port
Andrew Rybchenko [Fri, 21 Jun 2019 09:40:39 +0000 (10:40 +0100)]
ethdev: avoid error on PCI unplug of closed port

If PCI Ethernet device driver removes it on close
(RTE_ETH_DEV_CLOSE_REMOVE) and later PCI device itself is unplugged,
it should not fail because of Ethernet device is already removed.

Fixes: 23ea57a2a0ce ("ethdev: complete closing of port")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reported-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: fix build with latest meson
Bruce Richardson [Fri, 5 Jul 2019 15:56:55 +0000 (16:56 +0100)]
doc: fix build with latest meson

The latest versions of meson don't build targets when build_by_default is
false but install is true, unlike older versions. We can fix this by having
both build_by_default and install settings come from the build-time option.

Bugzilla ID: 303
Fixes: d02a2dab2dfb ("doc: support building HTML guides with meson")
Fixes: 720b14db3ae2 ("build: generate API documentation with meson")
Cc: stable@dpdk.org
Reported-by: Ali Alnubani <alialnu@mellanox.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agotimer: fix resource leak in finalize
Anatoly Burakov [Fri, 5 Jul 2019 17:22:44 +0000 (18:22 +0100)]
timer: fix resource leak in finalize

Currently, whenever timer library is initialized, the memory
is leaked because there is no telling when primary or secondary
processes get to use the state, and there is no way to
initialize/deinitialize timer library state without race
conditions [1] because the data itself must live in shared memory.

Add a spinlock to the shared mem config to have a way to
exclusively initialize/deinitialize the timer library without
any races, and implement the synchronization mechanism based
on this lock in the timer library.

Also, update the API doc. Note that the behavior of the API
itself did not change - the requirement to call init in every
process was simply not documented explicitly.

[1] See the following email thread:
https://mails.dpdk.org/archives/dev/2019-May/131498.html

Fixes: c0749f7096c7 ("timer: allow management in shared memory")
Cc: stable@dpdk.org
Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: prevent different primary/secondary process versions
Anatoly Burakov [Fri, 5 Jul 2019 17:26:27 +0000 (18:26 +0100)]
eal: prevent different primary/secondary process versions

Currently, nothing stops DPDK to attempt to run primary and
secondary processes while having different versions. This
can lead to all sorts of weird behavior and makes it harder
to maintain compatibility without breaking ABI every once
in a while.

Fix it by explicitly disallowing running different DPDK
versions as primary and secondary processes.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: unify internal config init
Anatoly Burakov [Fri, 5 Jul 2019 13:10:34 +0000 (14:10 +0100)]
eal: unify internal config init

Currently, each EAL will update internal/shared config in their
own way at init, resulting in needless duplication of code and
OS-dependent behavior. Move the functions to a common file and
add missing FreeBSD steps.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: unify wait for complete init
Anatoly Burakov [Fri, 5 Jul 2019 13:10:33 +0000 (14:10 +0100)]
eal: unify wait for complete init

Currently, mcfg completion function exists in two independent
implementations doing the same thing, which is bug prone.
Unify the two functions and move them into one place.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: uninline wait for complete init
Anatoly Burakov [Fri, 5 Jul 2019 13:10:32 +0000 (14:10 +0100)]
eal: uninline wait for complete init

Currently, the function to wait until config completion is
static inline for no reason. Move its implementation to
an EAL common file.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: remove packed attribute from mcfg structure
Anatoly Burakov [Fri, 5 Jul 2019 13:10:31 +0000 (14:10 +0100)]
eal: remove packed attribute from mcfg structure

There is no reason to pack the memconfig structure, and doing so
gives out warnings in some static analyzers. Fix it by removing
the packed attributed.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: hide shared memory config
Anatoly Burakov [Fri, 5 Jul 2019 13:10:30 +0000 (14:10 +0100)]
eal: hide shared memory config

Now that everything that has ever accessed the shared memory
config is doing so through the public API's, we can make it
internal. Since we're removing quite a few headers from
rte_eal_memconfig.h, we need to add them back in places
where this header is used.

This bumps the ABI, so also change all build files and make
update documentation.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: add API to lock/unlock mempool list
Anatoly Burakov [Fri, 5 Jul 2019 13:10:29 +0000 (14:10 +0100)]
eal: add API to lock/unlock mempool list

Currently, in order to lock access to the mempool list, a direct
access to the shared memory structure is needed. Add an API to do
the same, and search-and-replace all usages.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: add API to lock/unlock tailq list
Anatoly Burakov [Fri, 5 Jul 2019 13:10:28 +0000 (14:10 +0100)]
eal: add API to lock/unlock tailq list

Currently, locking/unlocking the TAILQ list requires direct
access to the shared memory config. Add an API to do the same,
and search-and-replace all usages.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@redhat.com>
5 years agomem: add API to lock/unlock memory hotplug
Anatoly Burakov [Fri, 5 Jul 2019 13:10:27 +0000 (14:10 +0100)]
mem: add API to lock/unlock memory hotplug

Currently, the memory hotplug is locked automatically by all
memory-related _walk() functions, but sometimes locking the
memory subsystem outside of them is needed. There is no
public API to do that, so it creates a dependency on shared
memory config to be public. Fix this by introducing a new
API to lock/unlock the memory hotplug subsystem.

Create a new common file for all things mem config, and a
new API namespace rte_mcfg_*, and search-and-replace all
usages of the locks with the new API.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@redhat.com>
5 years agobus/pci: consider only usable devices for IOVA mode
Ben Walker [Fri, 14 Jun 2019 09:39:17 +0000 (11:39 +0200)]
bus/pci: consider only usable devices for IOVA mode

When selecting the preferred IOVA mode of the pci bus, the current
heuristic ("are devices bound?", "are devices bound to UIO?", "are pmd
drivers supporting IOVA as VA?" etc..) should honor the device
white/blacklist so that an unwanted device does not impact the decision.

There is no reason to consider a device which has no driver available.

This applies to all OS, so implements this in common code then call a
OS specific callback.

On Linux side:
- the VFIO special considerations should be evaluated only if VFIO
  support is built,
- there is no strong requirement on using VA rather than PA if a driver
  supports VA, so defaulting to DC in such a case.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoeal: compute IOVA mode based on PA availability
Ben Walker [Fri, 14 Jun 2019 09:39:16 +0000 (11:39 +0200)]
eal: compute IOVA mode based on PA availability

Currently, if the bus selects IOVA as PA, the memory init can fail when
lacking access to physical addresses.
This can be quite hard for normal users to understand what is wrong
since this is the default behavior.

Catch this situation earlier in eal init by validating physical addresses
availability, or select IOVA when no clear preferrence had been expressed.

The bus code is changed so that it reports when it does not care about
the IOVA mode and let the eal init decide.

In Linux implementation, rework rte_eal_using_phys_addrs() so that it can
be called earlier but still avoid a circular dependency with
rte_mem_virt2phys().
In FreeBSD implementation, rte_eal_using_phys_addrs() always returns
false, so the detection part is left as is.

If librte_kni is compiled in and the KNI kmod is loaded,
- if the buses requested VA, force to PA if physical addresses are
  available as it was done before,
- else, keep iova as VA, KNI init will fail later.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agokni: abort when IOVA is not PA
David Marchand [Fri, 14 Jun 2019 09:39:15 +0000 (11:39 +0200)]
kni: abort when IOVA is not PA

If a forced iova-mode has been passed at init, kni is not supposed to
work.

Fixes: 075b182b54ce ("eal: force IOVA to a particular mode")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agomem: fix typo in API description
David Marchand [Fri, 5 Jul 2019 09:18:42 +0000 (11:18 +0200)]
mem: fix typo in API description

Fixes: 552afc420a67 ("mem: add contig walk function")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoraw/ioat: fix icc build
Bruce Richardson [Fri, 5 Jul 2019 11:54:24 +0000 (12:54 +0100)]
raw/ioat: fix icc build

When using _mm_set_epi64() rather than _mm_set_epi64x() intrinsic, ICC
tries to use the x87 floating point registers, leading to warnings about
not properly clearing value when switching between x87 and SSE/AVX modes.

error #13203: No EMMS instruction before call to function

Fix this by using the set64x() intrinsic.

Fixes: 0a92e63fc4cd ("raw/ioat: add local API to perform copies")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoexamples/ntb: add example for NTB
Xiaoyun Li [Tue, 2 Jul 2019 06:25:21 +0000 (14:25 +0800)]
examples/ntb: add example for NTB

Enable an example for rawdev ntb. Support interactive mode to send
file on one host and receive file from another host. The command line
would be 'send [filepath]' and 'receive [filepath]'.

But since the FIFO is not enabled right now, use rte_memcpy as the enqueue
and dequeue functions and only support transmitting file no more than 4M.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
5 years agoraw/ntb: add handshake process
Xiaoyun Li [Tue, 2 Jul 2019 06:25:20 +0000 (14:25 +0800)]
raw/ntb: add handshake process

Add handshake process using doorbell so that two hosts can
communicate to start and stop.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
5 years agoraw/ntb: support Intel NTB
Xiaoyun Li [Tue, 2 Jul 2019 06:25:19 +0000 (14:25 +0800)]
raw/ntb: support Intel NTB

Add in the list of registers for the device.
And enable NTB device ops for Intel Skylake platform.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
5 years agoraw/ntb: introduce NTB raw device driver
Xiaoyun Li [Tue, 2 Jul 2019 06:25:17 +0000 (14:25 +0800)]
raw/ntb: introduce NTB raw device driver

Introduce rawdev driver support for NTB (Non-transparent Bridge) which
can help to connect two separate hosts with each other.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
5 years agousertools: add octeontx2 DMA device binding
Jerin Jacob [Fri, 5 Jul 2019 08:38:05 +0000 (14:08 +0530)]
usertools: add octeontx2 DMA device binding

Update the devbind script with new section of DMA devices, also
added OCTEONTX2 DMA device ID to DMA device list

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Satha Rao <skoteshwar@marvell.com>
5 years agoraw/octeontx2_dma: add driver self test
Satha Rao [Fri, 5 Jul 2019 08:38:04 +0000 (14:08 +0530)]
raw/octeontx2_dma: add driver self test

Sample test to verify DMA functionality, this test covers
internal transfer mode.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agoraw/octeontx2_dma: add dequeue and device control operations
Satha Rao [Fri, 5 Jul 2019 08:38:03 +0000 (14:08 +0530)]
raw/octeontx2_dma: add dequeue and device control operations

Add dequeue, device start, stop, close and reset operations.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agoraw/octeontx2_dma: add enqueue operation
Satha Rao [Fri, 5 Jul 2019 08:38:02 +0000 (14:08 +0530)]
raw/octeontx2_dma: add enqueue operation

Add enqueue operation.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agoraw/octeontx2_dma: add device close operation
Satha Rao [Fri, 5 Jul 2019 08:38:01 +0000 (14:08 +0530)]
raw/octeontx2_dma: add device close operation

Send message to PF to stop DMA queue when device close is
called from application.
Defined the required data structures to support enqueue and
dequeue APIs.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agoraw/octeontx2_dma: add device configuration
Satha Rao [Fri, 5 Jul 2019 08:38:00 +0000 (14:08 +0530)]
raw/octeontx2_dma: add device configuration

Register dev_configure API to configure DPI PCI devices.
After successful initialization send message to PF to open
corresponding DPI DMA queue. At present hardware doesn't
support mail box for DPI, so PMD to PF communication uses
pre build kernel devfs.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agoraw/octeontx2_dma: update probe function
Satha Rao [Fri, 5 Jul 2019 08:37:59 +0000 (14:07 +0530)]
raw/octeontx2_dma: update probe function

Probe function enhanced to allocate and initialize PMD private data.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agoraw/octeontx2_dma: add build infra and device probe
Jerin Jacob [Fri, 5 Jul 2019 08:37:58 +0000 (14:07 +0530)]
raw/octeontx2_dma: add build infra and device probe

Add the make and meson based build infrastructure along
with the DMA device probe with documentation infrastructure.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
5 years agomempool/octeontx2: fix clang build for arm64
Pavan Nikhilesh [Fri, 5 Jul 2019 04:26:50 +0000 (09:56 +0530)]
mempool/octeontx2: fix clang build for arm64

The ARMv8.1 CASP instruction works with even register pairs and since
there no register constraint in older versions of GCC/Clang, use
explicit register allocation to satisfy CASP requirements.
Remove function level optimization specification as Clang doesn't have
support for it and explicit register allocation removes the need for it.

Fixes build issue with arm64-armv8a-linux-clang.

Fixes: ee338015e7a9 ("mempool/octeontx2: add optimized dequeue operation for arm64")

Reported-by: Gavin Hu <gavin.hu@arm.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agotest: fix build without timer library
Timothy Redaelli [Thu, 4 Jul 2019 15:36:08 +0000 (17:36 +0200)]
test: fix build without timer library

The action for timer_secondary_spawn_wait should be enabled only when
CONFIG_RTE_LIBRTE_TIMER is enabled.

Fixes: 50247fe03fe0 ("test/timer: exercise new APIs in secondary process")
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
5 years agotest/hash: use array for small amount of memory
Honnappa Nagarahalli [Tue, 2 Jul 2019 00:27:24 +0000 (19:27 -0500)]
test/hash: use array for small amount of memory

Variables of size 128B can make use of stack instead of dynamically
allocated memory.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
5 years agotest/hash: free allocated memory
Honnappa Nagarahalli [Tue, 2 Jul 2019 00:27:23 +0000 (19:27 -0500)]
test/hash: free allocated memory

Free allocated memory.

Fixes: 3f9aab961ed3 ("test/hash: check lock-free extendable bucket")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
5 years agotest/hash: init parameters in the correct function
Honnappa Nagarahalli [Tue, 2 Jul 2019 00:27:22 +0000 (19:27 -0500)]
test/hash: init parameters in the correct function

Each test case initializes its hash parameters in the test case
function. To be consistent, generate keys function should initialize
hash parameters similarly.

Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
5 years agotest/hash: fix data reset on new run
Honnappa Nagarahalli [Tue, 2 Jul 2019 00:27:21 +0000 (19:27 -0500)]
test/hash: fix data reset on new run

Reset tbl_rwc_test_param to discard data from previous run
of the test.

Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
5 years agotest/power: add cases for turbo feature
Lukasz Krakowiak [Wed, 3 Apr 2019 10:32:56 +0000 (12:32 +0200)]
test/power: add cases for turbo feature

Add UT check_power_turbo.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Tested-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
5 years agotest/power: remove prefix ACPI
Lukasz Krakowiak [Wed, 3 Apr 2019 10:32:54 +0000 (12:32 +0200)]
test/power: remove prefix ACPI

This patch removes prefix _acpi from power UT function/test names,
and renames file test_power_acpi_cpufreq.c ->
 app/test/test_power_cpufreq.c.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
5 years agotest/eal: add cases for options proc-type and uio
Lavanya Govindarajan [Wed, 3 Jul 2019 13:06:14 +0000 (14:06 +0100)]
test/eal: add cases for options proc-type and uio

Added unit test cases for EAL flags --proc-type=auto and
--create-uio-dev in order to cover the below functions
eal_proc_type_detect()
rte_eal_create_uio_dev()

Signed-off-by: Lavanya Govindarajan <lavanyax.govindarajan@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agotest/eal: add cases for in-memory and single-file-segments
Pallantla Poornima [Wed, 3 Jul 2019 07:13:30 +0000 (08:13 +0100)]
test/eal: add cases for in-memory and single-file-segments

Added unit test case for eal command line '--in-memory' option
which will cover below functions.
get_seg_memfd()
test_memfd_create()
pagesz_flags()

Added unit test case for eal command line '--single-file-segments' option
which will cover resize_hugefile().

Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agotest: fix autotest crash
Herakliusz Lipiec [Wed, 12 Jun 2019 14:46:47 +0000 (15:46 +0100)]
test: fix autotest crash

On some systems when dpdk test is executed with make test command
autotest_runner crashes in first_cpu_on_node. This happens when list
of available cpus contains something that is not a cpu as first element.
Fixed by removing all non-cpu values from list of available cpus.

Bugzilla ID: 253
Fixes: 22dcd9a4d90f ("test: parallelize unit tests")
Cc: stable@dpdk.org
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agotable: fix crash in LPM IPv6
Jananee Parthasarathy [Tue, 2 Jul 2019 11:21:34 +0000 (12:21 +0100)]
table: fix crash in LPM IPv6

Unit test table_autotest results in segmentation fault.
Crash occurs in test_table_lpm_ipv6_combined().

Variable 'nht_pos0' used as array subscript is not initialized
in rte_table_lpm_ipv6_entry_add(). It will not be assigned,
if a rule does not exist.

In such case a junk number or invalid array index might result in
segmentation fault due to array out of bounds when
lpm->nht_users is used with such invalid array index.

Fix is to initialize the variables used for array subscript.

Bugzilla ID: 285
Fixes: d89a5bce1d ("lpm6: extend next hop field")
Cc: stable@dpdk.org
Signed-off-by: Jananee Parthasarathy <jananeex.m.parthasarathy@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agousertools: add baseband device binding
Nicolas Chautru [Tue, 11 Jun 2019 00:33:03 +0000 (17:33 -0700)]
usertools: add baseband device binding

Allows binding of baseband devices

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
5 years agodoc: add a note for multi-process in mempool guide
Gage Eads [Thu, 20 Jun 2019 22:07:35 +0000 (17:07 -0500)]
doc: add a note for multi-process in mempool guide

The mempool library assigns handler ops indexes based on the dynamic load
order of mempool handlers. Indexes are used so a mempool can be used by
multiple processes, but this only works if all processes agree on the
mapping from index to mempool handler.

When using the '-d' argument, it's possible for different processes to load
mempool handlers in different orders, and thus have different
index->handler mappings. Using a mempool in multiple of such processes will
result in undefined behavior.

This commit adds a note to the mempool library programmer's guide warning
users against this.

Fixes: 449c49b93a6b ("mempool: support handler operations")
Cc: stable@dpdk.org
Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agousertools: fix refresh binding infos
Timothy Redaelli [Fri, 31 May 2019 11:11:26 +0000 (13:11 +0200)]
usertools: fix refresh binding infos

Currently clear_data (dpdk-devbind.py) doesn't work as expected
since "global devices" is missing and so "devices" is considered
a local variable.

This commit changes "clear_data" function in order to really clear
devices by adding "global devices".

Fixes: ea9f00f7289a ("usertools: refactor NIC and crypto binding details")
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agodevtools: pass custom options to checkpatch
Olivier Matz [Thu, 23 May 2019 07:45:49 +0000 (09:45 +0200)]
devtools: pass custom options to checkpatch

Add the ability to pass custom options to checkpatch script. An example
of use is to change the output format so it can run in emacs compilation
mode:

  DPDK_CHECKPATCH_PATH=/path/to/linux/scripts/checkpatch.pl \
    DPDK_CHECKPATCH_OPTIONS='--emacs --showfile --no-color' \
    /path/to/dpdk.org/devtools/checkpatches.sh

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoexamples/power: remove double copy of FIFO path
Lukasz Krakowiak [Tue, 16 Apr 2019 10:20:39 +0000 (12:20 +0200)]
examples/power: remove double copy of FIFO path

Removed doubled created fifo path string for channel info.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Signed-off-by: Lukasz Gosiewski <lukaszx.gosiewski@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agotelemetry: fix build with gcc 9
Flavia Musatescu [Wed, 3 Jul 2019 09:23:43 +0000 (10:23 +0100)]
telemetry: fix build with gcc 9

Suppress the unaligned packed member address warnings by extending
the telemetry library build flags with -Wno-address-of-packed-member
option, through the WERROR_FLAGS makefile variable.

With this change additional warnings are turned on to be treated as errors,
which causes the following build issues to be seen:
- no previous prototype [-Werror=missing-prototypes]
- initialization discards â€˜const’ qualifier from pointer target type
  [-Werror=discarded-qualifiers]
- old-style function definition [-Werror=old-style-definition]
- variable may be used before its value is set (when using icc compiler).

Fixes: 0fe3a37924d4 ("telemetry: format json response when sending stats")
Fixes: ee5ff0d3297e ("telemetry: add client feature and sockets")
Fixes: 8877ac688b52 ("telemetry: introduce infrastructure")
Fixes: 1b756087db93 ("telemetry: add parser for client socket messages")
Fixes: fff6df7bf58e ("telemetry: fix using ports of different types")
Fixes: 4080e46c8078 ("telemetry: support global metrics")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Flavia Musatescu <flavia.musatescu@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
5 years agoconfig: increase maximum lcores for ppc
David Wilder [Wed, 5 Jun 2019 22:57:45 +0000 (15:57 -0700)]
config: increase maximum lcores for ppc

Setting RTE_MAX_LCORE to reflect the largest available configuration.

Signed-off-by: David Wilder <dwilder@us.ibm.com>
Acked-by: David Christensen <drc@linux.vnet.ibm.com>
5 years agoconfig: update for ppc build with meson
David Wilder [Wed, 5 Jun 2019 22:55:53 +0000 (15:55 -0700)]
config: update for ppc build with meson

Adding defines for missing RTE_MACHINE_CPUFLAGs.

Signed-off-by: David Wilder <dwilder@us.ibm.com>
Acked-by: David Christensen <drc@linux.vnet.ibm.com>
5 years agomempool/dpaa: fix leak in pool creation failure
Li Qiang [Tue, 9 Apr 2019 14:56:21 +0000 (07:56 -0700)]
mempool/dpaa: fix leak in pool creation failure

When 'rte_zmalloc' failed dpaa_mbuf_create_pool() forgets freeing
'bp' thus leading resource leak. This patch avoids this.

Coverity issue: 337679

Signed-off-by: Li Qiang <liq3ea@163.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoevent/octeontx2: add libatomic dependency for 32-bit clang
Pavan Nikhilesh [Thu, 4 Jul 2019 08:59:35 +0000 (14:29 +0530)]
event/octeontx2: add libatomic dependency for 32-bit clang

When compiling with clang on 32-bit platforms, we are missing
copies of 64-bit atomic functions. We can solve this by linking
against libatomic for the drivers and libs which need those
atomic ops.

Fixes: f0b9982cb3a7 ("event/octeontx2: add TIM bucket operations")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agodrivers/octeontx2: fix icc build for i686
Amit Gupta [Mon, 1 Jul 2019 18:03:46 +0000 (23:33 +0530)]
drivers/octeontx2: fix icc build for i686

Fix the following ICC specific compilation issue with i686 build.

dpdk/drivers/common/octeontx2/otx2_mbox.c(47): error #2259:
non-pointer conversion from "unsigned long long" to "struct mbox_hdr *"
may lose significant bits
(struct mbox_hdr *)((uintptr_t)mdev->mbase + mbox->tx_start);

Fixes: 732377a6792e ("mempool/octeontx2: add build infra and device probe")
Fixes: 371d3212cbed ("common/octeontx2: add build infrastructure and HW definition")

Signed-off-by: Amit Gupta <agupta3@marvell.com>
5 years agonet: forbid VLAN insert in shared mbuf
Ferruh Yigit [Tue, 16 Apr 2019 15:51:26 +0000 (16:51 +0100)]
net: forbid VLAN insert in shared mbuf

The vlan_insert() is buggy when it tries to handle the shared mbufs,
instead don't support inserting VLAN tag into shared mbufs and return
an error for that case.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
5 years agoraw/ifpga: fix unintentional integer overflow
Andy Pei [Wed, 22 May 2019 06:36:34 +0000 (14:36 +0800)]
raw/ifpga: fix unintentional integer overflow

cast unsigned int ports_per_retimer, unsigned int nums_retimer,
unsigned int nums_fvl and unsigned int ports_per_fvl to uint64_t
before multiply operation, to avoid Unintentional integer overflow.

Coverity issue: 337924, 337926
Fixes: d1cd4eb2d48e ("raw/ifpga: support ipn3ke")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agoraw/ifpga/base: fix retimer link status
Tianfei Zhang [Fri, 21 Jun 2019 08:40:17 +0000 (16:40 +0800)]
raw/ifpga/base: fix retimer link status

Fix the readout retimer link status incorrectly when we
remove the linux intel-fpga-driver and run the DPDK application.
The linux driver will stop the retimer when remove the kernel
modules.

Fixes: 8a256bef ("raw/ifpga/base: add eth group driver")
Cc: stable@dpdk.org
Reported-by: Amrutha Sampath <amrutha.sampath@intel.com>
Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agoraw/ifpga/base: fix physical address info
Tianfei Zhang [Fri, 21 Jun 2019 08:40:16 +0000 (16:40 +0800)]
raw/ifpga/base: fix physical address info

Fix miss phy_addr on ifpga_acc_get_region_info() function.

Fixes: 56bb54ea1bd ("raw/ifpga/base: add Intel FPGA OPAE share code")
Cc: stable@dpdk.org
Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agoraw/ifpga/base: fix bit fields definition
Tianfei Zhang [Fri, 21 Jun 2019 08:40:15 +0000 (16:40 +0800)]
raw/ifpga/base: fix bit fields definition

Fix CTRL_DEV_SELECT bit fields definition about eth_group devices.

Fixes: 8a256bef32 ("raw/ifpga/base: add eth group driver")
Cc: stable@dpdk.org
Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agoraw/ifpga/base: fix logically dead code
Tianfei Zhang [Fri, 21 Jun 2019 08:40:14 +0000 (16:40 +0800)]
raw/ifpga/base: fix logically dead code

add temporary variable in max10_reg_write().

Coverity issue: 337927
Fixes: 96ebfcf ("raw/ifpga/base: add SPI and MAX10 device driver")
Cc: stable@dpdk.org
Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agoraw/ifpga/base: fix use of untrusted scalar value
Tianfei Zhang [Fri, 21 Jun 2019 08:40:13 +0000 (16:40 +0800)]
raw/ifpga/base: fix use of untrusted scalar value

Add checking the buffer size and use
const char * for buffer declaration.

Coverity issue: 279449
Fixes: ef1e8ede ("raw/ifpga: add Intel FPGA bus rawdev driver")
Cc: stable@dpdk.org
Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agotest/bpf: add test-case for function return value
Konstantin Ananyev [Wed, 3 Jul 2019 13:40:35 +0000 (14:40 +0100)]
test/bpf: add test-case for function return value

New test-case to cover situation when external function returns a
pointer the data.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agobpf: fix validate for function return value
Konstantin Ananyev [Wed, 3 Jul 2019 13:40:34 +0000 (14:40 +0100)]
bpf: fix validate for function return value

eval_call() blindly calls eval_max_bound() for external function
return value for all return types.
That causes wrong estimation for returned pointer min and max boundaries.
So any attempt to dereference that pointer value causes verifier to fail
with error message: "memory boundary violation at pc: ...".
To fix - estimate min/max boundaries based on the return value type.

Bugzilla ID: 298

Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program")
Cc: stable@dpdk.org
Reported-by: Michel Machado <michel@digirati.com.br>
Suggested-by: Michel Machado <michel@digirati.com.br>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoraw/ioat: add local API to perform copies
Bruce Richardson [Tue, 2 Jul 2019 14:12:30 +0000 (15:12 +0100)]
raw/ioat: add local API to perform copies

Add local APIs to trigger data copies, and retrieve handle values once
those copies are completed. Included are unit tests to validate the data
is copies correctly.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>