dpdk.git
5 years agonet/iavf: fix Rx bytes stats
Qi Zhang [Wed, 17 Jul 2019 04:31:00 +0000 (12:31 +0800)]
net/iavf: fix Rx bytes stats

Exclude 4 bytes CRC for rx bytes stats.
This also aligned Rx stats calculation with PF.

Fixes: f4a41a6953af ("net/avf: support stats")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agonet/failsafe: skip devargs if not present in secondary
Stephen Hemminger [Fri, 21 Jun 2019 22:08:24 +0000 (15:08 -0700)]
net/failsafe: skip devargs if not present in secondary

When secondary process is run was noticing that the log always
contained complaints about unable to parse devargs.

It turns out that an empty devargs turns into "" and this
value is not parsable. Change the failsafe secondary to just
skip doing devargs if it empty.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/bonding: use dynamic log type for error message
Stephen Hemminger [Tue, 16 Jul 2019 20:39:10 +0000 (13:39 -0700)]
net/bonding: use dynamic log type for error message

The generic RTE_LOGTYPE_PMD is a historical relic and should
not be used. Bonding driver was still using it in one place.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: add option to not start device
Stephen Hemminger [Tue, 16 Jul 2019 18:42:34 +0000 (11:42 -0700)]
app/testpmd: add option to not start device

Some configuration options can not be tested properly with testpmd
because it automatically starts all ports. This makes it harder
to test driver handling of configuration options:
(for example rx_deferred_start).

Add new command line flag --disable-device-start which skips
the device start. The port can then be started manually later.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bnxt: check invalid VNIC id for firmware
Jay Ding [Wed, 17 Jul 2019 10:41:39 +0000 (16:11 +0530)]
net/bnxt: check invalid VNIC id for firmware

Add checking for vnic id before sending message to chimp in
bnxt_hwrm_vnic_plcmode_cfg().

Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")
Cc: stable@dpdk.org
Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
5 years agonet/bnxt: fix RxQ count if ntuple filtering is disabled
Qingmin Liu [Wed, 17 Jul 2019 10:41:38 +0000 (16:11 +0530)]
net/bnxt: fix RxQ count if ntuple filtering is disabled

If ntuple filtering is disabled, FW will return max_vnics=1.
Due to this only single Rxq is created.
Change to max_rx_rings = RTE_MIN(bp->max_rx_rings, bp->max_stat_ctx) to
fix it.

Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled")
Cc: stable@dpdk.org
Signed-off-by: Qingmin Liu <qingmin.liu@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
5 years agonet/bnxt: fix compiler warning
Ajit Khaparde [Wed, 17 Jul 2019 10:41:37 +0000 (16:11 +0530)]
net/bnxt: fix compiler warning

Compiler complains of an uninitialized variable.
Initializing it to avoid the issue.

Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
5 years agonet/bnxt: check invalid VNIC in cleanup path
Kalesh AP [Wed, 17 Jul 2019 10:41:36 +0000 (16:11 +0530)]
net/bnxt: check invalid VNIC in cleanup path

The cleanup/rollback operation post rte_eth_dev_start failure might end
up invoking an HWRM cmd even on an invalid vNIC resulting in error
messages being logged needlessly.
Fix to check for the same before issuing the HWRM cmd.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: fix enabling/disabling interrupts
Kalesh AP [Wed, 17 Jul 2019 10:41:35 +0000 (16:11 +0530)]
net/bnxt: fix enabling/disabling interrupts

1. Disable interrupts in dev_stop_op()
2. Enable interrupts in dev_start_op()
3. Clean queue intr-vector mapping in dev_stop_op() and thus
   fix a possible memory leak.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: avoid null pointer dereference
Lance Richardson [Wed, 17 Jul 2019 10:41:34 +0000 (16:11 +0530)]
net/bnxt: avoid null pointer dereference

Avoid null pointer dereference when allocating an insulated
completion ring by basing nq ring allocation on whether an
nq ring was requested instead of whether the device supports
nq rings.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: cleanup NQ doorbell
Lance Richardson [Wed, 17 Jul 2019 10:41:33 +0000 (16:11 +0530)]
net/bnxt: cleanup NQ doorbell

Simplify nq doorbell handling code by removing redundant db
parameter and consolidating NQ doorbell macro into the inline
function that uses it.

Add "enable interrupt" variant of nq write. This will be used
in a subsequent commit.

