dpdk.git
4 years agonet/ice: fix flow API switch filter
Wei Zhao [Tue, 16 Jul 2019 02:36:38 +0000 (10:36 +0800)]
net/ice: fix flow API switch filter

When pattern has ETH, it may contain two kinds of lookup
parameters, MAC and ethertype.

So increasing item number for memory malloc in order
to reserve one more memory slot for ETH which may
consume 2 lookup items.

Fixes: 57c4f2693588 ("net/ice: enable switch filter")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix flow API tunnel rule
Qiming Yang [Mon, 15 Jul 2019 09:40:52 +0000 (17:40 +0800)]
net/ice: fix flow API tunnel rule

If the input set is outer or inner protocol was distinguished by
checking if the item appears once or twice.

But this is not working when the user doesn't configure the outer
input set, this patch fixes the issue.

Fixes: d76116a4678f ("net/ice: add generic flow API")

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agoraw/dpaa2_cmdif: remove redundant declaration
Stephen Hemminger [Thu, 11 Jul 2019 20:03:09 +0000 (13:03 -0700)]
raw/dpaa2_cmdif: remove redundant declaration

The rte_vdev_driver is declared twice.
The first one is not necessary.

Fixes: 3298fa4853b8 ("raw/dpaa2_cmdif: introduce DPAA2 command interface driver")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoraw/skeleton: remove redundant declaration
Stephen Hemminger [Thu, 11 Jul 2019 20:03:08 +0000 (13:03 -0700)]
raw/skeleton: remove redundant declaration

The rte_vdev_driver is declared twice.
The first one is not necessary.

Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/virtio_user: remove redundant declaration
Stephen Hemminger [Thu, 11 Jul 2019 20:03:07 +0000 (13:03 -0700)]
net/virtio_user: remove redundant declaration

The rte_vdev_driver is declared twice.
The first one is not necessary.

Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for vdev")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ring: remove redundant declaration
Stephen Hemminger [Thu, 11 Jul 2019 20:03:06 +0000 (13:03 -0700)]
net/ring: remove redundant declaration

The rte_vdev_driver is declared twice.
The first one is not necessary.

Fixes: 740feaf349b1 ("ethdev: remove driver name from device private data")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agonet/pcap: remove redundant declaration
Stephen Hemminger [Thu, 11 Jul 2019 20:03:05 +0000 (13:03 -0700)]
net/pcap: remove redundant declaration

The rte_vdev_driver is declared twice.
The first one is not necessary.

Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for vdev")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/null: remove redundant declaration
Stephen Hemminger [Thu, 11 Jul 2019 20:03:04 +0000 (13:03 -0700)]
net/null: remove redundant declaration

The rte_vdev_driver is declared twice.
The first one is not necessary.

Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for vdev")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/vhost: remove redundant declaration
Stephen Hemminger [Thu, 11 Jul 2019 20:03:03 +0000 (13:03 -0700)]
net/vhost: remove redundant declaration

The rte_vdev_driver is declared twice.
The first one is not necessary.

Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for vdev")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/af_packet: remove redundant declaration
Stephen Hemminger [Thu, 11 Jul 2019 20:03:02 +0000 (13:03 -0700)]
net/af_packet: remove redundant declaration

The rte_vdev_driver is declared twice.
The first one is not necessary.

Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for vdev")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/tap: remove redundant declarations
Stephen Hemminger [Thu, 11 Jul 2019 20:03:01 +0000 (13:03 -0700)]
net/tap: remove redundant declarations

The rte_vdev_drivers are declared twice.
The first one is not necessary.

Fixes: 740feaf349b1 ("ethdev: remove driver name from device private data")
Fixes: 204d026a3922 ("net/tap: support tun")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
4 years agonet/af_packet: log system error messages
Krzysztof Kanas [Fri, 12 Jul 2019 10:01:21 +0000 (12:01 +0200)]
net/af_packet: log system error messages

Print system error to make easier diagnosis of errors with af_packet.

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/nfb: support timestamp
Rastislav Cernay [Mon, 15 Jul 2019 12:03:03 +0000 (14:03 +0200)]
net/nfb: support timestamp

This patch adds timestamping support to nfb driver.

Signed-off-by: Rastislav Cernay <cernay@netcope.com>
4 years agonet/mlx5: support IP-in-IP tunnel
Xiaoyu Min [Wed, 10 Jul 2019 14:59:45 +0000 (22:59 +0800)]
net/mlx5: support IP-in-IP tunnel

Enabled IP-in-IP tunnel type support on DV/DR flow engine.
This includes the following combination:
 - IPv4 over IPv4
 - IPv4 over IPv6
 - IPv6 over IPv4
 - IPv6 over IPv6

MLX5 NIC supports IP-in-IP tunnel via FLEX Parser so
need to make sure fw using FLEX Paser profile 0.

  mlxconfig -d <mst device> -y set FLEX_PARSER_PROFILE_ENABLE=0

The example testpmd commands would be:

- Match on IPv4 over IPv4 packets and do inner RSS:

  testpmd> flow create 0 ingress pattern eth / ipv4 proto is 0x04 /
           ipv4 / udp / end actions rss level 2 queues 0 1 2 3 end / end

- Match on IPv6 over IPv4 packets and do inner RSS:

  testpmd> flow create 0 ingress pattern eth / ipv4 proto is 0x29 /
           ipv6 / udp / end actions rss level 2 queues 0 1 2 3 end / end

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/ice: fix flow validation
Qiming Yang [Mon, 15 Jul 2019 02:23:56 +0000 (10:23 +0800)]
net/ice: fix flow validation

