net/mlx4: fix premature disabling of interrupt
authorOphir Munk <ophirmu@mellanox.com>
Tue, 28 Jul 2020 11:54:06 +0000 (11:54 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 29 Jul 2020 22:41:23 +0000 (00:41 +0200)
commit54b20f94cd847c713c2c9bca281295f5d1d0663f
tree4618091051bd6e44981e9495f1bed6e6f59e3dd2
parentd7964ce192e79507d3b32b4a02e6293a40eb4708
net/mlx4: fix premature disabling of interrupt

RXQ interrupts under Linux are based on the epoll mechanism. An
expected order of operations is as follows:
1. Call rte_eth_dev_rx_intr_enable(), to arm the CQ for receiving events
on data input.
2. Block on rte_epoll_wait() with an array of file descriptors
representing the CQ events. Upon data arrival the kernel will signal an
input event on the corresponding CQ fd.
3. Call rte_eth_dev_rx_intr_disable() after the event was received and
continue in polling mode. The mlx4 implementation of
rte_eth_dev_rx_intr_disable() is to get the CQ event and ack it.

In practice applications may wake up from rte_epoll_wait() due to
timeout with no event to ack but still call
rte_eth_dev_rx_intr_disable() unconditionally.  In such cases the call
should return EAGAIN (since the file descriptors are non-blocked), as
opposed to EINVAL which indicates a real failure.  In case of EAGAIN the
PMD should not warn on "unable to disable interrupt on rx queue".

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Raslan Darawsheh <rasland@mellanox.com>
drivers/net/mlx4/mlx4_intr.c