When initializing nq doorbell, don't assume that only the
"disable interrupt" form will be used.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: save the number of EM flow count
Ajit Khaparde [Wed, 17 Jul 2019 10:41:32 +0000 (16:11 +0530)]
net/bnxt: save the number of EM flow count

Save the number of EM flow count returned by the FW in HWRM_FUNC_QCFG
and use it to calculate the overall pool of L2 contexts supported by FW.

Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
5 years agonet/bnxt: fix doorbell register offset for Tx ring
Ajit Khaparde [Wed, 17 Jul 2019 10:41:31 +0000 (16:11 +0530)]
net/bnxt: fix doorbell register offset for Tx ring

For Tx-ring # 104 and higher, the doorbell register was incorrectly
configured due to which FW was not able to receive the notification
of packet to transmit.
With this fix, user can run traffic upto 256 rings.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix L4 checksum error indication in Rx
Rahul Gupta [Wed, 17 Jul 2019 10:41:30 +0000 (16:11 +0530)]
net/bnxt: fix L4 checksum error indication in Rx

Update ol_flags correctly for checksum errors in case of tunnel and
non-tunnel packet.

Fixes: 65ee636872eb ("net/bnxt: fix Rx checksum flags")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: reset Rx allocation state on port restart
Lance Richardson [Wed, 17 Jul 2019 10:41:29 +0000 (16:11 +0530)]
net/bnxt: reset Rx allocation state on port restart

Move call site of bnxt_rxq_vec_setup() to ensure that rxq->rxrearm_nb
and rxq->rxrearm_start are reinitialized correctly when a port is
restarted.

Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Christopher Reder <christopher.reder@broadcom.com>
5 years agonet/bnxt: fix Tx hang after port stop/start
Lance Richardson [Wed, 17 Jul 2019 10:41:28 +0000 (16:11 +0530)]
net/bnxt: fix Tx hang after port stop/start

Initialize the state of the completion valid indicator
when a completion ring is freed, otherwise completions may
not be processed when a new ring is allocated.

Fixes: 5735eb241947 ("net/bnxt: support Tx batching")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
5 years agonet/bnxt: fix VF probe when MAC address is zero
Kalesh AP [Wed, 17 Jul 2019 10:41:27 +0000 (16:11 +0530)]
net/bnxt: fix VF probe when MAC address is zero

VF driver should not fail probe if the host PF driver has not assigned
any MAC address for the VF. It should generate a random MAC address and
configure the MAC and then continue probing the device.

Fixes: be160484a48d ("net/bnxt: check if MAC address is all zeros")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix crash on probe failure
Kalesh AP [Wed, 17 Jul 2019 10:41:26 +0000 (16:11 +0530)]
net/bnxt: fix crash on probe failure

Fixed couple of possible segfaults due to NULL pointer
dereference in case of probe failure.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix extended port counter statistics
Kalesh AP [Wed, 17 Jul 2019 10:41:25 +0000 (16:11 +0530)]
net/bnxt: fix extended port counter statistics

1. refactor stats allocation code to new routine
2. check for extended statistics support depends on "hwrm_spec_code"
   which is set in bnxt_hwrm_ver_get called later. Hence we were never
   querying extended port stats as flags field was not updated. Fixed
   this by moving the stats allocation after the call to
   bnxt_hwrm_ver_get.
3. we were incorrectly passing the host address used for port
   statistics to PORT_QSTATS_EXT command. Fixed this by passing the
   correct extended stats address.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agoapp/testpmd: add device related commands
Nithin Dabilpuram [Wed, 17 Jul 2019 12:30:55 +0000 (18:00 +0530)]
app/testpmd: add device related commands

With the latest published interface of
rte_eal_hotplug_[add,remove](), and rte_eth_dev_close(),
rte_eth_dev_close() would cleanup all the data structures of
port's eth dev leaving the device common resource intact
if RTE_ETH_DEV_CLOSE_REMOVE is set in dev flags.

So a new command "detach device" (~hotplug remove) to work,
with device identifier like "port attach" is added
to be able to detach closed devices.

Also to display currently probed devices, another command
"show device info <identifier>|all" is also added as a
part of this change.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: add GRE key for raw encap/decap
Xiaoyu Min [Wed, 17 Jul 2019 12:27:10 +0000 (20:27 +0800)]
app/testpmd: add GRE key for raw encap/decap

