Commit Graph

4395 Commits

Author SHA1 Message Date
Alejandro Lucero
eb04bc1052 net/nfp: fix resource leak
File descriptor is not released in any potential exit path
inside the function.

Coverity issue: 195018
Fixes: f37d8a4b67 ("net/nfp: add NSP FW upload command")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-11-10 09:31:24 +00:00
Alejandro Lucero
965f0aaa7c net/nfp: fix memory allocation
If the function actually returns a null value, a null pointer
dereference will occur.

Coverity issue: 195013
Fixes: dd63df2bff ("net/nfp: add NSP symbol resolution command")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-11-10 09:31:24 +00:00
Alejandro Lucero
9b634927a7 net/nfp: fix stats struct initial value
Not all struct fields will be written and random data could
confuse readers.

Coverity issue: 140755
Fixes: 92aa491b88 ("nfp: add statistics")
Cc: stable@dpdk.org

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-11-10 09:31:18 +00:00
Ilya V. Matveychikov
6c293ffd63 drivers/net: fix number of segment storage type
Fixes: 97cb466d65 ("mbuf: use 2 bytes for port and nb segments")
Cc: stable@dpdk.org

Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-11-10 09:17:13 +00:00
Shahaf Shuler
8ec50cd624 net/mlx4: fix rxq interrupt memory corruption
intr_vec allocation size was wrong causing a memory corruption.

Fixes: 0a2ae70319 ("net/mlx4: fix Rx interrupts management")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-11-10 09:04:20 +00:00
Shahaf Shuler
b2e0e28e30 net/mlx5: fix rxq interrupt memory corruption
intr_vec allocation size was wrong causing a memory corruption.

Fixes: e1016cb733 ("net/mlx5: fix Rx interrupts management")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-11-10 08:56:26 +00:00
Nélio Laranjeiro
4daae08e7f net/mlx5: fix flow director rules comparison
When deleting/replacing a flow director rule the first rule of the list
was always the one replaced instead of the corresponding one.

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

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-11-10 08:27:27 +00:00
Harish Patil
1282943aa0 net/qede: fix default config option
Restore the default configuration as in previous releases and
add a debug msg.

Fixes: f07aa795c9 ("net/qede: disable per-VF Tx switching feature")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-11-10 08:12:20 +00:00
Moti Haimovsky
78214fb882 net/mlx4: fix Rx packet type offloads
This patch improves Rx packet type offload report in case the device is
a virtual function device.
In these devices we observed that the L2 tunnel flag is set also for
non-tunneled packets, this leads to a complete misinterpretation of the
packet type being received.
This issue occurs since the tunnel_mode is not set to 0x7 by the driver
for virtual devices and therefore the value in the L2 tunnel flag is
meaningless and should be ignored.

Fixes: aee4a03fee ("net/mlx4: enhance Rx packet type offloads")

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-11-10 02:29:56 +00:00
Xiaoyun Li
79f47fc1b7 net/i40e: fix VF cannot forward packets issue
When Rx interrupt is not enabled, there is no need to check if interrupt
allow others. It will cause VF cannot forwarding packets issue. This patch
fixes this issue.

Fixes: 96a9fd03c2 ("net/i40e: fix Rx queue interrupt mapping in VF")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2017-11-10 02:05:15 +00:00
Shijith Thotton
92f3ea373e net/liquidio: support device reset in driver
Reset device during init and close if bound to igb_uio.

Fixes: 369db3ae8e ("igb_uio: remove device reset in release")
Cc: stable@dpdk.org

Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
2017-11-08 21:30:14 +01:00
Jasvinder Singh
9527e24458 net/softnic: fix build with gcc 4.5.1
Fix the build error due to improper handling of unions
on SUSE11 (gcc 4.5.1).

drivers/net/softnic/rte_eth_softnic_tm.c:588:3
error: unknown field 'nonleaf' specified in initializer

Fixes: 299a89de91 ("net/softnic: add TM capabilities ops")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2017-11-08 20:44:56 +01:00
Ferruh Yigit
e8f8f59518 net/qede: fix icc build
observed icc version "icc (ICC) 18.0.0 20170811"

build error:
.../dpdk/drivers/net/qede/qede_ethdev.c(1475):
error #279: controlling expression is constant
	assert(false && "Unable to start periodic timer");
			^

