examples/l3fwd-power: fix RX interrupt disable
Checks
Commit Message
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
> -----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
+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@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>
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@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>
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@intel.com>
24/10/2019 10:07, Hunt, David:
>
> 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@dpdk.org
> >>>
> >>> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> >> Reviewed-by: Marvin Liu <yong.liu@intel.com>
>
> This makes sense, as the corresponding rte_eth_dev_rx_intr_enable()
> already has a spinlock around it.
>
> Acked-by: David Hunt <david.hunt@intel.com>
Applied, thanks
@@ -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",