[dpdk-dev] examples/l3fwd-power: fix RX interrupt disable

Liu, Yong yong.liu at intel.com
Fri Sep 20 07:22:00 CEST 2019


> -----Original Message-----
> From: Zhang, Xiao
> Sent: Wednesday, September 11, 2019 12:10 AM
> To: dev at dpdk.org
> Cc: Liu, Yong <yong.liu at intel.com>; Zhang, Xiao <xiao.zhang at intel.com>;
> stable at 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 at dpdk.org
> 
> Signed-off-by: Xiao Zhang <xiao.zhang at 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 at intel.com>

Regards,
Marvin



More information about the dev mailing list