Warning disabled in Makefile.

Fixes: 2af14ca79c ("net/qede: support 100G")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-11-08 01:26:04 +01:00
Rasesh Mody
2c93d5baf9 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: e0947ed912 ("net/qede: add support for VXLAN UDP port config over VF")
Fixes: 739a5b2f2b ("net/qede/base: use passed ptt handler")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-11-08 00:49:59 +01:00
Rasesh Mody
5b5f9675d3 net/qede/base: fix division by zero
Fix division by zero in calculating the regpair elements per page
Remove unused API ecore_cxt_free_proto_ilt()

Coverity issue: 1379423, 1379428
Fixes: 22d07d939c ("net/qede/base: update")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-11-08 00:49:59 +01:00
Rasesh Mody
fac6b33a5e net/qede/base: fix return code init of filter functions
Fix for uninitialized scalar variable for filter APIs

Coverity issue: 1445717, 1445718, 1445721, 1445722
Fixes: 2e2f392b24 ("net/qede/base: upgrade the FW to 8.20.0.0")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-11-08 00:49:59 +01:00
Rasesh Mody
feea1b85ce net/qede: fix PF translation table release
Appropriately release the ptt[PF translation table] handler that is
acquired in error case

Fixes: e0947ed912 ("net/qede: add support for VXLAN UDP port config over VF")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-11-08 00:49:59 +01:00
Rasesh Mody
a96b86a12b net/qede: remove duplicate includes
Fixes: ec94dbc573 ("qede: add base driver")
Fixes: 2ea6f76aff ("qede: add core driver")
Fixes: 622075356e ("net/qede: support ntuple and flow director filter")
Fixes: 52d94b57e1 ("net/qede: add slowpath support for VXLAN tunneling")
Fixes: 8b3ee85efe ("net/qede: fix RSS table entries for 100G adapter")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-11-08 00:49:59 +01:00
Rasesh Mody
8aab5d6fab 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()

