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

Hunt, David david.hunt at intel.com
Thu Oct 24 10:07:02 CEST 2019


On 23/10/2019 15:32, Thomas Monjalon wrote:
> +Cc Dave, the maintainer
>
>>> 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>


Hi Marvin,
This makes sense, as the corresponding rte_eth_dev_rx_intr_enable() 
already has a spinlock around it.

Acked-by: David Hunt <david.hunt at intel.com>




More information about the dev mailing list