From b58bffa85df81a32a6bdf3d732dc8987834ba83f Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 2 Feb 2023 14:34:14 +0100 Subject: fs: tftp: print message when stack can't keep us with TFTP windowsize When the NIC driver doesn't configure enough buffers to keep up with a big TFTP windowsize, error reporting is less than optimal, e.g. on AX88x72A T BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBT T BBBBBBBBBBBBT BBBBBBBBBBBBBBBBBBBBBBBBBT or on older DWMAC1000 (non-EQOS): WARNING: eth0: Rx error status (8800) T BBBBBBWARNING: eth0: Rx error status (8800) While we probably want to: - decrease rate limit in __net_poll() - increase ring buffer depth for affected drivers For now, at least print a helpful warning. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20230202133415.319020-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- fs/tftp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs') diff --git a/fs/tftp.c b/fs/tftp.c index 0b0b86a1a0..a63b133caa 100644 --- a/fs/tftp.c +++ b/fs/tftp.c @@ -477,6 +477,8 @@ static void tftp_handle_data(struct file_priv *priv, uint16_t block, /* completely unexpected and unrelated to actual window; ignore the packet. */ printf("B"); + if (g_tftp_window_size > 1) + pr_warn_once("Unexpected packet. global.tftp.windowsize set too high?\n"); } else { /* The 'rc < 0' below happens e.g. when datagrams in the first part of the transfer window are dropped. -- cgit v1.2.1