GRE key (rte_flow_item_type_gre_key) is also needed in
raw encapsulation/decapsulation.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: support MPLS TC and S bits
Xiaoyu Min [Wed, 17 Jul 2019 12:27:09 +0000 (20:27 +0800)]
app/testpmd: support MPLS TC and S bits

Open the MPLS's TC and S bits of rte_flow_item_mpls in command line.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: support raw encap/decap actions
Xiaoyu Min [Wed, 17 Jul 2019 12:27:08 +0000 (20:27 +0800)]
app/testpmd: support raw encap/decap actions

This patch intend to support
action_raw_encap/decap [1] in a generic and convenient way.

Two new commands - set raw_encap, set raw_decap are introduced just
like the other commands for encap/decap, i.e. set vxlan.

These two commands have corresponding global buffers
which can be used by PMD as the input buffer for raw encap/decap.

The commands use the rte_flow pattern syntax to help user build the
raw buffer in a convenient way.

A common way to use it:

- encap matched egress packet with VxLAN tunnel:
testpmd> set raw_encap eth src is 10:11:22:33:44:55 / vlan tci is 1
 inner_type is 0x0800 / ipv4 / udp dst is 4789 / vxlan vni
 is 2 / end_set
testpmd> flow create 0 egress pattern eth / ipv4 / end actions
 raw_encap / end

- decap l2 header and encap GRE tunnel on matched egress packet:
testpmd> set raw_decap eth / end_set
testpmd> set raw_encap eth dst is 10:22:33:44:55:66 / ipv4 / gre
 protocol is 0x0800 / end_set
testpmd> flow create 0 egress pattern eth / ipv4 / end actions
 raw_decap / raw_encap / end

- decap VxLAN tunnel and encap l2 header on matched ingress packet:
testpmd> set raw_encap eth src is 10:11:22:33:44:55 type is 0x0800 /
 end_set
testpmd> set raw_decap eth / ipv4 / udp / vxlan / end_set
testpmd> flow create 0 ingress pattern eth / ipv4 / udp dst is 250 /
         vxlan vni is 0x1234 / ipv4 / end actions raw_decap /
         raw_encap / queue index 1 / mark id 0x1234 / end

[1] http://mails.dpdk.org/archives/dev/2018-October/116092.html

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: move VXLAN/NVGRE help in filters section
Xiaoyu Min [Wed, 17 Jul 2019 12:27:07 +0000 (20:27 +0800)]
app/testpmd: move VXLAN/NVGRE help in filters section

The help string of set vxlan*, set nvgre* are in "config" section.
But they actually do not alter NIC or testpmd's configuration and
they will be used by "flow" command later.

Put them in "filters" section along with "flow" command seems more
reasonable.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/pcap: remove Rx queue argument necessity
Aideen McLoughlin [Wed, 17 Jul 2019 08:08:46 +0000 (09:08 +0100)]
net/pcap: remove Rx queue argument necessity

Previously in the PCAP PMD queues has to be defined as RxQ and TxQ
pairs, even if the need is only Rx or only Tx:
 "--vdev net_pcap0,tx_pcap=tx.pcap,rx_pcap=rx.pcap"

Following commit enabled only providing Rx queue, and if Tx queue is
not provided PMD drops the Tx packets automatically:
Commit a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")
 "--vdev net_pcap0,rx_pcap=rx.pcap"

This commit enables same thing for Rx queue, user no more have to
provide a Rx queue (rx_iface or rx_pcap), for this case a dummy Rx
burst function is used which doesn't return any packet at all:
 "--vdev net_pcap0,tx_pcap=tx.pcap"

This makes only saving packets to a pcap file use case easy.

When both Rx and Tx queues are missing PMD will return an error.
(Single interface is still supported: "--vdev net_pcap0,iface=eth0")

Signed-off-by: Aideen McLoughlin <aideen.mcloughlin@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ena: fix admin CQ polling for 32-bit
David Harton [Fri, 12 Jul 2019 17:35:43 +0000 (13:35 -0400)]
net/ena: fix admin CQ polling for 32-bit

Recent modifications to admin command queue polling logic
did not support 32-bit applications.  Updated the driver to
work for 32 or 64 bit applications

Fixes: 3adcba9a8987 ("net/ena: update HAL to the newer version")
Cc: stable@dpdk.org
Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
5 years agoapp/testpmd: fix show port info routine
Viacheslav Ovsiienko [Tue, 16 Jul 2019 10:34:34 +0000 (10:34 +0000)]
app/testpmd: fix show port info routine

