dpdk.git
7 years agovhost: add flag to enable IOMMU support
Maxime Coquelin [Mon, 6 Nov 2017 20:38:11 +0000 (21:38 +0100)]
vhost: add flag to enable IOMMU support

Qemu versions from v2.7.0 to v2.9.0 have their reply-ack protocol
feature implementation broken with multiqueue. The reply-ack
protocol feature is optional except for IOMMU feature.

This patch introduce a new RTE_VHOST_USER_IOMMU_SUPPORT flag to
enable VIRTIO_F_IOMMU_PLATFORM virtio feature.

By default, the IOMMU support is now disabled.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
Tested-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
7 years agovhost: disable reply-ack feature if IOMMU disabled
Maxime Coquelin [Mon, 6 Nov 2017 20:38:10 +0000 (21:38 +0100)]
vhost: disable reply-ack feature if IOMMU disabled

If the application has disabled VIRTIO_F_IOMMU_PLATFORM, disable
VHOST_USER_PROTOCOL_F_REPLY_ACK protocol feature that is only
mandatory with IOMMU for now.

This is done to provide a way for the application to support
multiqueue with old Qemu versions (v2.7.0 to v2.9.0) that have
reply-ack feature broken.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
Tested-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
7 years agonet/mlx5: fix socket field initialization
Olivier Gournet [Tue, 7 Nov 2017 09:59:37 +0000 (10:59 +0100)]
net/mlx5: fix socket field initialization

Fixes: a1366b1a2be3 ("net/mlx5: add reference counter on DPDK Rx queues")

Signed-off-by: Olivier Gournet <ogournet@corp.free.fr>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: enhance Rx packet type offloads
Moti Haimovsky [Sun, 5 Nov 2017 17:26:56 +0000 (19:26 +0200)]
net/mlx4: enhance Rx packet type offloads

This patch enhances the Rx packet type offload to also report the L4
protocol information in the hw ptype filled by the PMD for each received
packet.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/pcap: fix memory leak in dumper open
Stefan Baranoff [Sun, 5 Nov 2017 17:24:45 +0000 (12:24 -0500)]
net/pcap: fix memory leak in dumper open

In open_single_tx_pcap there is a call to pcap_open_dead which calls
malloc to create and return a pcap_t. That object is never freed in
this case. Other places it is freed by passing it back similar to the
way the pcap_dumper_t is in this case.

The pcap_t is only used to create the pcap_dumper_t and is never used
again so freeing it here is safe and much simpler than trying to pass
it back to be freed in eth_dev_stop along with the other
pcap_t/pcap_dumper_t objects.