ice_flow_valid_attr will return zero on success and a negative value
on error.
Current return value check logic is opposite of the expected behavior.
This patch fixes this issue.

Fixes: d76116a4678f ("net/ice: add generic flow API")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/ice: use DMA IOVA instead of physical address
Haiyue Wang [Thu, 11 Jul 2019 17:27:06 +0000 (01:27 +0800)]
net/ice: use DMA IOVA instead of physical address

The phys_addr concept is deprecated in rte_memzone, change it to access
iova member, and use the type 'rte_iova_t'.

Also rename the rx/tx_ring_phys_addr definitions to rx/tx_ring_dma that
matches the IOVA concept design.

Fixes: 50370662b727 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/af_xdp: fix handling of not supported feature
Július Milan [Fri, 12 Jul 2019 07:55:46 +0000 (09:55 +0200)]
net/af_xdp: fix handling of not supported feature

Procedure xdp_get_channels_info was returning error code -1 in case of
ioctl command SIOCETHTOOL was not supported. This patch sets return
value back to 0 as it is valid case.

Fixes: 339b88c6a91f ("net/af_xdp: support multi-queue")

Signed-off-by: Július Milan <jmilan.dev@gmail.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agodoc: fix example in AF_XDP guide
David Marchand [Thu, 11 Jul 2019 08:18:49 +0000 (10:18 +0200)]
doc: fix example in AF_XDP guide

queue= parameter does not exist.
It might have been the previous name of the queue_count parameter, but
anyway, the default value 1 for the number of queues works fine.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/mlx5: match GRE key and present bits
Xiaoyu Min [Tue, 9 Jul 2019 10:59:13 +0000 (18:59 +0800)]
net/mlx5: match GRE key and present bits

Support matching on the present bits (C,K,S)
as well as the optional key field.

If the rte_flow_item_gre_key is specified in pattern,
it will set K present match automatically.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: support match GRE protocol on DR engine
Xiaoyu Min [Tue, 9 Jul 2019 10:59:12 +0000 (18:59 +0800)]
net/mlx5: support match GRE protocol on DR engine

DR engine support matching on GRE protocol field without MPLS supports.
So bypassing the MPLS check when DR is enabled.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/ice: add safe mode devarg
Qi Zhang [Wed, 10 Jul 2019 04:16:30 +0000 (12:16 +0800)]
net/ice: add safe mode devarg

When OS package is not provided driver silently goes into safe mode,
since safe mode is missing most of advanced features, this may confuse
the users.

Instead of going into safe mode silently, add devarg for safe mode
enabling only for users that are asking for it.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Ray Kinsella <ray.kinsella@intel.com>
4 years agonet/ice: remove unused devargs
Qi Zhang [Wed, 10 Jul 2019 04:16:29 +0000 (12:16 +0800)]
net/ice: remove unused devargs

Remove devarg "max_queue_pair_num" related code since
it is not complete implemented.

Fixes: f9cf4f864150 ("net/ice: support device initialization")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/hinic: replace spinlock with mutex
Ziyang Xuan [Fri, 5 Jul 2019 06:47:47 +0000 (14:47 +0800)]
net/hinic: replace spinlock with mutex

Using spin lock to protect critical resources
of sending mgmt messages. This will make high
CPU usage for rte_delay_ms when sending mgmt
messages frequently. We can use mutex to protect
the critical resources and usleep to reduce CPU
usage while keep functioning properly.

Signed-off-by: Ziyang Xuan <xuanziyang2@huawei.com>
4 years agonet/octeontx2: support PF and VF action
Kiran Kumar K [Mon, 8 Jul 2019 03:36:15 +0000 (09:06 +0530)]
net/octeontx2: support PF and VF action

Adding PF and VF action support for octeontx2 flow driver.
If RTE_FLOW_ACTION_TYPE_PF action is set from VF, then the packet
will be sent to the parent PF.
If RTE_FLOW_ACTION_TYPE_VF action is set and original is specified,
then the packet will be sent to the original VF, otherwise the packet
will be sent to the VF specified in the vf_id.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/bnx2x: fix fastpath SB allocation for SRIOV
Rasesh Mody [Wed, 3 Jul 2019 23:43:13 +0000 (16:43 -0700)]
net/bnx2x: fix fastpath SB allocation for SRIOV

For SRIOV, fastpath status blocks are not allocated resulting in
segfault. Separate out fastpath DMA allocation/free from rest of
memory allocation/free. It is now done as part of NIC load/unload.

Comment indentation changes in bnx2x_alloc_hsi_mem() and
bnx2x_free_hsi_mem() APIs.

Fixes: f0219d98defd ("net/bnx2x: fix interrupt flood")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/bnx2x: fix link events polling for SRIOV
Rasesh Mody [Wed, 3 Jul 2019 23:43:12 +0000 (16:43 -0700)]
net/bnx2x: fix link events polling for SRIOV

We do not need to schedule periodic poll for slowpath link events
for SRIOV. The link events are handled by the PF driver.

Fixes: 6041aa619f9a ("net/bnx2x: fix poll link status")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/bnx2x: fix reading VF id
Rasesh Mody [Wed, 3 Jul 2019 23:43:11 +0000 (16:43 -0700)]
net/bnx2x: fix reading VF id

The logic to read vf_id used by ACQUIRE/TEARDOWN_Q/RELEASE TLVs,
multiplexed return value to convey vf_id value and status of read vf_id
API. This lets to segfault at dev_start() as resources are not properly
cleaned and re-allocated.