This patch updates "show port info [port_id]" command to display
the tx_desc_lim.nb_seg_max and tx_desc_lim.nb_mtu_seg_max fields
of rte_eth_dev_info structure.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agonet/mlx5: allow basic counter management fallback
Matan Azrad [Tue, 16 Jul 2019 14:34:56 +0000 (14:34 +0000)]
net/mlx5: allow basic counter management fallback

In case the asynchronous devx commands are not supported in RDMA core
fallback to use a basic counter management.

Here, the PMD counters cashe is redundant and the host thread doesn't
update it. hence, each counter operation will go to the FW and the
acceleration reduces.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: accelerate DV flow counter query
Matan Azrad [Tue, 16 Jul 2019 14:34:55 +0000 (14:34 +0000)]
net/mlx5: accelerate DV flow counter query

All the DV counters are cashed in the PMD memory and are contained in
pools which are contained in containers according to the counters
allocation type - batch or single.

Currently, the flow counter query is done synchronously in pool
resolution means that on the user request a FW command is triggered to
read all the counters in the pool.

A new feature of devX to asynchronously read batch of flow counters
allows to accelerate the user query operation.

Using the DPDK host thread, the PMD periodically triggers asynchronous
query in pool resolution for all the counter pools and an interrupt is
triggered by the FW when the values are updated.
In the interrupt handler the pool counter values raw data is replaced
using a double buffer algorithm (very fast).
In the user query, the PMD just returns the last query values from the
PMD cache - no system-calls and FW commands are triggered from the user
control thread on query operation!

More synchronization is added with the host thread:
        Container resize uses double buffer algorithm.
        Pools growing in container uses atomic operation.
        Pool query buffer replace uses a spinlock.
        Pool minimum devX counter ID uses atomic operation.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: resize a full counter container
Matan Azrad [Tue, 16 Jul 2019 14:34:54 +0000 (14:34 +0000)]
net/mlx5: resize a full counter container

When the counter countainer has no more space to store more counter
pools try to resize the container to allow more pools to be created.

So, the only limitation for the maximum counter number is the memory.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: accelerate DV flow counter transactions
Matan Azrad [Tue, 16 Jul 2019 14:34:53 +0000 (14:34 +0000)]
net/mlx5: accelerate DV flow counter transactions

The DevX interface exposes a new feature to the PMD that can allocate a
batch of counters by one FW command. It can improve the flow
transaction rate (with count action).

Add a new counter pools mechanism to manage HW counters in the PMD.
So, for each flow with counter creation the PMD will try to find a free
counter in the PMD pools container and only if there is no a free
counter, it will allocate a new DevX batch counters.

Currently we cannot support batch counter for a group 0 flow, so
create a 2 container types, one which allocates counters one by
one and one which allocates X counters by the batch feature.

The allocated counters objects are never released back to the HW
assuming the flows maximum number will be close to the actual value of
the flows number.
Later, it can be updated, and dynamic release mechanism can be added.

The counters are contained in pools, each pool with 512 counters.
The pools are contained in counter containers according to the
allocation resolution type - single or batch.
The cache memory of the counters statistics is saved as raw data per
pool.
All the raw data memory is allocated for all the container in one
memory allocation and is managed by counter_stats_mem_mng structure
which registers all the raw memory to the HW.
Each pool points to one raw data structure.

The query operation is in pool resolution which updates all the pool
counter raw data by one operation.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/ifc: add devargs pointer check
Xiao Wang [Tue, 16 Jul 2019 11:31:07 +0000 (19:31 +0800)]
net/ifc: add devargs pointer check

We need to check devargs pointer before dereference it, if no devargs
specified then this driver just skips the device.

Fixes: 40ef35f4a504 ("net/ifc: detect if VDPA mode is specified")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ena: update version to 2.0.1
Michal Krawczyk [Tue, 16 Jul 2019 11:13:32 +0000 (13:13 +0200)]
net/ena: update version to 2.0.1

