From: Xiao Zhang Date: Tue, 10 Sep 2019 16:10:14 +0000 (+0800) Subject: examples/l3fwd-power: fix Rx interrupt disabling X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0412cfeff907bb9102a2ca834e95ef8c6767f538;p=dpdk.git examples/l3fwd-power: fix Rx interrupt disabling 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: b736d64787 ("examples/l3fwd-power: disable Rx interrupt when waking up") Cc: stable@dpdk.org Signed-off-by: Xiao Zhang Reviewed-by: Marvin Liu Acked-by: David Hunt --- diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index a03f64a1a3..d049d8a5dc 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",