Fix read vf_id API to differentiate between vf_id value and return
status. Adjust the status checking accordingly.
Added bnx2x_vf_teardown_queue() API and moved relevant code from
bnx2x_vf_unload() to new API.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agodrivers/net: use ack in interrupt handlers
Nithin Dabilpuram [Tue, 23 Jul 2019 08:04:19 +0000 (10:04 +0200)]
drivers/net: use ack in interrupt handlers

Replace rte_intr_enable() with rte_intr_ack() API
for acking an interrupt in interrupt handlers and
rx_queue_intr_enable() callbacks of PMD's.

This is inline with original intent of this change in PMDs
to ack interrupts after handling is completed if
device is backed by UIO, IGB_UIO or VFIO(with INTx).

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Shahed Shaikh <shshaikh@marvell.com>
Tested-by: Shahed Shaikh <shshaikh@marvell.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoeal: add ack interrupt API
Nithin Dabilpuram [Tue, 23 Jul 2019 08:04:18 +0000 (10:04 +0200)]
eal: add ack interrupt API

Add new ack interrupt API to avoid using
VFIO_IRQ_SET_ACTION_TRIGGER(rte_intr_enable()) for
acking interrupt purpose for VFIO based interrupt handlers.
This implementation is specific to Linux.

Using rte_intr_enable() for acking interrupt has below issues

 * Time consuming to do for every interrupt received as it will
   free_irq() followed by request_irq() and all other initializations
 * A race condition because of a window between free_irq() and
   request_irq() with packet reception still on and device still
   enabled and would throw warning messages like below.
   [158764.159833] do_IRQ: 9.34 No irq handler for vector

In this patch, rte_intr_ack() is a no-op for VFIO_MSIX/VFIO_MSI interrupts
as they are edge triggered and kernel would not mask the interrupt before
delivering the event to userspace and we don't need to ack.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Shahed Shaikh <shshaikh@marvell.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agovfio: revert interrupt eventfd setup at probe
Nithin Dabilpuram [Tue, 23 Jul 2019 08:04:17 +0000 (10:04 +0200)]
vfio: revert interrupt eventfd setup at probe

This reverts commit 89aac60e0be9ed95a87b16e3595f102f9faaffb4.
"vfio: fix interrupts race condition"

The above mentioned commit moves the interrupt's eventfd setup
to probe time but only enables one interrupt for all types of
interrupt handles i.e VFIO_MSI, VFIO_LEGACY, VFIO_MSIX, UIO.
It works fine with default case but breaks below cases specifically
for MSIX based interrupt handles.

* Applications like l3fwd-power that request rxq interrupts
  while ethdev setup.
* Drivers that need > 1 MSIx interrupts to be configured for
  functionality to work.

VFIO PCI for MSIx expects all the possible vectors to be setup up
when using VFIO_IRQ_SET_ACTION_TRIGGER so that they can be
allocated from kernel pci subsystem. Only way to increase the number
of vectors later is first free all by using VFIO_IRQ_SET_DATA_NONE
with action trigger and then enable new vector count.

Above commit changes the behavior of rte_intr_[enable|disable] to
only mask and unmask unlike earlier behavior and thereby
breaking above two scenarios.

Fixes: 89aac60e0be9 ("vfio: fix interrupts race condition")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Shahed Shaikh <shshaikh@marvell.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agoexamples/ip_frag: fix stale content of ethdev info
Marcin Zapolski [Mon, 22 Jul 2019 11:47:01 +0000 (13:47 +0200)]
examples/ip_frag: fix stale content of ethdev info

The eth_dev_info was used with content that was obsolete. Added update
of struct content prior to use.

Fixes: 6b7780bfebe4 ("examples/ip_frag: fix use of ethdev internal device array")
Cc: stable@dpdk.org
Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoeal: fix parsing option --telemetry
Sean Morrissey [Mon, 15 Jul 2019 10:54:34 +0000 (11:54 +0100)]
eal: fix parsing option --telemetry

Added telemetry to EAL long options so that when
--telemetry is passed as an EAL arg that there is
no unrecognized argument error message printed.

Fixes: 8877ac688b52 ("telemetry: introduce infrastructure")
Cc: stable@dpdk.org
Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Tested-by: John OLoughlin <john.oloughlin@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
4 years agoeal/linux: select IOVA as VA mode for default case
Jerin Jacob [Mon, 22 Jul 2019 12:56:53 +0000 (14:56 +0200)]
eal/linux: select IOVA as VA mode for default case

When bus layer reports the preferred mode as RTE_IOVA_DC then
select the RTE_IOVA_VA mode:

- All drivers work in RTE_IOVA_VA mode, irrespective of physical
address availability.

- By default, a mempool asks for IOVA-contiguous memory using
RTE_MEMZONE_IOVA_CONTIG. This is slow in RTE_IOVA_PA mode and it
may affect the application boot time.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agobus/pci: change IOVA as VA flag name
Jerin Jacob [Mon, 22 Jul 2019 12:56:52 +0000 (14:56 +0200)]
bus/pci: change IOVA as VA flag name

In order to align name with other PCI driver flag such as
RTE_PCI_DRV_NEED_MAPPING and to reflect its purpose, change
RTE_PCI_DRV_IOVA_AS_VA flag name as RTE_PCI_DRV_NEED_IOVA_AS_VA.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoeal: fix IOVA mode selection as VA for PCI drivers
David Marchand [Mon, 22 Jul 2019 12:56:51 +0000 (14:56 +0200)]
eal: fix IOVA mode selection as VA for PCI drivers

The incriminated commit broke the use of RTE_PCI_DRV_IOVA_AS_VA which
was intended to mean "driver only supports VA" but had been understood
as "driver supports both PA and VA" by most net drivers and used to let
dpdk processes to run as non root (which do not have access to physical
addresses on recent kernels).