In 2.0.1 ENA, there were patches for:
  * assigning NUMA node to the IO queue
    commit 4217cb0b7d2c ("net/ena: fix assigning NUMA node to IO queue")
  * statistics counters (Rx checksum errors and per-queue number of the
    Tx packets)
    commit ef74b5f7b69b ("net/ena: fix Rx checksum errors statistics")
    commit 5673e285a633 ("net/ena: fix Tx statistics")
  * SMP support
    commit 117ba4a60488 ("net/ena: get device info statically")
  * setting Rx checksum support
    commit ef538c1a7f56 ("net/ena: fix checksum feature flag")

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
5 years agonet/ice: fix outer input set empty
Qiming Yang [Tue, 16 Jul 2019 02:38:55 +0000 (10:38 +0800)]
net/ice: fix outer input set empty

Should allow the outer input set be empty.

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>
5 years agonet/iavf: fix driver crash when enable TSO
Ting Xu [Tue, 16 Jul 2019 16:12:25 +0000 (16:12 +0000)]
net/iavf: fix driver crash when enable TSO

The iavf driver crashes when forwarding packets with TSO
enabled. The reason is that the tx context descriptor
configuration is not transferred to tx-ring. This step is
added in this patch.

Fixes: a2b29a7733ef ("net/avf: enable basic Rx Tx")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/pcap: fix single iface support
Aideen McLoughlin [Tue, 16 Jul 2019 14:26:21 +0000 (15:26 +0100)]
net/pcap: fix single iface support

Because of the commit mentioned below the default case was changed and
this broke single_iface support. This patch adds a check to fix
single_iface support.

Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")

Signed-off-by: Aideen McLoughlin <aideen.mcloughlin@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/pcap: fix possible mbuf double freeing
Aideen McLoughlin [Thu, 11 Jul 2019 13:59:46 +0000 (14:59 +0100)]
net/pcap: fix possible mbuf double freeing

In the eth_pcap_tx() and eth_pcap_tx_dumper() functions mbufs were freed
without incrementing num_tx.
This may lead application also try to free or use invalid mbuf.

To fix the issue, the mbuf freeing was removed.

Fixes: 6db141c91e1f ("pcap: support jumbo frames")
Cc: stable@dpdk.org
Signed-off-by: Aideen McLoughlin <aideen.mcloughlin@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bnxt: create ring group array only when needed
Lance Richardson [Wed, 10 Jul 2019 17:11:19 +0000 (13:11 -0400)]
net/bnxt: create ring group array only when needed

Fix an overrun of the ring group array with BCM5750X-based
adapters by ensuring that the ring group array is not allocated
or accessed for adapters that do not support ring groups.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: fix logic when freeing RSS context
Lance Richardson [Wed, 10 Jul 2019 14:24:09 +0000 (10:24 -0400)]
net/bnxt: fix logic when freeing RSS context

The conditional used to determine whether freeing RSS
contexts for thor vs. non-thor controller was reversed.
Fix this, also reset number of active RSS contexts to
zero after release in the thor case.

Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet: adjust L2 length on soft VLAN insertion
Dilshod Urazov [Mon, 24 Jun 2019 13:46:02 +0000 (14:46 +0100)]
net: adjust L2 length on soft VLAN insertion

Layer 2 length must be updated after the prepend to mbuf to keep
the length right to be used by other Tx offloads.

If the packet has tunnel encapsulation, outer_l2_len should be
updated. Otherwise l2_len should be updated.

Fixes: c974021a5949 ("ether: add soft vlan encap/decap")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
5 years agonet/enic: remove PMD log type references
John Daley [Tue, 16 Jul 2019 05:37:20 +0000 (22:37 -0700)]
net/enic: remove PMD log type references

Don't use RTE_LOGTYPE_PMD as it is too general.

Also, just use 1 log type for all of enic PMD (pmd.net.enic)

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agonet/hinic: fix implicit downcast of bitfield
Ziyang Xuan [Tue, 16 Jul 2019 03:59:28 +0000 (11:59 +0800)]
net/hinic: fix implicit downcast of bitfield

There are some implicit downcast errors in TX offload information
parsing by lgtm tool. This patch is to solve these errors.

Fixes: 64727024d2fd ("net/hinic: add device initialization")

Signed-off-by: Ziyang Xuan <xuanziyang2@huawei.com>
5 years agonet/octeontx2: support flow API flags based extraction
Kiran Kumar K [Mon, 15 Jul 2019 05:05:55 +0000 (10:35 +0530)]
net/octeontx2: support flow API flags based extraction

Adding support for flags based extraction in octeontx2 Flow.
Patch supports extracting data greater than 32 bytes using lflags.
When flags based extraction is enabled, lower 4 bits will be
considered (16 flags) for indexing the flags, and will be used
for extraction.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>