Fixes: 4c173302c307 ("pcap: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Stefan Baranoff <sbaranoff@gmail.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/kni: remove driver struct forward declaration
Rami Rosen [Sat, 4 Nov 2017 12:03:49 +0000 (14:03 +0200)]
net/kni: remove driver struct forward declaration

This patch removes the forward declaration of eth_kni_drv
in rte_eth_kni.c; this forward declaration was made unnecessary
by commit 050fe6e9ff970ff92d842912136be8f9f52e171f
("drivers/net: use ethdev allocation helper for vdev"), which
removes the usage of eth_kni_drv in the eth_kni_create() method.

Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for vdev")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/mlx5: fix flow creation on port start
Shahaf Shuler [Mon, 6 Nov 2017 14:00:25 +0000 (16:00 +0200)]
net/mlx5: fix flow creation on port start

While the PMD avoids from creating hash RXQ with no hash fields and
array of queues after the port was already started, it lacks such
protection when re-creating the flows after the port restarts.

This may lead to inconsistent behavior for flows depending if they were
created before or after the port start.

Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agodoc: update mlx5 guide
Shahaf Shuler [Mon, 30 Oct 2017 10:58:25 +0000 (12:58 +0200)]
doc: update mlx5 guide

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/igb: fix Rx interrupt with VFIO and MSI-X
Xiaoyun Li [Mon, 6 Nov 2017 02:41:40 +0000 (10:41 +0800)]
net/igb: fix Rx interrupt with VFIO and MSI-X

When using VFIO and MSIX interrupt mode, cannot get Rx interrupts. Because
when enabling the interrupt vectors, the offset is computed in a way which
only supports IGB_UIO. But the offset should be different when using VFIO.
This patch fixes this issue.

Fixes: c3cd3de0ab50 ("igb: enable Rx queue interrupts for PF")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agoexamples/flow_classify: fix fseek error handling
Bernard Iremonger [Wed, 1 Nov 2017 12:10:29 +0000 (12:10 +0000)]
examples/flow_classify: fix fseek error handling

Check return value of fseek and exit if non zero.

Coverity issue: 143435
Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
7 years agoexamples/l3fwd: fix aliasing in port grouping
Guduri Prathyusha [Fri, 3 Nov 2017 10:43:51 +0000 (16:13 +0530)]
examples/l3fwd: fix aliasing in port grouping

With -f-strict-aliasing enabled by default from -O2, gcc > 5.x gives
undefined behavior in port_groupx4 in ARM. 'pn' and 'pnum' are
two different pointers pointing to same chunk of memory and
with -f-strict-aliasing the pointers are assumed to be pointing to
different memory and compiler reorders instructions that depend on
pnum and pn. This breaks port grouping algorithm.

This patch eliminates the above problem by introducing a compiler
barrier between the instructions that depend on pnum, pn and lp.

Fixes: 569b290cdb36 ("examples/l3fwd: add NEON implementation")
Cc: stable@dpdk.org
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
7 years agoexamples/l3fwd: fix NEON instructions
Guduri Prathyusha [Mon, 30 Oct 2017 07:31:26 +0000 (13:01 +0530)]
examples/l3fwd: fix NEON instructions

To group consecutive packets with same destination port in bursts of 4
neon intrinsic data types dp1 and dp2 are calculated such that if
dst_port[]={a,b,c,d,e,f,g,h,i...} dp1 should contain: <a,b,c,d> and
dp2 should contain: <b,c,d,e> in the first iteration. dp1 should
be <e,f,g,h> and dp2 should be <f,g,h,i> in the next iteration.

Whereas the existing code incorrectly calculates dp1 as <d,e,f,g> from
second iteration.

This patch fixes the incorrect ARM NEON instructions on dp1.

Fixes: 569b290cdb36 ("examples/l3fwd: add NEON implementation")
Cc: stable@dpdk.org
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agoexamples/ip_pipeline: use crc32 in hash functions for arm64
Jianbo Liu [Fri, 27 Oct 2017 09:25:18 +0000 (17:25 +0800)]
examples/ip_pipeline: use crc32 in hash functions for arm64

Implement the same hash functions with crc32 on arm platform.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agoexamples/ip_pipeline: avoid hash table create failure
Jianbo Liu [Fri, 27 Oct 2017 02:55:19 +0000 (10:55 +0800)]
examples/ip_pipeline: avoid hash table create failure

Hash table function will check if the input bucket size is power of 2,
so the parameter should be rounded up before sending to the creating
function.

Signed-off-by: Jianbo Liu <jianbo.liu@arm.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agoapp/crypto-perf: fix crypto op init
Pablo de Lara [Mon, 6 Nov 2017 09:36:04 +0000 (09:36 +0000)]
app/crypto-perf: fix crypto op init

The mempool and the physical address of the crypto operation
at mempool initialization were not being set,
leading to incorrect physical addresses.

Fixes: bf9d6702eca9 ("app/crypto-perf: use single mempool")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agodoc: fix description of TM function in testpmd
Jasvinder Singh [Thu, 26 Oct 2017 11:06:50 +0000 (12:06 +0100)]
doc: fix description of TM function in testpmd

Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agoapp/testpmd: fix potential memory leak
Kirill Rybalchenko [Thu, 2 Nov 2017 10:13:41 +0000 (10:13 +0000)]
app/testpmd: fix potential memory leak

Fix potential memory leak in cmd_ddp_info_parsed() function.

Coverity issue: 195044
Fixes: a8e005696c7b ("app/testpmd: get ddp profile protocol info")

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoapp/testpmd: fix a typo in a command description
Pavel Shirshov [Mon, 30 Oct 2017 06:56:36 +0000 (23:56 -0700)]
app/testpmd: fix a typo in a command description

Fixes: 26faac80327f ("app/testpmd: unify help strings")
Cc: stable@dpdk.org
Signed-off-by: Pavel Shirshov <pavel.shirshov@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoapp/testpmd: allow TM hierarchy commit on running port
Jasvinder Singh [Fri, 27 Oct 2017 09:46:19 +0000 (10:46 +0100)]
app/testpmd: allow TM hierarchy commit on running port

Some drivers might allow to commit the traffic management hierarchy
while being in running state. Therefore, removes port status check
before invoking hierarchy commit API in the cli. If needed, device can
add port status check at the driver layer.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoapp/testpmd: fix memory access error for metering CLI
Jasvinder Singh [Fri, 27 Oct 2017 09:17:35 +0000 (10:17 +0100)]
app/testpmd: fix memory access error for metering CLI

Fix memory access (out of bounds write) error, color and
action assignments.

Coverity issue: 198437
Fixes: 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoapp/testpmd: fix null pointer dereference
Jasvinder Singh [Fri, 27 Oct 2017 09:10:18 +0000 (10:10 +0100)]
app/testpmd: fix null pointer dereference

malloc() function might returns NULL when memory allocation fails
due to insufficient space. Therefore, check for handling memory allocation
failure is added.

Coverity issue: 198442,198444
Fixes: 996cb153af06 ("app/testpmd: add commands for TM nodes and hierarchy commit")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/failsafe: fix VLAN stripping configuration
Ophir Munk [Thu, 2 Nov 2017 17:27:03 +0000 (17:27 +0000)]
net/failsafe: fix VLAN stripping configuration

failsafe device has vlan stripping configured at startup however once
a sub device is found as non-capable of vlan-stripping failsafe
updates it configuration and removes vlan stripping from it.
This update occurs only once at startup. Following a later plugin
attempt and in case of vlan stripping mismatch between failsafe
configuration and device capability - failsafe cannot recover and the
device remains constantly in plug out state.

The sequence of events leading to this situation is described as
follows:
1. Start testpmd with failsafe where mlx4 is a sub device (not capable
of vlan stripping). Expected printout:
PMD: net_failsafe: Disabling VLAN stripping offload
2. Execute:
testpmd> port stop all
testpmd> port config all max-pkt-len 2048
testpmd> port start all
3. Do a plug out (e.g. disable sriov)
4. Do a plug in (e.g. enable sriov)
5. Expected result: failsafe successfully configures and starts its sub
devices
Actual result: failsafe is continuously failing with these messages:
PMD: net_failsafe: VLAN stripping offload requested but not supported by
sub_device 0
PMD: net_failsafe: device already configured, cannot fix live
configuration
PMD: net_failsafe: Unable to synchronize sub device state

Root cause analysis: at startup failsafe removes vlan stripping from its
configuration. After executing "port config all max-pkt-len 2048"
testpmd marks failsafe in need for configuration update.
After executing "port start all" testpmd overrides failsafe
configuration with its own configuration which includes vlan stripping

During the plugin attempt failsafe refuses to update its configuration
by removing vlan stripping since it has already updated its
configuration at startup.

The fix is for failsafe to stop validation and disabling non-supported
offloads in its sub-devices.

Fixes: bbc6a53dda44 ("net/failsafe: support Rx offload capabilities")
Cc: stable@dpdk.org
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
7 years agonet/mlx5: fix some typos
Thomas Monjalon [Thu, 2 Nov 2017 19:31:58 +0000 (20:31 +0100)]
net/mlx5: fix some typos

Fixes: 570acdb1da8a ("net/mlx5: add vectorized Rx/Tx burst for ARM")
Fixes: 3c2ddbd413e3 ("net/mlx5: separate shareable vector functions")
Fixes: f8b9a3bad467 ("net/mlx5: install a socket to exchange a file descriptor")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agodoc: add i40e limitation of VF VLAN strip
Beilei Xing [Fri, 3 Nov 2017 03:40:56 +0000 (11:40 +0800)]
doc: add i40e limitation of VF VLAN strip

This patch adds limitation of VF VLAN strip function.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/mlx4: share memory region resources
Adrien Mazarguil [Thu, 2 Nov 2017 18:14:22 +0000 (19:14 +0100)]
net/mlx4: share memory region resources

Memory regions assigned to hardware and used during Tx/Rx are mapped to
mbuf pools. Each Rx queue creates its own MR based on the mempool
provided during queue setup, while each Tx queue looks up and registers
MRs for all existing mbuf pools instead.

Since most applications use few large mbuf pools (usually only a single
one per NUMA node) common to all Tx/Rx queues, the above approach wastes
hardware resources due to redundant MRs. This negatively affects
performance, particularly with large numbers of queues.

This patch therefore makes the entire MR registration common to all
queues using a reference count. A spinlock is added to protect against
asynchronous registration that may occur from the Tx side where new
mempools are discovered based on mbuf data.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: fix function prototypes
Adrien Mazarguil [Thu, 2 Nov 2017 18:14:19 +0000 (19:14 +0100)]
net/mlx4: fix function prototypes

This is done for consistency with the rest of the code.

Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: mitigate Tx path memory barriers
Matan Azrad [Thu, 2 Nov 2017 16:42:51 +0000 (16:42 +0000)]
net/mlx4: mitigate Tx path memory barriers

Replace most of the memory barriers by IO memory barriers since they
are all targeted to the DRAM; This improves code efficiency for
systems which force store order between different addresses.

Only the doorbell register store should be protected by memory barrier
since it is targeted to the PCI memory domain.

Limit pre byte count store IO memory barrier for systems with cache
line size smaller than 64B (TXBB size).

This patch improves Tx performance by 0.2MPPS for one segment 64B
packets via 1 queue with 1 core test.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: fix HW memory optimizations careless
Matan Azrad [Thu, 2 Nov 2017 16:42:50 +0000 (16:42 +0000)]
net/mlx4: fix HW memory optimizations careless

Volatilize all Rx/Tx HW negotiation memories to be sure no compiler
optimization prevents either load or store commands.

Fixes: c3c977bbecbd ("net/mlx4: add Tx bypassing Verbs")
Fixes: 9f57340a8087 ("net/mlx4: restore Rx offloads")
Fixes: 6681b845034c ("net/mlx4: add Rx bypassing Verbs")
Fixes: 62e96ffb93ad ("net/mlx4: fix no Rx interrupts")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: separate Tx segment cases
Matan Azrad [Thu, 2 Nov 2017 16:42:49 +0000 (16:42 +0000)]
net/mlx4: separate Tx segment cases

Optimize single segment case by processing it in different block which
prevents checks, calculations and barriers relevant only for multi
segment case.

Call a dedicated function for handling multi segments case.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove duplicate handling in Tx burst
Matan Azrad [Thu, 2 Nov 2017 16:42:48 +0000 (16:42 +0000)]
net/mlx4: remove duplicate handling in Tx burst

Remove usage of variable which count the packets for completion and
doesn't add more information than packets counter.

Remove no space in elements ring check which is already covered by
regular Tx flow.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: merge Tx path functions
Matan Azrad [Thu, 2 Nov 2017 16:42:47 +0000 (16:42 +0000)]
net/mlx4: merge Tx path functions

Merge tx_burst and mlx4_post_send functions to prevent
double asking about WQ remain space.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: fix ring wraparound compiler hint
Matan Azrad [Thu, 2 Nov 2017 16:42:46 +0000 (16:42 +0000)]
net/mlx4: fix ring wraparound compiler hint

Remove unlikely hint from WQ wraparound check because it is
expected case.

Fixes: c3c977bbecbd ("net/mlx4: add Tx bypassing Verbs")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: associate MR to MP in a short function
Ophir Munk [Thu, 2 Nov 2017 16:42:45 +0000 (16:42 +0000)]
net/mlx4: associate MR to MP in a short function

Associate memory region to mempool (on data path) in a short function.
Handle the less common case of adding a new memory region to mempool
in a separate function.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: remove error flows from Tx fast path
Matan Azrad [Thu, 2 Nov 2017 16:42:44 +0000 (16:42 +0000)]
net/mlx4: remove error flows from Tx fast path

Move unnecessary error flows to DEBUG mode.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/i40e: fix Rx queue interrupt mapping in VF
Wei Dai [Fri, 3 Nov 2017 08:47:30 +0000 (16:47 +0800)]
net/i40e: fix Rx queue interrupt mapping in VF

When a VF port is bound to VFIO-PCI, miscellaneous interrupt is
mapped to MSI-X vector 0 and Rx queues interrupt are mapped to
other vectors in vfio_enable_msix( ). To simplify implementation,
all VFIO-PCI bound i40e VF Rx queue interrupts can be mapped in
vector 1. And as current igb_uio only support only one vector,
i40e VF PMD should use vector 0 for igb_uio and vector 1 for
VFIO-PCI. Without this patch, VF Rx queue interrupt is mapped
to vector 0 in register settings and mapped to VFIO vector 1
in vfio_enable_msix( ), and then all Rx queue interrupts will
be missed.
Also remove 2 unused macro definitions.

Fixes: 4b90a3ff26c5 ("i40evf: support Rx interrupt")
Fixes: 975ffea6f671 ("net/i40e: remove DPDK PF version specific code")
Cc: stable@dpdk.org
Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e: fix VFIO interrupt mapping in VF
Wei Dai [Fri, 3 Nov 2017 08:47:29 +0000 (16:47 +0800)]
net/i40e: fix VFIO interrupt mapping in VF

When a VF port is bound to VFIO-PIC, only miscellaneous interrupt
is mapped to VFIO vector 0 in i40evf_dev_init( ).
In i40evf_dev_interrupt_handle( ) and i40evf_dev_rx_queue_intr_enable( ),
if previous VFIO interrupt mapping set in i40evf_dev_init( ) is not
cleared, it will fail when PMD tries to map Rx queue interrupt to other
VFIO vectors by calling rte_intr_enable( ).

This patch clears the VFIO interrupt mappings before setting both
miscellaneous and Rx queue interrupt mappings again to avoid failure.
And remove the calling of rte_intr_enable( ) in
i40evf_dev_interrupt_handler( ) as there is no need to map VFIO interrupt
in this function repeatedly.

Fixes: 4b90a3ff26c5 ("i40evf: support Rx interrupt")
Cc: stable@dpdk.org
Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/ixgbe: fix filter parser for L2 tunnel
Wei Zhao [Fri, 3 Nov 2017 07:38:38 +0000 (15:38 +0800)]
net/ixgbe: fix filter parser for L2 tunnel

The action for L2 tunnel should be VF or PF, not QUEUE.

Fixes: 99e7003831c ("net/ixgbe: parse L2 tunnel filter")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
7 years agonet/vmxnet3: fix memory leak when releasing queues
Chas Williams [Wed, 1 Nov 2017 20:38:20 +0000 (16:38 -0400)]
net/vmxnet3: fix memory leak when releasing queues

At the end of the queue release, we can free the containers for the
queue objects.

Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <chas3@att.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
7 years agonet/mlx4: fix missing include
Adrien Mazarguil [Thu, 2 Nov 2017 13:41:25 +0000 (14:41 +0100)]
net/mlx4: fix missing include

Fixes: 76df01ff622f ("net/mlx4: separate debugging macros")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx5: fix array overflow
Nélio Laranjeiro [Thu, 2 Nov 2017 13:30:03 +0000 (14:30 +0100)]
net/mlx5: fix array overflow

VLAN id is limited to MLX5_MAX_VLAN_IDS which is not verified by the code
before trying to add a new VLAN filter.

Fixes: 272733b5ebfd ("net/mlx5: use flow to enable unicast traffic")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mrvl: reset errno before library call
Tomasz Duszynski [Thu, 2 Nov 2017 08:37:25 +0000 (09:37 +0100)]
net/mrvl: reset errno before library call

In case errno contains some non-zero value and call to strtoul() is
successful -2 error will be returned.

Setting errno to zero before calling strtoul() makes sure
errors will be handled correctly.

Fixes: 0ddc9b815b11 ("net/mrvl: add net PMD skeleton")

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/enic: fix TSO for packets greater than 9208 bytes
John Daley [Thu, 2 Nov 2017 05:47:10 +0000 (22:47 -0700)]
net/enic: fix TSO for packets greater than 9208 bytes

A check was previously added to drop Tx packets greater than what the Nic
is capable of sending since such packets can freeze the send queue. The
check did not account for TSO packets however, so TSO was limited to 9208
bytes.

Check packet length only for non-TSO packets. Also insure that TSO packet
segment size plus the headers do not exceed what the Nic is capable of
since this also can freeze the send queue.

Use the PKT_TX_TCP_SEG ol_flag instead of m->tso_segsz which is the
preferred way to check for TSO.

Fixes: ed6e564c214e ("net/enic: fix memory leak with oversized Tx packets")
Cc: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
7 years agodoc: add clarification for i40e 16 byte desc
Wenzhuo Lu [Wed, 1 Nov 2017 02:45:28 +0000 (10:45 +0800)]
doc: add clarification for i40e 16 byte desc

The description of i40e 16 byte descriptor is not clear
enough. Add more details.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agodoc: add how to set VF MAC address on ixgbe
Wenzhuo Lu [Tue, 24 Oct 2017 00:57:24 +0000 (08:57 +0800)]
doc: add how to set VF MAC address on ixgbe

Add the description of how to add a MAC address for a VF
from PF on ixgbe.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/mlx5: fix flow director TCPv6 filter
Nélio Laranjeiro [Tue, 31 Oct 2017 15:51:14 +0000 (16:51 +0100)]
net/mlx5: fix flow director TCPv6 filter

Flow director to generic flow conversion wrongly handles TCPv6 layer.

Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fix flow director filter removal
Nélio Laranjeiro [Tue, 31 Oct 2017 15:51:13 +0000 (16:51 +0100)]
net/mlx5: fix flow director filter removal

Initialise struct mlx5_fdir to avoid passing non initialised
items/actions arrays elements to the generic flow interpreter.

Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fix flows when VXLAN tunnel is 0
Nélio Laranjeiro [Tue, 31 Oct 2017 15:51:11 +0000 (16:51 +0100)]
net/mlx5: fix flows when VXLAN tunnel is 0

Fix a strange behavior from the NIC, when the flow starts with a VXLAN
layer with a VNI equals to zero all the traffic will match within this
rule.

Fixes: 2e709b6aa0f5 ("net/mlx5: support VXLAN flow item")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/mlx5: fix parser inner value
Nélio Laranjeiro [Tue, 31 Oct 2017 15:51:10 +0000 (16:51 +0100)]
net/mlx5: fix parser inner value

In validate() it sets the value to 1 whereas the expected one is
IBV_FLOW_SPEC_INNER.

Fixes: c2c6ddd51da4 ("net/mlx5: limit flow API rules to one tunnel")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/dpaa2: set queues after reconfiguration
Akhil Goyal [Wed, 1 Nov 2017 08:16:41 +0000 (13:46 +0530)]
net/dpaa2: set queues after reconfiguration

if dpaa2_dev_tx_queue_setup is called multiple times, the
assignment of device->data->tx_queues is not done, as a result
tx_queues remain NULL after reconfiguration.

This patch sets the tx_queues from the device private data to the
usable device tx queues.

Fixes: 7ae777d064e8 ("net/dpaa2: add support for congestion notification")
Cc: stable@dpdk.org
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/mlx5: fix counter set destroy order
Ori Kam [Mon, 30 Oct 2017 12:46:54 +0000 (14:46 +0200)]
net/mlx5: fix counter set destroy order

The counter set should be destroyed only after the flow was destroyed.

Fixes: 9a761de8ea14 ("net/mlx5: flow counter support")

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/bonding: fix default aggregator mode to stable
Daniel Mrzyglod [Fri, 20 Oct 2017 14:32:54 +0000 (16:32 +0200)]
net/bonding: fix default aggregator mode to stable

This patch change default aggregator mode to stable
when using rte_eth_bond_create()

Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
Cc: stable@dpdk.org
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
7 years agonet/ixgbe: fix IPsec Rx with SSE
Radu Nicolau [Wed, 1 Nov 2017 11:28:32 +0000 (11:28 +0000)]
net/ixgbe: fix IPsec Rx with SSE

And small performance improvement

Fixes: 9a0752f498d2 ("net/ixgbe: enable inline IPsec")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
7 years agonet/i40e: fix Rx packets number for NEON
Jianbo Liu [Tue, 31 Oct 2017 05:52:44 +0000 (13:52 +0800)]
net/i40e: fix Rx packets number for NEON

Fix i40e stop receiving on ARM, as the statuses of RX descriptors
are not consistent, which is caused by cacheable hugepages.

Fixes: ae0eb310f253 ("net/i40e: implement vector PMD for ARM")
Cc: stable@dpdk.org
Signed-off-by: Jianbo Liu <jianbo.liu@arm.com>
7 years agonet/bnxt: fix VLAN spoof configuration
Ajit Khaparde [Tue, 31 Oct 2017 14:45:57 +0000 (09:45 -0500)]
net/bnxt: fix VLAN spoof configuration

We are not programming the vlan_spoof setting currently owing to
an unnecessary check. This patch fixes that.

Fixes: 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/mlx4: fix queue index check on flow rules
Adrien Mazarguil [Tue, 31 Oct 2017 10:31:07 +0000 (11:31 +0100)]
net/mlx4: fix queue index check on flow rules

Users are not prevented from creating flow rules targeting nonexistent
queues, which silently makes such rules drop-like.

While it can be thought as a feature, reporting an error instead is
actually far more useful in order to catch common mistakes.

Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: fix Rx after updating number of queues
Adrien Mazarguil [Tue, 31 Oct 2017 10:31:04 +0000 (11:31 +0100)]
net/mlx4: fix Rx after updating number of queues

When not in isolated mode, internal flow rules are automatically
maintained by the PMD to receive traffic according to global device
settings (MAC, VLAN, promiscuous mode and so on).

Since RSS support was added to the mix, it must also check whether Rx
queue configuration has changed when refreshing flow rules to prevent
the following from happening:

- With a smaller number of Rx queues, traffic is implicitly dropped
  since the existing RSS context cannot be re-applied.
- With a larger number of Rx queues, traffic remains balanced within the
  original (smaller) set of queues.

One workaround before this commit was to temporarily enter/leave
isolated mode to make it regenerate internal flow rules.

Fixes: 7d8675956f57 ("net/mlx4: add RSS support outside flow API")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/i40e: fix mirror with firmware 6.0
Qi Zhang [Tue, 31 Oct 2017 14:26:42 +0000 (10:26 -0400)]
net/i40e: fix mirror with firmware 6.0

Value of I40E_GL_SWR_PRI_JOIN_MAP_0 need to be corrected or mirror
does not work on latest firmware 6.0.

Fixes: 77370db964f7 ("net/i40e: fix ethertype filter for new FW")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
7 years agonet/nfp: avoid unplug if multiport
Alejandro Lucero [Tue, 31 Oct 2017 11:04:52 +0000 (11:04 +0000)]
net/nfp: avoid unplug if multiport

PF multiport support has some limitations like not allowing plugging or
unplugging of single ports as they all belong to same PCI device.

A previous patch for removing detachable flag introduced a wrong check.

Fixes: 00a3d8104ac5 ("ethdev: remove detachable device flag")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
7 years agonet/mlx5: fix adding counter when dev not started
Ori Kam [Mon, 30 Oct 2017 07:32:24 +0000 (09:32 +0200)]
net/mlx5: fix adding counter when dev not started

When adding count action to a drop flow rule while the device was not
started, the counter was not saved in the flow.

Fixes: 9a761de8ea14 ("net/mlx5: flow counter support")

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agodoc: add octeontx to release notes
Jerin Jacob [Sun, 29 Oct 2017 13:28:50 +0000 (18:58 +0530)]
doc: add octeontx to release notes

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/mlx5: fix flow director matching rules
Nélio Laranjeiro [Fri, 27 Oct 2017 06:50:00 +0000 (08:50 +0200)]
net/mlx5: fix flow director matching rules

Flow director API does not provide a layer 2 configuration when the
filter is for layer 3 and 4 causing the translation to generic flow API
to be wrong, as not providing a mask for layer ends by using the
default one.
In this case, the Ethernet mask layer is full whereas it must be empty.

Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
7 years agonet/bnxt: fix HWRM command failures during VF unload
Ajit Khaparde [Mon, 30 Oct 2017 16:08:08 +0000 (11:08 -0500)]
net/bnxt: fix HWRM command failures during VF unload

In some cases when a VF driver is unloaded after the PF driver,
certain HWRM commands are returned with an error.
Instead the PF can tell the FW to permit these commands in order
to allow a clean unload.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: fix flow director filter
Ajit Khaparde [Fri, 27 Oct 2017 15:53:34 +0000 (10:53 -0500)]
net/bnxt: fix flow director filter

Set the filter_type before we match a new filter against existing
filters. Otherwise we are missing the existing filters.

Fixes: 2d64da097aa0 ("net/bnxt: support FDIR")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: do not set hash type unnecessarily
Ajit Khaparde [Fri, 27 Oct 2017 02:30:24 +0000 (21:30 -0500)]
net/bnxt: do not set hash type unnecessarily

We are wrongly "OR-ing" the vnic->hash_type instead of assigning
the new hash type thereby wrongly configuring hash settings.
Fixing it.

Fixes: fcc0aa1edc10 ("net/bnxt: add RSS hash configuration")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/mlx5: fix RSS action for tunneled packets
Shahaf Shuler [Thu, 26 Oct 2017 17:41:57 +0000 (20:41 +0300)]
net/mlx5: fix RSS action for tunneled packets

The flow engine in mlx5 searches for the most specific layer in the
pattern in order to set the flow rule priority properly.

Since the RSS can be currently performed only for the outer headers, avoid
updating the layer for the inner headers.

Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/ixgbe: fix build with gcc 4.5.1
Radu Nicolau [Mon, 6 Nov 2017 11:36:47 +0000 (11:36 +0000)]
net/ixgbe: fix build with gcc 4.5.1

On SUSE11 with gcc 4.5.1 the following build error occurred,
most likely because of improper handling of annonymous unions:

drivers/net/ixgbe/ixgbe_ipsec.c:579:4: error:
unknown field ‘ipsec’ specified in initializer

Fixes: 9a0752f498d2 ("net/ixgbe: enable inline IPsec")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
7 years agovhost: postpone ring address translations at kick time only
Maxime Coquelin [Fri, 3 Nov 2017 15:52:35 +0000 (16:52 +0100)]
vhost: postpone ring address translations at kick time only

If multiple queue pairs are created but all are not used, the
device is never started, as unused queues aren't enabled and
their ring addresses aren't translated. The device is changed
to running state when all rings addresses are translated.

This patch fixes this by postponning rings addresses translation
at kick time unconditionnaly, VHOST_USER_F_PROTOCOL_FEATURES
being negotiated or not.

Reported-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
7 years agocfgfile: fix leak on creation error
Jacek Piasecki [Thu, 26 Oct 2017 06:21:09 +0000 (08:21 +0200)]
cfgfile: fix leak on creation error

Unsuccesfull memory allocation for elements inside cfgfile
structure could result in resource leak.
Fixed by pointer verification after each malloc,
if malloc fail - error branch is proceeded with freeing memory.

Coverity issue: 195032
Fixes: d4cb8197589d ("cfgfile: support runtime modification")

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
7 years agocfgfile: fix null pointer dereference in parsing
Jacek Piasecki [Thu, 26 Oct 2017 06:24:06 +0000 (08:24 +0200)]
cfgfile: fix null pointer dereference in parsing

Function memchr() could return NULL and assign it to split[1] pointer.
Additional check and error handing is made after memchr() call.

Coverity issue: 195004
Fixes: a6a47ac9c2c9 ("cfgfile: rework load function")

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
7 years agotable: fix LRU hash table parameters check
Jasvinder Singh [Fri, 27 Oct 2017 10:47:30 +0000 (11:47 +0100)]
table: fix LRU hash table parameters check

Fixes the copy paste error in lru hash table parameters check.

Coverity issue: 198433
Fixes: b5cde2cb8c81 ("table: rework variable size key lru hash table")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agodistributor: fix some typos
Pavel Shirshov [Mon, 30 Oct 2017 07:03:01 +0000 (00:03 -0700)]
distributor: fix some typos

Signed-off-by: Pavel Shirshov <pavel.shirshov@gmail.com>
7 years agolib: fix some typos
Thomas Monjalon [Thu, 2 Nov 2017 19:30:17 +0000 (20:30 +0100)]
lib: fix some typos

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
7 years agoservice: fix race in service on app lcore function
Harry van Haaren [Wed, 1 Nov 2017 18:48:01 +0000 (18:48 +0000)]
service: fix race in service on app lcore function

This commit fixes a possible race condition if an application
uses the service-cores infrastructure and the function to run
a service on an application lcore at the same time.

The fix is to change the num_mapped_cores variable to be an
atomic variable. This causes concurrent accesses by multiple
threads to a service using rte_service_run_iter_on_app_lcore()
to detect if another core is currently mapped to the service,
and refuses to run if it is not multi-thread safe.

The run iteration on app lcore function has two arguments, the
service id to run, and if atomics should be used to serialize access
to multi-thread unsafe services. This allows applications to choose
if they wish to use use the service-cores feature, or if they
take responsibility themselves for serializing invoking a service.
See doxygen documentation for more details.

Two unit tests were added to verify the behaviour of the
function to run a service on an application core, testing both
a multi-thread safe service, and a multi-thread unsafe service.

The doxygen API documentation for the function has been updated
to reflect the current and correct behaviour.

Fixes: e9139a32f6e8 ("service: add function to run on app lcore")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoeal: fix check for default plugin directory
Bruce Richardson [Mon, 6 Nov 2017 13:58:00 +0000 (13:58 +0000)]
eal: fix check for default plugin directory

The check for the existence of the default plugin directory calls stat
using an incorrect variable, which will cause a NULL pointer dereference
error.

Coverity issue: 198440
Fixes: d6a4399cdfc9 ("eal: avoid error for non-existent default PMD path")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
7 years agoeal/linux: add interrupt counter size for vdev
Jingjing Wu [Thu, 24 Aug 2017 02:10:56 +0000 (10:10 +0800)]
eal/linux: add interrupt counter size for vdev

For virtual device, the rte_intr_handle struct is
initialized by the virtual device driver, including
the event fd assignment. If the event fd need to be
read for clean, an argument is required for the proper
event fd read.

This patch adds efd_counter_size in rte_intr_handle
struct to tell the rx interrupt process the read size.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
7 years agoeal/x86: revert select optimized memcpy at run-time
Xiaoyun Li [Fri, 3 Nov 2017 12:47:23 +0000 (20:47 +0800)]
eal/x86: revert select optimized memcpy at run-time

Revert the patchset run-time Linking support including the following
3 commits:

Fixes: 84cc318424d4 ("eal/x86: select optimized memcpy at run-time")
Fixes: c7fbc80fe60f ("test: select memcpy alignment unit at run-time")
Fixes: 5f180ae32962 ("efd: move AVX2 lookup in its own compilation unit")

The patchset would cause perf drop in vhost/virtio loopback performance
test. Because the run-time dispatch must cost at least a function call
comparing to the compile-time dispatch. And the reference cpu cycles value
is small. And in the test, when using 128-256 bytes packet, it would cause
16%-20% perf drop with mergeble path. When using 256 bytes packet, it would
cause 13% perf drop with vector path.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
7 years agoigb_uio: prevent reset for bnx2x devices
Ferruh Yigit [Mon, 6 Nov 2017 18:48:15 +0000 (18:48 +0000)]
igb_uio: prevent reset for bnx2x devices

Some devices are having problem on device reset that happens during DPDK
application exit [1].

Create a static list of devices and exclude them from device reset.

[1]
http://dpdk.org/ml/archives/dev/2017-November/080927.html

Fixes: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agobus/pci: fix namespace of sysfs path function
Thomas Monjalon [Mon, 6 Nov 2017 01:56:09 +0000 (02:56 +0100)]
bus/pci: fix namespace of sysfs path function

The function pci_get_sysfs_path was moved from EAL to the PCI driver.

The namespace is now fixed by adding "rte_" prefix.
The map files are fixed by removing the symbol from EAL and adding
it to the PCI driver.

It is an API break but it is probably not used by applications.
Anyway this API is already broken by the move in a new header file.

Fixes: c752998b5e2e ("pci: introduce library and driver")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agobus/pci: fix IOMMU class for sPAPR
Jonas Pfefferle [Fri, 3 Nov 2017 12:05:19 +0000 (13:05 +0100)]
bus/pci: fix IOMMU class for sPAPR

PPC64 sPAPR iommu does not support iova as va.
Use pa mode instead.

Fixes: 815c7deaed2d ("pci: get IOMMU class on Linux")

Signed-off-by: Jonas Pfefferle <jpf@zurich.ibm.com>
7 years agoeal/linux: force IOVA as PA mode if KNI module inserted
Ferruh Yigit [Thu, 2 Nov 2017 00:06:00 +0000 (00:06 +0000)]
eal/linux: force IOVA as PA mode if KNI module inserted

Fix kernel crash with KNI because KNI requires physical addresses.

When IOVA VA mode used, memzones and mbufs physical address fields
contain virtual addresses. But KNI relies on these fields to enable
kernel access for buffers. Those fields having virtual address cause
crash in kernel.

This is a workaround until KNI fixed properly to work with virtual
addresses.

Fixes: 72d013644bd6 ("mem: honor IOVA mode in malloc virt2phy")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoeal: fix version map experimental section
Harry van Haaren [Wed, 25 Oct 2017 12:29:49 +0000 (13:29 +0100)]
eal: fix version map experimental section

Before this commit, the EXPERIMENTAL version of ABI
derived from the DPDK_17.08 tag. In parallel there
was a DPDK_17.11 tag.

Experimental map should always derive from the latest ABI,
so this patch moves the 17.11 section above EXPERIMENTAL,
and updates EXPERIMENTAL to derive from the 17.11 map.

Fixes: aadc3eb002d3 ("pci: export match function")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agomempool: increase ABI version
Thomas Monjalon [Mon, 6 Nov 2017 10:54:26 +0000 (11:54 +0100)]
mempool: increase ABI version

API and ABI of mempool library has been changed in 17.11.

Fixes: 02604520b2f2 ("mempool: remove unused flags argument")
Fixes: 0cc0f8aaa35d ("mempool: change flags from int to unsigned int")
Fixes: 6eac187bff30 ("mempool: add flags arg in xmem size and usage")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agodoc: add IOVA aware API changes in release notes
Thomas Monjalon [Fri, 20 Oct 2017 12:31:35 +0000 (18:01 +0530)]
doc: add IOVA aware API changes in release notes

The wording changes have been done in the API without breaking
the ABI. The deprecated fields and symbols can be removed later
when an another ABI change will be required.
The deprecation notice can be removed.

The release notes describe the new available API with IOVA wording.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agodrivers/net: rename physical address type to IOVA
Santosh Shukla [Fri, 20 Oct 2017 12:31:31 +0000 (18:01 +0530)]
drivers/net: rename physical address type to IOVA

Renamed data type from phys_addr_t to rte_iova_t.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agocryptodev: rename physical address type to IOVA
Santosh Shukla [Fri, 20 Oct 2017 12:31:31 +0000 (18:01 +0530)]
cryptodev: rename physical address type to IOVA

Renamed data type from phys_addr_t to rte_iova_t.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agombuf: rename data address helpers to IOVA
Thomas Monjalon [Sun, 5 Nov 2017 23:22:55 +0000 (00:22 +0100)]
mbuf: rename data address helpers to IOVA

The following inline functions and macros have been renamed to be
consistent with the IOVA wording:

rte_mbuf_data_dma_addr         -> rte_mbuf_data_iova
rte_mbuf_data_dma_addr_default -> rte_mbuf_data_iova_default
rte_pktmbuf_mtophys            -> rte_pktmbuf_iova
rte_pktmbuf_mtophys_offset     -> rte_pktmbuf_iova_offset

The deprecated functions and macros are kept to avoid breaking the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agombuf: rename physical address to IOVA
Santosh Shukla [Fri, 20 Oct 2017 12:31:32 +0000 (18:01 +0530)]
mbuf: rename physical address to IOVA

Rename buf_physaddr to buf_iova.
Keep the deprecated name in an anonymous union to avoid breaking
the API.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agomempool: rename populate functions to IOVA
Thomas Monjalon [Sun, 5 Nov 2017 22:26:24 +0000 (23:26 +0100)]
mempool: rename populate functions to IOVA

The functions rte_mempool_populate_phys() and
rte_mempool_populate_phys_tab() are renamed to
rte_mempool_populate_iova() and rte_mempool_populate_iova_tab().
The deprecated functions are kept as aliases to avoid breaking the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agomempool: rename address mapping function to IOVA
Thomas Monjalon [Sun, 5 Nov 2017 18:02:29 +0000 (19:02 +0100)]
mempool: rename address mapping function to IOVA

The function rte_mempool_virt2phy() is renamed to rte_mempool_virt2iova().
The new function has one less parameter because it is unused.
The deprecated function is kept as an alias to avoid breaking the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agomempool: rename addresses from physical to IOVA
Thomas Monjalon [Fri, 20 Oct 2017 12:31:31 +0000 (18:01 +0530)]
mempool: rename addresses from physical to IOVA

The struct fields phys_addr_t rte_mempool_objhdr.physaddr and
rte_mempool_memhdr.phys_addr are renamed to rte_iova_t iova.
The deprecated names are kept in an anonymous union to avoid breaking
the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agomemzone: rename address from physical to IOVA
Thomas Monjalon [Sat, 4 Nov 2017 01:22:28 +0000 (02:22 +0100)]
memzone: rename address from physical to IOVA

The struct rte_memzone field .phys_addr is renamed to .iova.
The deprecated name is kept in an anonymous union to avoid breaking
the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agomalloc: use pointer diff macro in IOVA mapping
Santosh Shukla [Fri, 20 Oct 2017 12:31:36 +0000 (18:01 +0530)]
malloc: use pointer diff macro in IOVA mapping

Use RTE_PTR_DIFF macro in rte_mem_virt2iova api.

Suggested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agomalloc: rename address mapping function to IOVA
Thomas Monjalon [Sat, 4 Nov 2017 01:22:21 +0000 (02:22 +0100)]
malloc: rename address mapping function to IOVA

The function rte_malloc_virt2phy() is renamed to rte_malloc_virt2iova().
The deprecated name is kept as an alias to avoid breaking the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agomem: rename address mapping function to IOVA
Thomas Monjalon [Sat, 4 Nov 2017 16:15:04 +0000 (17:15 +0100)]
mem: rename address mapping function to IOVA

The function rte_mem_virt2phy() is kept and used in functions which
works only with physical addresses.
For all other calls this function is replaced by rte_mem_virt2iova()
which does a direct mapping (no conversion) in the VA case.

Note: the new function rte_mem_virt2iova() function matches the
behaviour implemented in rte_mem_virt2phy() by the commit
680f6c12600f ("mem: honor IOVA mode in virt2phy")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agomem: rename segment address from physical to IOVA
Santosh Shukla [Fri, 20 Oct 2017 12:31:33 +0000 (18:01 +0530)]
mem: rename segment address from physical to IOVA

Renaming rte_memseg {.phys_addr} to {.iova}
Keep the deprecated name in an anonymous union to avoid breaking
the API.

Use rte_iova_t and RTE_BAD_IOVA where appropriate in
memory segment handling.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agomem: introduce IOVA type
Thomas Monjalon [Fri, 3 Nov 2017 23:36:47 +0000 (00:36 +0100)]
mem: introduce IOVA type

The IO virtual addresses may be used instead of physical addresses.
As IOVA is more generic, it should be used in most places instead
of physical address wording.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agomem: hide physical address error in VA mode
Thomas Monjalon [Sat, 4 Nov 2017 22:09:03 +0000 (23:09 +0100)]
mem: hide physical address error in VA mode

If the IOVA mode is not using physical addresses,
no need to log an error about physical address issue.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agomem: remove old function from symbol list
Thomas Monjalon [Fri, 3 Nov 2017 11:21:04 +0000 (12:21 +0100)]
mem: remove old function from symbol list

The function rte_mem_phy2mch() was removed with the support
of Xen dom0.

Fixes: a7cb2e20d23c ("mem: remove API to get physical address in dom0")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agoremove useless memzone includes
Thomas Monjalon [Sat, 4 Nov 2017 00:43:57 +0000 (01:43 +0100)]
remove useless memzone includes

The memzone header is often included without good reason.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoremove include of generated config header
Thomas Monjalon [Thu, 2 Nov 2017 21:35:02 +0000 (22:35 +0100)]
remove include of generated config header

The file rte_config.h is generated and automatically included
with -include option.
The explicit includes in drivers and libraries are useless.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>