The check on physical addresses actually closed the gap for those
drivers. We don't need to mark them with RTE_PCI_DRV_IOVA_AS_VA and this
flag can retain its intended meaning.
Document explicitly its meaning.

We can check that a driver requirement wrt to IOVA mode is fulfilled
before trying to probe a device.

Finally, document the heuristic used to select the IOVA mode and hope
that we won't break it again.

Fixes: 703458e19c16 ("bus/pci: consider only usable devices for IOVA mode")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agobus/pci: remove Mellanox kernel driver type
David Marchand [Mon, 22 Jul 2019 12:56:50 +0000 (14:56 +0200)]
bus/pci: remove Mellanox kernel driver type

This reverts commit 0cb86518db57d35e0abc14d6703fad561a0310e2.

The PCI bus now reports DC when faced with a device bound to an unknown
driver and, in such a case, the IOVA mode is selected against physical
address availability.

As a consequence, there is no reason for this special case for Mellanox
drivers.

Fixes: 703458e19c16 ("bus/pci: consider only usable devices for IOVA mode")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
4 years agobus/fslmc: fix ppc build
Hemant Agrawal [Mon, 22 Jul 2019 10:03:22 +0000 (15:33 +0530)]
bus/fslmc: fix ppc build

fslmc_vfio.c:387:36: note: format string is defined here
DPAA2_BUS_DEBUG("VFIO dmamap 0x%llx:0x%llx, size 0x%llx\n",

format ‘%llx’ expects argument of type ‘long long unsigned int’
argument 6 has type ‘__u64 {aka long unsigned int}’

Fixes: 2b5fa25708cf ("mempool/dpaa2: map external memory with VFIO")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/fslmc: decrease log level in parsing
Hemant Agrawal [Mon, 22 Jul 2019 10:03:21 +0000 (15:33 +0530)]
bus/fslmc: decrease log level in parsing

This patch removes the unnecessary err prints when using
non-dpaa2 devices.

Fixes: e67a61614d0b ("bus/fslmc: support device iteration")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/dpaa: decrease log level in parsing
Hemant Agrawal [Mon, 22 Jul 2019 10:03:20 +0000 (15:33 +0530)]
bus/dpaa: decrease log level in parsing

This patch removes the unnecessary err prints when using
non-dpaa devices.

Fixes: e79df833d3f6 ("bus/dpaa: support hotplug ops")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agosched: remove redundant macros
Jasvinder Singh [Mon, 22 Jul 2019 11:01:48 +0000 (12:01 +0100)]
sched: remove redundant macros

Remove unused macros from the library, and update release
notes.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
4 years agoexamples/qos_sched: add TC and queue config flexibility
Jasvinder Singh [Mon, 22 Jul 2019 11:01:47 +0000 (12:01 +0100)]
examples/qos_sched: add TC and queue config flexibility

Update qos sched sample app for configuration flexibility of
pipe traffic classes and queues.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
4 years agoexamples/ip_pipeline: add config flexibility to TM
Jasvinder Singh [Mon, 22 Jul 2019 11:01:46 +0000 (12:01 +0100)]
examples/ip_pipeline: add config flexibility to TM

Update ip pipeline sample app for configuration flexiblity of
pipe traffic classes and queues.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
4 years agotest/sched: modify for config flexibility
Jasvinder Singh [Mon, 22 Jul 2019 11:01:45 +0000 (12:01 +0100)]
test/sched: modify for config flexibility

update unit tests for configuration flexibility of pipe traffic
classes and queues size.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
4 years agonet/softnic: add config flexibility to TM
Jasvinder Singh [Mon, 22 Jul 2019 11:01:44 +0000 (12:01 +0100)]
net/softnic: add config flexibility to TM

Update softnic tm function for configuration flexiblity of pipe
traffic classes and queues size.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
4 years agosched: improve doxygen comments
Jasvinder Singh [Mon, 22 Jul 2019 11:01:43 +0000 (12:01 +0100)]
sched: improve doxygen comments

Improve doxygen comments.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
4 years agosched: improve error log messages
Jasvinder Singh [Mon, 22 Jul 2019 11:01:42 +0000 (12:01 +0100)]
sched: improve error log messages

Replace hard-coded numbers for reporting errors with
error messages.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
4 years agosched: rename TC3 params to best-effort TC
Jasvinder Singh [Mon, 22 Jul 2019 11:01:41 +0000 (12:01 +0100)]
sched: rename TC3 params to best-effort TC

Change the traffic class 3 related params name to best-effort(be)
traffic class.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
4 years agosched: add max pipe profiles config in run-time
Jasvinder Singh [Mon, 22 Jul 2019 11:01:40 +0000 (12:01 +0100)]
sched: add max pipe profiles config in run-time

Allow setting the maximum number of pipe profiles in run time.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
4 years agosched: add config flexibility to TC queue sizes
Jasvinder Singh [Mon, 22 Jul 2019 11:01:39 +0000 (12:01 +0100)]
sched: add config flexibility to TC queue sizes

Add support for zero queue sizes of the traffic classes. The queues
which are not used can be set to zero size. This helps in reducing
memory footprint of the hierarchical scheduler.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
4 years agosched: remove WRR from strict priority TC queues
Jasvinder Singh [Mon, 22 Jul 2019 11:01:38 +0000 (12:01 +0100)]
sched: remove WRR from strict priority TC queues

All higher priority traffic classes contain only one queue, thus
remove wrr function for them. The lowest priority best-effort
traffic class conitnue to have multiple queues and packet are
scheduled from its queues using wrr function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Abraham Tovar <abrahamx.tovar@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
4 years agomk: fix custom kernel directory name
Herakliusz Lipiec [Fri, 19 Jul 2019 17:05:43 +0000 (18:05 +0100)]
mk: fix custom kernel directory name

When building dpdk with different kernel headers by specifying
RTE_KERNELDIR igb_uio is compiled to directory with a name of the
version of kernel thats running on the system instead of the one that
dpdk is actually compiled against. Fixed by replacing hardcoded value
with value from RTE_KERNELDIR.

Fixes: 3967af352aeb ("mk: install kernel modules")
Cc: stable@dpdk.org
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agocrypto/dpaa2_sec: fix handling of session init failure
Hemant Agrawal [Wed, 17 Jul 2019 16:22:42 +0000 (21:52 +0530)]
crypto/dpaa2_sec: fix handling of session init failure

The session init shall return failure if the internal
session create fails for any reasons.

Fixes: 13273250eec5 ("crypto/dpaa2_sec: support AES-GCM and CTR")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agotest/crypto: fix session init failure for wireless case
Hemant Agrawal [Wed, 17 Jul 2019 16:22:41 +0000 (21:52 +0530)]
test/crypto: fix session init failure for wireless case

This patch add the support to handle the failure in session
create for wireless related cases. Else it will cause
segment fault due to I/O on un-initialized sessions.

Fixes: b3bbd9e5f2659 ("cryptodev: support device independent sessions")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agoexamples/ipsec-secgw: fix inline test scripts
Bernard Iremonger [Wed, 10 Jul 2019 11:23:10 +0000 (12:23 +0100)]
examples/ipsec-secgw: fix inline test scripts

Remove workaround in tun_aesgcm_defs.sh and trs_aesgcm_defs.sh
to get around the bug where the first inbound packet is dropped
for inline crypto.

Fixes: 929784452094 ("examples/ipsec-secgw: add scripts for functional test")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoexamples/ipsec-secgw: fix first packet with inline crypto
Bernard Iremonger [Fri, 19 Jul 2019 12:22:32 +0000 (17:52 +0530)]
examples/ipsec-secgw: fix first packet with inline crypto

Inline crypto installs a flow rule in the NIC. This flow
rule must be installed before the first inbound packet is
received.

The create_session() function installs the flow rule,
create_session() has been refactored into create_inline_session()
and create_lookaside_session(). The create_inline_session() function
uses the socket_ctx data and is now called at initialisation in
sa_add_rules().

The max_session_size() function has been added to calculate memory
requirements.

The cryprodev_init() function has been refactored to drop calls to
rte_mempool_create() and to drop calculation of memory requirements.

The main() function has been refactored to call max_session_size() and
to call session_pool_init() and session_priv_pool_init() earlier.
The ports are started now before adding a flow rule in main().
The sa_init(), sp4_init(), sp6_init() and rt_init() functions are
now called after the ports have been started.

The rte_ipsec_session_prepare() function is called in fill_ipsec_session()
for inline which is called from the ipsec_sa_init() function.

Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")
Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocryptodev: remove RSA PKCS1 BT0 padding
Arek Kusztal [Thu, 18 Jul 2019 16:09:41 +0000 (18:09 +0200)]
cryptodev: remove RSA PKCS1 BT0 padding

BT0 block type padding after rfc2313 has been discontinued.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agocryptodev: add cipher field to RSA op
Arek Kusztal [Thu, 18 Jul 2019 16:09:38 +0000 (18:09 +0200)]
cryptodev: add cipher field to RSA op

Asymmetric nature of RSA algorithm suggest to use
additional field for output. In place operations
still can be done by setting cipher and message pointers
with the same memory address.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agocryptodev: change RSA API comments about primes
Arek Kusztal [Thu, 18 Jul 2019 16:09:37 +0000 (18:09 +0200)]
cryptodev: change RSA API comments about primes

RSA modulus cannot be prime as its security depends on the problem
of integer factorization.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agodoc: update compressdev guide
Adam Dybkowski [Mon, 15 Jul 2019 12:19:50 +0000 (14:19 +0200)]
doc: update compressdev guide

This patch updates the constant names and function names used
in code snippets in the Compression Device Library documentation.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agotest/crypto: add RSA key type CRT
Ayuj Verma [Thu, 11 Jul 2019 13:22:46 +0000 (18:52 +0530)]
test/crypto: add RSA key type CRT

Added RSA sign/verify and enc/dec tests for RSA
key type CRT(quintuple) and associated test vectors.

Signed-off-by: Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>
Signed-off-by: Ayuj Verma <ayverma@marvell.com>
Signed-off-by: Shally Verma <shallyv@marvell.com>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agotest/crypto: move RSA enqueue/dequeue into functions
Ayuj Verma [Thu, 11 Jul 2019 13:22:45 +0000 (18:52 +0530)]
test/crypto: move RSA enqueue/dequeue into functions

Move common code of enqueue/dequeue into separate functions.

Signed-off-by: Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>
Signed-off-by: Ayuj Verma <ayverma@marvell.com>
Signed-off-by: Shally Verma <shallyv@marvell.com>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agotest/crypto: add capability check for ZUC cases
Damian Nowak [Mon, 15 Jul 2019 12:14:51 +0000 (14:14 +0200)]
test/crypto: add capability check for ZUC cases

This patch adds checking if device support ZUC
algorithms before running ZUC test cases.
It also removes unnecessary checks of digest
appended space and fixes some comments wording.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocompress/qat: fix overflow status return
Tomasz Jozwiak [Fri, 5 Jul 2019 17:15:51 +0000 (18:15 +0100)]
compress/qat: fix overflow status return

This patch fixes fail status returned from compression PMD
in case destination buffer size is not enough to store
all data.

Fixes: 3dc9ef2d23fe ("compress/qat: fix returned status on overflow")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
4 years agotest/compress: clarify out-of-space error messages
Fiona Trahe [Fri, 5 Jul 2019 17:19:10 +0000 (18:19 +0100)]
test/compress: clarify out-of-space error messages

Use ERR rather than INFO to warn that it's a negative test else
the errors are seen but the warning to expect them isn't.
Also add comment to make it easier to follow code.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
4 years agocrypto/qat: fix crashes
Fiona Trahe [Wed, 10 Jul 2019 09:53:24 +0000 (10:53 +0100)]
crypto/qat: fix crashes

Resolution for seg-faults observed:
1) in buffer re-alignment in-place sgl case
2) case where data end is exactly at end of an sgl segment.
Also renamed variable and increased comments for clearer code.

