From: David Miller <davem@davemloft.net>
To: grygorii.strashko@ti.com
Cc: netdev@vger.kernel.org, nsekhar@ti.com,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH] net: ethernet: ti: cpsw: fix net watchdog timeout
Date: Wed, 07 Feb 2018 21:57:35 -0500 (EST) [thread overview]
Message-ID: <20180207.215735.1518454397358783732.davem@davemloft.net> (raw)
In-Reply-To: <20180207011706.13393-1-grygorii.strashko@ti.com>
From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: Tue, 6 Feb 2018 19:17:06 -0600
> It was discovered that simple program which indefinitely sends 200b UDP
> packets and runs on TI AM574x SoC (SMP) under RT Kernel triggers network
> watchdog timeout in TI CPSW driver (<6 hours run). The network watchdog
> timeout is triggered due to race between cpsw_ndo_start_xmit() and
> cpsw_tx_handler() [NAPI]
>
> cpsw_ndo_start_xmit()
> if (unlikely(!cpdma_check_free_tx_desc(txch))) {
> txq = netdev_get_tx_queue(ndev, q_idx);
> netif_tx_stop_queue(txq);
>
> ^^ as per [1] barier has to be used after set_bit() otherwise new value
> might not be visible to other cpus
> }
>
> cpsw_tx_handler()
> if (unlikely(netif_tx_queue_stopped(txq)))
> netif_tx_wake_queue(txq);
>
> and when it happens ndev TX queue became disabled forever while driver's HW
> TX queue is empty.
>
> Fix this, by adding smp_mb__after_atomic() after netif_tx_stop_queue()
> calls and double check for free TX descriptors after stopping ndev TX queue
> - if there are free TX descriptors wake up ndev TX queue.
>
> [1] https://www.kernel.org/doc/html/latest/core-api/atomic_ops.html
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Applied, thanks.
next prev parent reply other threads:[~2018-02-08 2:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-07 1:17 Grygorii Strashko
2018-02-07 3:03 ` Ivan Khoronzhuk
2018-02-07 13:31 ` Ivan Khoronzhuk
2018-02-07 18:19 ` Grygorii Strashko
2018-02-07 23:07 ` Ivan Khoronzhuk
2018-02-07 23:30 ` Ivan Khoronzhuk
2018-02-08 2:57 ` David Miller [this message]
2018-02-08 16:04 ` Grygorii Strashko
2018-02-08 18:50 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180207.215735.1518454397358783732.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=grygorii.strashko@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nsekhar@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®