Fixes: 86a2265e59 ("qede: add SRIOV support")
Fixes: ec94dbc573 ("qede: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2017-11-08 00:49:59 +01:00
Harish Patil
2d62f169f1 net/qede: fix VXLAN filter deletion
Initialize ucast parameters before checking if filters exists.

Fixes: e0947ed912 ("net/qede: add support for VXLAN UDP port config over VF")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-11-08 00:49:59 +01:00
Harish Patil
f07aa795c9 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.

Fixes: 2ea6f76aff ("qede: add core driver")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
2017-11-08 00:49:59 +01:00
Yongseok Koh
6c897093f2 net/mlx5: fix tunneled TCP/UDP packet type
If tunneled bit is set in the HW descriptor, the l4_hdr_type bits
describe the inner packet.

Fixes: ea16068c00 ("net/mlx5: fix L4 packet type support")
Cc: stable@dpdk.org

Reported-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2017-11-08 00:49:59 +01:00
Nélio Laranjeiro
ab95b7e7b2 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: 4c3e9bcdd5 ("net/mlx5: support flow director")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-11-08 00:49:59 +01:00
Jonas Pfefferle
f1b7c6b7f5 bus/pci: fix PPC condition for IOMMU class
This fixes the use of an never defined PPC64 define in
ret_pci_get_iommu_class.

Fixes: b48e0e2d9c ("bus/pci: fix IOMMU class for sPAPR")

Signed-off-by: Jonas Pfefferle <jpf@zurich.ibm.com>
2017-11-07 17:04:09 +01:00
Jianfeng Tan
d22fcb225c bus/vdev: change log type
Use specialized dynamic log type for vdev bus logging.

Suggested-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Suggested-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
2017-11-07 16:54:07 +01:00
Jianfeng Tan
d4a586d29e bus/vdev: move code from EAL into a new driver
Move the vdev bus from lib/librte_eal to drivers/bus.

As the crypto vdev helper function refers to data structure
in rte_vdev.h, so we move those helper function into drivers/bus
too.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
2017-11-07 16:54:07 +01:00
Hemant Agrawal
116ff44aa8 crypto/dpaa_sec: rename mbuf physical address to IOVA
buf_physaddr is getting deprecated in mbuf.

Fixes: 455da54539 ("mbuf: rename physical address to IOVA")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-11-07 15:39:47 +01:00
Hemant Agrawal
6eaf4e7c33 bus/fslmc: set IOVA mode as physical
Setting the default iova mode as physical.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-11-07 15:39:31 +01:00
Hemant Agrawal
d5a4e3a00c bus/dpaa: set IOVA mode as physical
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2017-11-07 14:51:21 +01:00
Maxime Coquelin
447e0d3797 net/vhost: add parameter to enable IOMMU feature
Introduce a new iommu-support parameter to Vhost PMD that
passes the RTE_VHOST_USER_IOMMU_SUPPORT flag at vhost
device register time.

Default value is 0, meaning that IOMMU support is disabled
if not specified explicitly.

Example to enable IOMMU support for a given device:

--vdev 'net_vhost0,iface=/tmp/vhost-user2,iommu-support=1'

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>
2017-11-07 14:19:30 +01:00
Olivier Gournet
a49b617b86 net/mlx5: fix socket field initialization
Fixes: a1366b1a2b ("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>
2017-11-07 12:52:19 +01:00
Moti Haimovsky
aee4a03fee 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>
2017-11-07 12:47:13 +01:00
Stefan Baranoff
e59196e01c 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: 4c173302c3 ("pcap: add new driver")
Cc: stable@dpdk.org

Signed-off-by: Stefan Baranoff <sbaranoff@gmail.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-11-07 10:42:42 +01:00
Rami Rosen
cbc3661f8b 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 050fe6e9ff
("drivers/net: use ethdev allocation helper for vdev"), which
removes the usage of eth_kni_drv in the eth_kni_create() method.

Fixes: 050fe6e9ff ("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>
2017-11-07 10:34:11 +01:00
Shahaf Shuler
31b3e2b837 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: 8086cf08b2 ("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>
2017-11-07 10:19:02 +01:00
Xiaoyun Li
88e04712f4 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: c3cd3de0ab ("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>
2017-11-07 10:19:02 +01:00
Ophir Munk
e28d4ee4f0 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: bbc6a53dda ("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>
2017-11-04 00:22:51 +01:00
Thomas Monjalon
cac35e6bad net/mlx5: fix some typos
Fixes: 570acdb1da ("net/mlx5: add vectorized Rx/Tx burst for ARM")
Fixes: 3c2ddbd413 ("net/mlx5: separate shareable vector functions")
Fixes: f8b9a3bad4 ("net/mlx5: install a socket to exchange a file descriptor")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2017-11-04 00:01:22 +01:00
Adrien Mazarguil
0d03353077 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>
2017-11-03 21:30:41 +01:00
Adrien Mazarguil
b3d197b435 net/mlx4: fix function prototypes
This is done for consistency with the rest of the code.

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

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-11-03 20:37:10 +01:00
Matan Azrad
89ce4b02c6 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>
2017-11-03 20:22:09 +01:00
Matan Azrad
b68d92b45c 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: c3c977bbec ("net/mlx4: add Tx bypassing Verbs")
Fixes: 9f57340a80 ("net/mlx4: restore Rx offloads")
Fixes: 6681b84503 ("net/mlx4: add Rx bypassing Verbs")
Fixes: 62e96ffb93 ("net/mlx4: fix no Rx interrupts")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-11-03 20:22:09 +01:00
Matan Azrad
dae76a678c 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>
2017-11-03 20:22:09 +01:00
Matan Azrad
4d8e284df2 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>
2017-11-03 20:22:08 +01:00
Matan Azrad
afe67d2c99 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>
2017-11-03 20:22:08 +01:00
Matan Azrad
05be4516c9 net/mlx4: fix ring wraparound compiler hint
Remove unlikely hint from WQ wraparound check because it is
expected case.

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

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-11-03 20:22:08 +01:00
Ophir Munk
326d2cdf7b 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>
2017-11-03 20:22:07 +01:00
Matan Azrad
2eee458746 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>
2017-11-03 20:22:07 +01:00
Wei Dai
96a9fd03c2 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: 4b90a3ff26 ("i40evf: support Rx interrupt")
Fixes: 975ffea6f6 ("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>
2017-11-03 20:18:16 +01:00
Wei Dai
66b8304f9d 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: 4b90a3ff26 ("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>
2017-11-03 20:13:42 +01:00