Fixes: 40002f6c2a24 ("crypto/qat: extend support for digest-encrypted auth-cipher")

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Damian Nowak <damianx.nowak@intel.com>
4 years agoexamples/ipsec-secgw: fix --mtu option parsing
Tao Zhu [Thu, 18 Jul 2019 14:21:43 +0000 (14:21 +0000)]
examples/ipsec-secgw: fix --mtu option parsing

This patch add parameter --mtu parse key and enumeration value.

Fixes: b01d1cd213d2 ("examples/ipsec-secgw: support fragmentation and reassembly")

Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agocryptodev: make xform key pointer constant
Fan Zhang [Mon, 24 Jun 2019 13:35:22 +0000 (14:35 +0100)]
cryptodev: make xform key pointer constant

This patch changes the key pointer data types in cipher, auth,
and aead xforms from "uint8_t *" to "const uint8_t *" for a
more intuitive and safe sessionn creation.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Liron Himi <lironh@marvell.com>
4 years agoapp/compress-perf: remove magic numbers
Artur Trybula [Mon, 8 Jul 2019 18:16:19 +0000 (20:16 +0200)]
app/compress-perf: remove magic numbers

This patch fixes some minor problems like 'magic numbers',
spelling mistakes, enumes naming.

Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agoapp/compress-perf: support force process termination
Tomasz Jozwiak [Mon, 8 Jul 2019 18:16:18 +0000 (20:16 +0200)]
app/compress-perf: support force process termination

