Rasesh Mody [Tue, 7 Nov 2017 08:34:25 +0000 (00:34 -0800)]
net/qede: fix null pointer dereferences
Fix null pointer dereferences in qede_vxlan_enable() and
qede_conf_udp_dst_port()
Coverity issue: 195010, 195012, 198439 Fixes: e0947ed912f7 ("net/qede: add support for VXLAN UDP port config over VF") Fixes: 739a5b2f2b49 ("net/qede/base: use passed ptt handler") Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Rasesh Mody [Tue, 7 Nov 2017 08:34:20 +0000 (00:34 -0800)]
net/qede: fix device link structure
8ea656f8c app/testpmd: request link status interrupt
requires QEDE PMD to populate the device link structure without
having to query the driver for link status change event.
This patch updates the device link structure when link status event is
received.
Remove unused param from qed_link_update()
Harish Patil [Tue, 7 Nov 2017 08:34:18 +0000 (00:34 -0800)]
net/qede: disable per-VF Tx switching feature
Provide a knob to control per-VF Tx switching feature by adding a config
option, CONFIG_RTE_LIBRTE_QEDE_VF_TX_SWITCH. By default, it will be kept
in disabled state for better performance with small sized frames.
net/mlx5: fix flow director delete with drop action
Removing a flow director rule with a drop action ends by not removing it
due to a missing verbs drop specification in the conversion process between
the flow director and generic flow API.
Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director") Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Ferruh Yigit [Tue, 7 Nov 2017 22:29:13 +0000 (22:29 +0000)]
igb_uio: remove device reset in release
More error reported for device reset in release() [1],
when device pass-through to the guest, host kernel crash on guest exit.
Removing the reset completely.
This is close to reverting commit b58eedfc7dd5 [2], taking into account
previous fix to remove reset in open as well [3], but not exactly same.
With latest code, interrupts are enabled in uio open() callback and
disabled in uio release() callback, so when a DPDK application exit
device interrupts are disabled. Previously interrupts were only enabled
once in igb_uio module insert and disabled in module removal.
Also with latest code device set as bus master in open() and master
cleared in release(), clearing bus master should prevent further DMA
which was one of the target of the initial patch.
The initial intention was also to reset the device to be sure it has
been left in proper state, but currently that part is missing because of
reported problem(s).
Still igb_uio should be safer comparing to the pre b58eedfc7dd5 state.
Olivier Matz [Thu, 5 Oct 2017 07:53:27 +0000 (09:53 +0200)]
devtools: rework ABI checker script
The initial version of the script had some limitations:
- cannot work on a non-clean workspace
- environment variables are not documented
- no compilation log in case of failure
- return success even it abi is incompatible
This patch addresses these issues and rework the code.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
Thomas Monjalon [Wed, 11 Oct 2017 13:28:58 +0000 (15:28 +0200)]
devtools: rename build dependency of mlx drivers
The Mellanox drivers were requiring MOFED at compilation time.
It is now possible to use the upstream rdma-core package.
So the dependency option is renamed in the build tool.
Fixes: 43e9d9794cde ("net/mlx5: support upstream rdma-core") Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Jerin Jacob [Mon, 16 Oct 2017 10:32:55 +0000 (16:02 +0530)]
eventdev: remove experimental label
The eventdev API was introduced in DPDK 17.05 release.
Since then it
- has been reviewed and iterated for 17.08, 17.11 releases
- three drivers were implemented using the API.
- introduced another subsystem like service core and ethdev-eventdev Rx
adapter APIs to abstract the difference between HW and SW
eventdev implementations in a transparent way.
- had extensive use by the app/test-eventdev/ and
examples/eventdev_pipeline_sw_pmd/
I believe the API is now stable and the EXPERIMENTAL label
should be removed.
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Gage Eads <gage.eads@intel.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
The Flow Classify Library Programmers Guide documents
librte_flow_classify.
The Flow Classify Sample Application Guide documents the
flow_classify sample application which is used to
demonstrate the use of the Flow Classify Library,
librte_flow_classify.
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com> Acked-by: John McNamara <john.mcnamara@intel.com>
Ori Kam [Wed, 25 Oct 2017 14:51:16 +0000 (17:51 +0300)]
doc: add basic howto for flow API
As the rte_flow is a new complex module in the DPDK.
In order to ease developers in to using this feature
it was suggested to supply a simple howto doc.
Signed-off-by: Ori Kam <orika@mellanox.com> Acked-by: John McNamara <john.mcnamara@intel.com>
All PCI functionality should be hidden from apps via the PCI bus driver,
the EAL and individual device drivers. Therefore remove the inclusion of
rte_pci.h from sample apps.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Ophir Munk [Tue, 7 Nov 2017 13:52:30 +0000 (13:52 +0000)]
app/testpmd: fix forwarding between non consecutive ports
When defining two failsafe devices in testpmd the port numbers of the
failsafe devices may not be consecutive.
For example: if failsafe device includes a PCI device and a TAP device
then failsafe port numbers would be 0 and 3.
Port 0 - failsafe #1 device
Port 1 - PCI #1 device
Port 2 - TAP #1 device
Port 3 - failsafe #2 device
Port 4 - PCI #2 device
Port 5 - TAP #2 device
If forwarding is defined between the failsafe devices including a peer
address the forwarding should be between peer addresses of ports 0
and 3. Instead testpmd establishes forwarding between peer addresses
of consecutive ports 0 and 1. This commit fixes this bug.
Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Herbert Guan [Wed, 25 Oct 2017 07:13:46 +0000 (15:13 +0800)]
test/memcpy_perf: provide perf ratio and test time
The printed time values presented in TSC is not straight forward
showing the performance difference. And if the high resolution
counter is not enabled, time value is too small to show the actual
performance (e.g. "1 - 1" seems the same but in fact the perfomance
diffs by 50% or more).
With the performance difference ratio caculated and printed, it'll be
easier for people to read and compare the performance between
rte_memcpy() and memcpy().
Since the TSC values' units may diff a lot on different platforms,
the total execution time of aligned/unaligned memcpy test are
provided to allow comparation between platforms.
Signed-off-by: Herbert Guan <herbert.guan@arm.com> Acked-by: Jianbo Liu <jianbo.liu@arm.com>
Daniel Mrzyglod [Fri, 27 Oct 2017 16:24:08 +0000 (18:24 +0200)]
test/pmd_perf: fix crash with multiple devices
Error can be reproduce if we run pmd_perf_autotest with more then
one device in such way:
RTE>>set_rxtx_sc poll_before_xmit
RTE>>pmd_perf_autotest
if first burst was value less than MAX_PKT_BURST in the end we overwrite
pkts_burst table for rx which was supposed for another interface.
Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx") Cc: stable@dpdk.org Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com> Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
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>
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>
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>
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>
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>
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.
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>
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>
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>
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>
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.
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.
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>
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.
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.
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.
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.
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>
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>
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>
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>
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.
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.
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.