examples/l3fwd-power: fix RX interrupt disable

Message ID 1568131814-48424-1-git-send-email-xiao.zhang@intel.com
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • examples/l3fwd-power: fix RX interrupt disable
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance success Performance Testing PASS
ci/intel-Performance success Performance Testing PASS
ci/iol-dpdk_compile_ovs success Compile Testing PASS
ci/iol-dpdk_compile_spdk fail Compilie Testing issues
ci/iol-dpdk_compile success Compile Testing PASS
ci/checkpatch success coding style OK

Commit Message

Xiao Zhang Sept. 10, 2019, 4:10 p.m.
Interrupt will not be received when disabling RX interrupt without
synchronization mechanism sometimes which leads to wake up issue,
add spinlock to fix it.

Fixes: b736d64787fc ("mples/l3fwd-power: disable Rx interrupt when
waking up")
Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
---
 examples/l3fwd-power/main.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Liu, Yong Sept. 20, 2019, 5:22 a.m. | #1
> -----Original Message-----
> From: Zhang, Xiao
> Sent: Wednesday, September 11, 2019 12:10 AM
> To: dev@dpdk.org
> Cc: Liu, Yong <yong.liu@intel.com>; Zhang, Xiao <xiao.zhang@intel.com>;
> stable@dpdk.org
> Subject: examples/l3fwd-power: fix RX interrupt disable
> 
> Interrupt will not be received when disabling RX interrupt without
> synchronization mechanism sometimes which leads to wake up issue,
> add spinlock to fix it.
> 
> Fixes: b736d64787fc ("mples/l3fwd-power: disable Rx interrupt when
> waking up")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> ---
>  examples/l3fwd-power/main.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
> index fd8d952..ff1ad37 100644
> --- a/examples/l3fwd-power/main.c
> +++ b/examples/l3fwd-power/main.c
> @@ -880,7 +880,9 @@ sleep_until_rx_interrupt(int num)
>  		port_id = ((uintptr_t)data) >> CHAR_BIT;
>  		queue_id = ((uintptr_t)data) &
>  			RTE_LEN2MASK(CHAR_BIT, uint8_t);
> +		rte_spinlock_lock(&(locks[port_id]));
>  		rte_eth_dev_rx_intr_disable(port_id, queue_id);
> +		rte_spinlock_unlock(&(locks[port_id]));
>  		RTE_LOG(INFO, L3FWD_POWER,
>  			"lcore %u is waked up from rx interrupt on"
>  			" port %d queue %d\n",
> --
> 2.7.4

Reviewed-by: Marvin Liu
<yong.liu@intel.com>

Regards,
Marvin

Patch

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd8d952..ff1ad37 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -880,7 +880,9 @@  sleep_until_rx_interrupt(int num)
 		port_id = ((uintptr_t)data) >> CHAR_BIT;
 		queue_id = ((uintptr_t)data) &
 			RTE_LEN2MASK(CHAR_BIT, uint8_t);
+		rte_spinlock_lock(&(locks[port_id]));
 		rte_eth_dev_rx_intr_disable(port_id, queue_id);
+		rte_spinlock_unlock(&(locks[port_id]));
 		RTE_LOG(INFO, L3FWD_POWER,
 			"lcore %u is waked up from rx interrupt on"
 			" port %d queue %d\n",