This patch adds a possibility to force controlled process termination
as a result of two signals: SIGTERM and SIGINT

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agodoc: update compress-perf tool guide
Tomasz Jozwiak [Mon, 8 Jul 2019 18:16:17 +0000 (20:16 +0200)]
doc: update compress-perf tool guide

This patch updates dpdk-test-compress-perf documentation.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agoapp/compress-perf: add benchmark test case
Tomasz Jozwiak [Mon, 8 Jul 2019 18:16:16 +0000 (20:16 +0200)]
app/compress-perf: add benchmark test case

This patch adds a benchmark part to
compression-perf-tool as a separate test case, which can be
executed multi-threaded.
Also updates release notes.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agoapp/compress-perf: add verification test case
Tomasz Jozwiak [Mon, 8 Jul 2019 18:16:15 +0000 (20:16 +0200)]
app/compress-perf: add verification test case

This patch adds a verification part to
compression-perf-tool as a separate test case, which can be
executed multi-threaded.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agoapp/compress-perf: add --ptest option
Tomasz Jozwiak [Mon, 8 Jul 2019 18:16:14 +0000 (20:16 +0200)]
app/compress-perf: add --ptest option

This patch adds --ptest option to make possible to choose
test case from command line.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agoapp/compress-perf: add weak functions for multicore test
Tomasz Jozwiak [Mon, 8 Jul 2019 18:16:13 +0000 (20:16 +0200)]
app/compress-perf: add weak functions for multicore test

This patch adds template functions for multi-cores performance
version of compress-perf-tool

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
4 years agolpm: use atomic store to avoid partial update
Ruifeng Wang [Thu, 18 Jul 2019 06:22:30 +0000 (14:22 +0800)]
lpm: use atomic store to avoid partial update

Compiler could generate non-atomic stores for whole table entry
updating. This may cause incorrect nexthop to be returned, if
the byte with valid flag is updated prior to the byte with nexthop
is updated.
Besides, field by field updating of table entries follow
read-modify-write sequences. The operations are not atomic,
nor efficient. And could cause entries out of synchronization.

Changed to use atomic store to update whole table entry.

Suggested-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Suggested-by: Gavin Hu <gavin.hu@arm.com>
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
4 years agolpm: avoid race conditions for v20
Ruifeng Wang [Thu, 18 Jul 2019 06:22:29 +0000 (14:22 +0800)]
lpm: avoid race conditions for v20

When a tbl8 group is getting attached to a tbl24 entry, lookup
might fail even though the entry is configured in the table.

For ex: consider a LPM table configured with 10.10.10.1/24.
When a new entry 10.10.10.32/28 is being added, a new tbl8
group is allocated and tbl24 entry is changed to point to
the tbl8 group. If the tbl24 entry is written without the tbl8
group entries updated, a lookup on 10.10.10.9 will return
failure.

Correct memory orderings are required to ensure that the
store to tbl24 does not happen before the stores to tbl8 group
entries complete.

Besides, explicit structure alignment is used to address atomic
operation building issue with older version clang.

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
4 years agolpm: avoid race conditions for v1604
Ruifeng Wang [Thu, 18 Jul 2019 06:22:28 +0000 (14:22 +0800)]
lpm: avoid race conditions for v1604

