Skip to content

Commit

Permalink
examples/l3fwd-power: fix Rx interrupt disabling
Browse files Browse the repository at this point in the history
[ upstream commit 0412cfe ]

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: b736d64 ("examples/l3fwd-power: disable Rx interrupt when waking up")

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Marvin Liu <yong.liu@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
  • Loading branch information
xiaozha3 authored and kevintraynor committed Dec 10, 2019
1 parent 9945223 commit fbf65ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/l3fwd-power/main.c
Expand Up @@ -814,7 +814,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",
Expand Down

0 comments on commit fbf65ff

Please sign in to comment.