[PATCH master 2/3] fs: tftp: print message when NIC can't keep us with TFTP windowsize
Ahmad Fatoum
a.fatoum at pengutronix.de
Thu Feb 2 04:57:37 PST 2023
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 Layerscape FMan:
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 increase ring buffer depth in the drivers of
these NICs, for now, at least print a helpful warning.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
fs/tftp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/tftp.c b/fs/tftp.c
index 0b0b86a1a07e..0f7a40e26abd 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 too high for NIC?\n");
} else {
/* The 'rc < 0' below happens e.g. when datagrams in the first
part of the transfer window are dropped.
--
2.30.2
More information about the barebox
mailing list