When a tbl8 group is getting attached to a tbl24 entry, lookup
might fail even though the entry is configured in the table.

For ex: consider a LPM table configured with 10.10.10.1/24.
When a new entry 10.10.10.32/28 is being added, a new tbl8
group is allocated and tbl24 entry is changed to point to
the tbl8 group. If the tbl24 entry is written without the tbl8
group entries updated, a lookup on 10.10.10.9 will return
failure.

Correct memory orderings are required to ensure that the
store to tbl24 does not happen before the stores to tbl8 group
entries complete.

The ordering patches in general have no notable impact on LPM
performance test on both Arm A72 platform and x86 E5 platform.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
4 years agolpm: uninline some functions
Ruifeng Wang [Thu, 18 Jul 2019 06:22:27 +0000 (14:22 +0800)]
lpm: uninline some functions

Tests showed that the function inlining caused performance drop
on some x86 platforms with the memory ordering patches applied.
By force no-inline functions, the performance was better than
before on x86 and no impact to arm64 platforms.

Besides inlines of other functions are removed to let compiler
to decide whether to inline.

Suggested-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
4 years agocfgfile: use calloc
Stephen Hemminger [Thu, 18 Jul 2019 17:18:12 +0000 (10:18 -0700)]
cfgfile: use calloc

Better to use calloc when allocating arrays.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agocfgfile: use log for error messages
Stephen Hemminger [Thu, 18 Jul 2019 17:18:11 +0000 (10:18 -0700)]
cfgfile: use log for error messages

In general, DPDK libraries to not print error messages to
stdout because that is often redirected to /dev/null for daemons.
This patch changes cfgfile library to use RTE_LOG with its
own type.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agocfgfile: remove unnecessary initialization
Stephen Hemminger [Thu, 18 Jul 2019 17:18:10 +0000 (10:18 -0700)]
cfgfile: remove unnecessary initialization

No need to initialize variable if it is immediately overwritten.
It is better style not do unnecessary initialization with modern
tools since it lets compiler and other static checkers detect
uninitialized data.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agomaintainers: add Andrew for next-net tree
Ferruh Yigit [Wed, 17 Jul 2019 17:50:20 +0000 (18:50 +0100)]
maintainers: add Andrew for next-net tree

Adding Andrew as co-maintainer to next-net sub-tree.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agomempool/octeontx2: fix possible arm64 ABI break
Pavan Nikhilesh [Thu, 18 Jul 2019 06:51:11 +0000 (12:21 +0530)]
mempool/octeontx2: fix possible arm64 ABI break

Since direct register access is used in npa_lf_aura_op_alloc_bulk()
use __rte_noinline instead of __rte_always_inline to preserve ABI.
Based on the compiler npa_lf_aura_op_alloc_bulk might be inlined
differently which may lead to undefined behaviour due to handcoded
asm.

Fixes: 29893042c29d ("mempool/octeontx2: fix clang build for arm64")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agodoc: add LBK to Marvell OCTEON TX2 guide
Jerin Jacob [Wed, 17 Jul 2019 15:55:19 +0000 (21:25 +0530)]
doc: add LBK to Marvell OCTEON TX2 guide

Add LBK HW block abstraction details and the application
usage models.

This patch also updates missing DPI HW block to DPDK
subsystem mapping as well.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
4 years agodoc: fix PDF build of bbdev prog guide
Thomas Monjalon [Thu, 18 Jul 2019 06:24:39 +0000 (23:24 -0700)]
doc: fix PDF build of bbdev prog guide

Some machine (like on dpdk.org) may fail to build the prog guide PDF
because of a table characher being "+" instead of "|".

Some figure references are also fixed with automatic numbering.

Fixes: 3f3f608142cf ("doc: update bbdev guide for 5GNR operations")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
4 years agokni: fix segmented mbuf data overflow
Ferruh Yigit [Thu, 11 Jul 2019 12:35:07 +0000 (13:35 +0100)]
kni: fix segmented mbuf data overflow

'kni_net_rx_lo_fifo()' can get segmented buffers, using 'pkt_len' for
that case will be wrong and some values can cause buffer overflow
in destination mbuf data.

Fixes: d89a58dfe90b ("kni: support chained mbufs")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agoexamples/performance-thread: init timer subsystem
Erik Gabriel Carrillo [Mon, 15 Jul 2019 15:39:32 +0000 (10:39 -0500)]
examples/performance-thread: init timer subsystem

The timer subsystem should be initialized in the l3fwd-thread app before
the L-thread subsystem can be used.

Fixes: d48415e1fee3 ("examples/performance-thread: add l3fwd-thread app")
Cc: stable@dpdk.org
Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
4 years agotimer: fix null access if not initialized
Erik Gabriel Carrillo [Mon, 15 Jul 2019 15:39:31 +0000 (10:39 -0500)]
timer: fix null access if not initialized

If the timer subsystem is not initialized before rte_timer_manage (for
example) is invoked, a pointer to a shared hugepage memory region will
still be null and dereferenced when it is checked for validity; handle
this case.

Fixes: c0749f7096c7 ("timer: allow management in shared memory")
Cc: stable@dpdk.org
Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
4 years agoexamples/tep_term: remove duplicate definitions
Haiyue Wang [Tue, 16 Jul 2019 17:04:07 +0000 (01:04 +0800)]
examples/tep_term: remove duplicate definitions

The state of virtio device has been defined in both header file and
source file, keep the definition in header file for public use.

