numam-dpdk/drivers/net
Adrien Mazarguil e1016cb733 net/mlx5: fix Rx interrupts management
This commit addresses various issues that may lead to undefined behavior
when configuring Rx interrupts.

While failure to create a Rx queue completion channel in rxq_ctrl_setup()
prevents that queue from being created, existing queues still have theirs.
Since the error handler disables dev_conf.intr_conf.rxq as well, subsequent
calls to rxq_ctrl_setup() create Rx queues without interrupts. This leads
to a scenario where not all Rx queues support interrupts; missing checks on
the presence of completion channels may crash the application.

Considering that the PMD is not supposed to disable user-provided
configuration parameters (dev_conf.intr_conf.rxq), and that these can
change for subsequent rxq_ctrl_setup() calls anyway, properly supporting a
mixed mode where not all Rx queues have interrupts enabled is a better
approach.

To do so with a minimum set of changes, priv_intr_efd_enable() and
priv_create_intr_vec() are first refactored as a single
priv_rx_intr_vec_enable() function (same for their "disable" counterparts).
Since they had to be used together, there was no point in keeping them
separate.

Remaining changes:

- Always clean up before reconfiguring interrupts to avoid memory leaks.
- Always clean up when closing the device.
- Use malloc()/free() instead of their rte_*() counterparts since there is
  no need to store the vector in huge pages-backed memory.
- Allow more Rx queues than the size of the event file descriptor array as
  long as Rx interrupts are not requested on all of them.
- Properly clean up interrupt handle when disabling Rx interrupts (nb_efd
  and intr_vec reset to 0).
- Check completion channel presence while toggling Rx interrupts on a given
  queue.

Fixes: 3c7d44af25 ("net/mlx5: support user space Rx interrupt event")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-07-06 15:00:56 +02:00
..
af_packet drivers/net: use device name from device structure 2017-07-06 00:17:02 +02:00
ark fix typos using codespell utility 2017-06-14 23:54:13 +02:00
avp net/avp: remove redundant assignment 2017-06-12 10:41:26 +01:00
bnx2x fix typos using codespell utility 2017-06-14 23:54:13 +02:00
bnxt drivers/net: use device name from device structure 2017-07-06 00:17:02 +02:00
bonding drivers/net: use device name from device structure 2017-07-06 00:17:02 +02:00
cxgbe net/cxgbe: fix alignment for data offset in mbuf 2017-07-06 15:00:56 +02:00
dpaa2 ethdev: remove driver name from device private data 2017-06-12 16:27:44 +01:00
e1000 ethdev: add return values to callback process API 2017-07-01 17:19:55 +02:00
ena drivers/net: add generic ethdev macro to get PCI device 2017-06-12 10:41:25 +01:00
enic net/enic: replace check for SSE4 with check for x86 2017-07-04 14:39:18 +02:00
fm10k drivers/net: add generic ethdev macro to get PCI device 2017-06-12 10:41:25 +01:00
i40e net/i40e: get information about DDP profile 2017-07-06 15:00:56 +02:00
ixgbe net/ixgbe: support packet type parsing in SSE Rx 2017-07-06 15:00:56 +02:00
kni drivers/net: use device name from device structure 2017-07-06 00:17:02 +02:00
liquidio net/liquidio: do not touch mbuf initialized fields 2017-06-12 10:41:29 +01:00
mlx4 net/mlx4: fix Rx interrupts management 2017-07-06 15:00:56 +02:00
mlx5 net/mlx5: fix Rx interrupts management 2017-07-06 15:00:56 +02:00
nfp eal: introduce integer log2 function 2017-07-03 10:44:12 +02:00
null net/null: do not touch mbuf next or nb segs on Rx 2017-06-12 10:41:25 +01:00
pcap drivers/net: use ethdev allocation helper for vdev 2017-04-18 19:04:49 +02:00
qede fix typos using codespell utility 2017-06-14 23:54:13 +02:00
ring drivers/net: use device name from device structure 2017-07-06 00:17:02 +02:00
sfc ethdev: add return values to callback process API 2017-07-01 17:19:55 +02:00
szedata2 net/szedata2: use macro from common library 2017-07-06 15:00:56 +02:00
tap net/tap: support flow API isolated mode 2017-07-06 15:00:56 +02:00
thunderx net/thunderx: fix build with clang 2017-07-03 22:28:03 +02:00
vhost ethdev: add return values to callback process API 2017-07-01 17:19:55 +02:00
virtio ethdev: add return values to callback process API 2017-07-01 17:19:55 +02:00
vmxnet3 ethdev: remove driver name from device private data 2017-06-12 16:27:44 +01:00
xenvirt ethdev: remove driver name from device private data 2017-06-12 16:27:44 +01:00
Makefile net/dpaa2: introduce NXP DPAA2 driver 2017-04-19 15:37:37 +02:00