linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: lantiq: disable interrupt before sheduling NAPI
@ 2021-06-08 21:21 Aleksander Jan Bajkowski
  2021-06-08 21:33 ` Hauke Mehrtens
  2021-06-09  2:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Aleksander Jan Bajkowski @ 2021-06-08 21:21 UTC (permalink / raw)
  To: hauke, davem, kuba, netdev, linux-kernel; +Cc: Aleksander Jan Bajkowski

This patch fixes TX hangs with threaded NAPI enabled. The scheduled
NAPI seems to be executed in parallel with the interrupt on second
thread. Sometimes it happens that ltq_dma_disable_irq() is executed
after xrx200_tx_housekeeping(). The symptom is that TX interrupts
are disabled in the DMA controller. As a result, the TX hangs after
a few seconds of the iperf test. Scheduling NAPI after disabling
interrupts fixes this issue.

Tested on Lantiq xRX200 (BT Home Hub 5A).

Fixes: 9423361da523 ("net: lantiq: Disable IRQs only if NAPI gets scheduled ")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
---
 drivers/net/ethernet/lantiq_xrx200.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
index 36dc3e5f6218..0e10d8aeffe1 100644
--- a/drivers/net/ethernet/lantiq_xrx200.c
+++ b/drivers/net/ethernet/lantiq_xrx200.c
@@ -352,8 +352,8 @@ static irqreturn_t xrx200_dma_irq(int irq, void *ptr)
 	struct xrx200_chan *ch = ptr;
 
 	if (napi_schedule_prep(&ch->napi)) {
-		__napi_schedule(&ch->napi);
 		ltq_dma_disable_irq(&ch->dma);
+		__napi_schedule(&ch->napi);
 	}
 
 	ltq_dma_ack_irq(&ch->dma);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: lantiq: disable interrupt before sheduling NAPI
  2021-06-08 21:21 [PATCH net] net: lantiq: disable interrupt before sheduling NAPI Aleksander Jan Bajkowski
@ 2021-06-08 21:33 ` Hauke Mehrtens
  2021-06-09  2:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Hauke Mehrtens @ 2021-06-08 21:33 UTC (permalink / raw)
  To: Aleksander Jan Bajkowski, davem, kuba, netdev, linux-kernel

On 6/8/21 11:21 PM, Aleksander Jan Bajkowski wrote:
> This patch fixes TX hangs with threaded NAPI enabled. The scheduled
> NAPI seems to be executed in parallel with the interrupt on second
> thread. Sometimes it happens that ltq_dma_disable_irq() is executed
> after xrx200_tx_housekeeping(). The symptom is that TX interrupts
> are disabled in the DMA controller. As a result, the TX hangs after
> a few seconds of the iperf test. Scheduling NAPI after disabling
> interrupts fixes this issue.
> 
> Tested on Lantiq xRX200 (BT Home Hub 5A).
> 
> Fixes: 9423361da523 ("net: lantiq: Disable IRQs only if NAPI gets scheduled ")
> Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>

> ---
>   drivers/net/ethernet/lantiq_xrx200.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
> index 36dc3e5f6218..0e10d8aeffe1 100644
> --- a/drivers/net/ethernet/lantiq_xrx200.c
> +++ b/drivers/net/ethernet/lantiq_xrx200.c
> @@ -352,8 +352,8 @@ static irqreturn_t xrx200_dma_irq(int irq, void *ptr)
>   	struct xrx200_chan *ch = ptr;
>   
>   	if (napi_schedule_prep(&ch->napi)) {
> -		__napi_schedule(&ch->napi);
>   		ltq_dma_disable_irq(&ch->dma);
> +		__napi_schedule(&ch->napi);
>   	}
>   
>   	ltq_dma_ack_irq(&ch->dma);
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: lantiq: disable interrupt before sheduling NAPI
  2021-06-08 21:21 [PATCH net] net: lantiq: disable interrupt before sheduling NAPI Aleksander Jan Bajkowski
  2021-06-08 21:33 ` Hauke Mehrtens
@ 2021-06-09  2:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-09  2:20 UTC (permalink / raw)
  To: Aleksander Jan Bajkowski; +Cc: hauke, davem, kuba, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Tue,  8 Jun 2021 23:21:07 +0200 you wrote:
> This patch fixes TX hangs with threaded NAPI enabled. The scheduled
> NAPI seems to be executed in parallel with the interrupt on second
> thread. Sometimes it happens that ltq_dma_disable_irq() is executed
> after xrx200_tx_housekeeping(). The symptom is that TX interrupts
> are disabled in the DMA controller. As a result, the TX hangs after
> a few seconds of the iperf test. Scheduling NAPI after disabling
> interrupts fixes this issue.
> 
> [...]

Here is the summary with links:
  - [net] net: lantiq: disable interrupt before sheduling NAPI
    https://git.kernel.org/netdev/net/c/f2386cf7c5f4

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-09  2:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08 21:21 [PATCH net] net: lantiq: disable interrupt before sheduling NAPI Aleksander Jan Bajkowski
2021-06-08 21:33 ` Hauke Mehrtens
2021-06-09  2:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).