[dpdk-dev] [PATCH v3] net/mlx5: return EAGAIN on premature disable interrupt calls

Raslan Darawsheh rasland at mellanox.com
Wed Jul 22 11:11:38 CEST 2020


Hi,

> -----Original Message-----
> From: Ophir Munk <ophirmu at mellanox.com>
> Sent: Tuesday, July 21, 2020 5:41 PM
> To: dev at dpdk.org
> Cc: Raslan Darawsheh <rasland at mellanox.com>; Ophir Munk
> <ophirmu at mellanox.com>; Matan Azrad <matan at mellanox.com>
> Subject: [PATCH v3] net/mlx5: return EAGAIN on premature disable interrupt
> calls
> 
> 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 mlx5 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".
> 
> This commit fixes a earlier commit where the returned value 0 from
> function devx_get_event() - was considered an error.
> 
> Fixes: 19e429e5c7c2 ("net/mlx5: implement CQ for RxQ using DevX API")
> 
> Signed-off-by: Ophir Munk <ophirmu at mellanox.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
> Acked-by: Raslan Darawsheh <rasland at mellanox.com>
> ---


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh


More information about the dev mailing list