Fixes: a50245ede72a ("examples/tep_term: initialize VXLAN sample")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
4 years agoexamples/ip_frag: fix unknown ethernet type
Konstantin Ananyev [Thu, 18 Jul 2019 10:11:13 +0000 (11:11 +0100)]
examples/ip_frag: fix unknown ethernet type

Right now app blindly set IPv4 ether type for all non IPv6 packets.
Instead we can save and later restore original type value.

Fixes: 74de12b7b63a ("examples/ip_fragmentation: overhaul")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoexamples/ip_frag: fix Tx un-fragmented packets
Konstantin Ananyev [Thu, 18 Jul 2019 10:11:12 +0000 (11:11 +0100)]
examples/ip_frag: fix Tx un-fragmented packets

With latest changes l3fwd_simple_forward() blindly set
(PKT_TX_IPV4 | PKT_TX_IP_CKSUM) ol_flags for all IPv4 packets.
Though for un-fragmented packets we also do have to set l3_len
to make HW IP cksum offload to work properly.
That causes HW/PMD to drop or generate invalid packets.
Though for un-fragmented packets we don't need to regenerate
IPv4 cksum, as L3 header is not modified.
Fix by setting ol_flags only when required.

Fixes: 16863bbb4a41 ("examples/ip_fragmentation: enable IP checksum offload")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoexamples/ip_frag: fix use of ethdev internal device array
Marcin Zapolski [Wed, 17 Jul 2019 07:58:05 +0000 (09:58 +0200)]
examples/ip_frag: fix use of ethdev internal device array

Modify ip_fragmentation example app to use rte_eth_info_get instead
of global rte_eth_devices structure.
Apps should not be using internal DPDK data structures directly.

Fixes: 9758b956dcf4 ("examples/ip_fragmentation: fix Tx queues init")
Cc: stable@dpdk.org
Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/ipsec-secgw: fix use of ethdev internal struct
Marcin Zapolski [Wed, 17 Jul 2019 07:58:06 +0000 (09:58 +0200)]
examples/ipsec-secgw: fix use of ethdev internal struct

Modify ipsec-secgw example app to use rte_eth_dev_info_get instead of
rte_eth_dev.
Apps should not be using internal DPDK data structures directly.

Fixes: a4677f78368b ("examples/ipsec-secgw: add target queues in flow actions")
Cc: stable@dpdk.org
Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
4 years agoexamples: fix use of ethdev internal device array
Marcin Zapolski [Wed, 17 Jul 2019 07:58:04 +0000 (09:58 +0200)]
examples: fix use of ethdev internal device array

Modify l3fwd and related example apps to use locally defined port_conf
instead of global rte_eth_devices which is not a part of public API.
Apps should not be using internal DPDK data structures directly.

Fixes: 1ef9600b2d20 ("examples/l3fwd: convert to ethdev offloads API")
Fixes: ba8c103d2455 ("examples/l3fwd-acl: convert to new ethdev offloads API")
Fixes: 40df1d7a695d ("examples/l3fwd-power: convert to new ethdev offloads API")
Fixes: 43fc038262b8 ("examples/l3fwd-vf: convert to new ethdev offloads API")
Fixes: 373149c631fe ("examples/performance-thread: convert to new offloads API")
Cc: stable@dpdk.org
Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
4 years agoexamples/power: fix policy handling for FIFO
David Hunt [Tue, 16 Jul 2019 11:11:12 +0000 (12:11 +0100)]
examples/power: fix policy handling for FIFO

While the core frequency scale-up and scale down all works fine with the
fifo-per-core functionality, there was a gap for policy handling. When
creating or destroying a policy, the core associated with the FIFO
needs to be automatically added to the core list, so the policy is
associated with the correct core.

Fixes: 221e7026d521 ("examples/power: add FIFO per core for JSON interface")

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agoexamples/l3fwd-power: fix busyness number
David Hunt [Mon, 15 Jul 2019 14:07:04 +0000 (15:07 +0100)]
examples/l3fwd-power: fix busyness number

Current implementation only outputs 3 numbers for busyness, 0, 50 and 100.
Fix this so that the 50% is replaced by a curve, more meaningful.
This can be replaced in each use case by a suitable calculation for
that use case.

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

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agodistributor: fix check of workers number
Harman Kalra [Fri, 5 Jul 2019 10:05:12 +0000 (10:05 +0000)]
distributor: fix check of workers number

No of workers should never exceed RTE_MAX_LCORE.
RTE_DIST_ALG_SINGLE also require no of workers check.

Fixes: 775003ad2f96 ("distributor: add new burst-capable library")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: David Hunt <david.hunt@intel.com>
4 years agotest/distributor: fix flush with worker shutdown
Harman Kalra [Fri, 5 Jul 2019 10:05:04 +0000 (10:05 +0000)]
test/distributor: fix flush with worker shutdown

On restarting worker 0 after shutdown, packets handled by
worker 0 must be incremented only when a packet is received by
it.

Fixes: c3eabff124e6 ("distributor: add unit tests")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: David Hunt <david.hunt@intel.com>
4 years agoeal: update comment about --no-huge option
Thomas Monjalon [Wed, 17 Jul 2019 08:56:24 +0000 (10:56 +0200)]
eal: update comment about --no-huge option

The old comment, on top of the function rte_eal_has_hugepages(),
is really outdated and not generic enough.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agohash: flush rings instead of dequeuing one by one
Gavin Hu [Tue, 16 Jul 2019 19:23:56 +0000 (03:23 +0800)]
hash: flush rings instead of dequeuing one by one

Within rte_hash_reset, calling a while loop to dequeue one by
one from the ring, while not using them at all, is wasting cycles,
The patch just flush the ring by resetting the indices can save CPU
cycles.

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>