diff mbox series

net: ftgmac100: Enable TX interrupt to avoid TX timeout

Message ID 20240904103116.4022152-1-jacky_chou@aspeedtech.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: ftgmac100: Enable TX interrupt to avoid TX timeout | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 7 this patch: 7
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 7
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-09-04--15-00 (tests: 718)

Commit Message

Jacky Chou Sept. 4, 2024, 10:31 a.m. UTC
Currently, the driver only enables RX interrupt to handle RX
packets and TX resources. Sometimes there is not RX traffic,
so the TX resource needs to wait for RX interrupt to free.
This situation will toggle the TX timeout watchdog when the MAC
TX ring has no more resources to transmit packets.
Therefore, enable TX interrupt to release TX resources at any time.

Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
---
 drivers/net/ethernet/faraday/ftgmac100.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Lunn Sept. 5, 2024, 8:50 p.m. UTC | #1
On Wed, Sep 04, 2024 at 06:31:16PM +0800, Jacky Chou wrote:
> Currently, the driver only enables RX interrupt to handle RX
> packets and TX resources. Sometimes there is not RX traffic,
> so the TX resource needs to wait for RX interrupt to free.
> This situation will toggle the TX timeout watchdog when the MAC
> TX ring has no more resources to transmit packets.
> Therefore, enable TX interrupt to release TX resources at any time.

This looks reasonable. FTGMAC100_INT_ALL is used when NAPI polling is
not being used, so the extra interrupts should not cause additional
load.

Is this a fix? How easy is it to trigger the issue?

   Andrew
Jakub Kicinski Sept. 5, 2024, 9:47 p.m. UTC | #2
On Wed, 4 Sep 2024 18:31:16 +0800 Jacky Chou wrote:
> Currently, the driver only enables RX interrupt to handle RX
> packets and TX resources. Sometimes there is not RX traffic,
> so the TX resource needs to wait for RX interrupt to free.
> This situation will toggle the TX timeout watchdog when the MAC
> TX ring has no more resources to transmit packets.
> Therefore, enable TX interrupt to release TX resources at any time.

Please answer Andrew's question (preferably send a v2 with the answer
as part of the commit message). Add a fixes tag, I think this is where
the bug was added?

Fixes: 10cbd6407609 ("ftgmac100: Rework NAPI & interrupts handling")

And when you send v2, please make sure to CC the author (Benjamin).
Andrew Lunn Sept. 6, 2024, 11:48 a.m. UTC | #3
On Fri, Sep 06, 2024 at 01:57:56AM +0000, Jacky Chou wrote:
> Hello,
> 
> When I am verifying iperf3 over UDP, the network hangs.
> Like the log below.
> 
> root# iperf3 -c 192.168.100.100 -i1 -t10 -u -b0
> Connecting to host 192.168.100.100, port 5201
> [  4] local 192.168.100.101 port 35773 connected to 192.168.100.100 port 5201
> [ ID] Interval           Transfer     Bandwidth       Total Datagrams
> [  4]   0.00-20.42  sec   160 KBytes  64.2 Kbits/sec  20
> [  4]  20.42-20.42  sec  0.00 Bytes  0.00 bits/sec  0
> [  4]  20.42-20.42  sec  0.00 Bytes  0.00 bits/sec  0
> [  4]  20.42-20.42  sec  0.00 Bytes  0.00 bits/sec  0
> [  4]  20.42-20.42  sec  0.00 Bytes  0.00 bits/sec  0
> [  4]  20.42-20.42  sec  0.00 Bytes  0.00 bits/sec  0
> [  4]  20.42-20.42  sec  0.00 Bytes  0.00 bits/sec  0
> [  4]  20.42-20.42  sec  0.00 Bytes  0.00 bits/sec  0
> [  4]  20.42-20.42  sec  0.00 Bytes  0.00 bits/sec  0
> [  4]  20.42-20.42  sec  0.00 Bytes  0.00 bits/sec  0
> - - - - - - - - - - - - - - - - - - - - - - - - -
> [ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total
> Datagrams
> [  4]   0.00-20.42  sec   160 KBytes  64.2 Kbits/sec  0.000 ms  0/20 (0%)
> [  4] Sent 20 datagrams
> iperf3: error - the server has terminated The network topology is FTGMAC
> connects directly to a PC. UDP does not need to wait for ACK, unlike TCP.
> Therefore, FTGMAC needs to enable TX interrupt to release TX resources instead
> of waiting for the RX interrupt.

Please don't top post.

So this does seem like a fix. Please read through:

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

You need a Fixes: tag, CC: stable tag, use the correct tree, etc.

    Andrew

---
pw-bot: cr
diff mbox series

Patch

diff --git a/drivers/net/ethernet/faraday/ftgmac100.h b/drivers/net/ethernet/faraday/ftgmac100.h
index 63b3e02fab16..4968f6f0bdbc 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.h
+++ b/drivers/net/ethernet/faraday/ftgmac100.h
@@ -84,7 +84,7 @@ 
 			    FTGMAC100_INT_RPKT_BUF)
 
 /* All the interrupts we care about */
-#define FTGMAC100_INT_ALL (FTGMAC100_INT_RPKT_BUF  |  \
+#define FTGMAC100_INT_ALL (FTGMAC100_INT_RXTX  |  \
 			   FTGMAC100_INT_BAD)
 
 /*