mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 2/3] fs: tftp: print message when NIC can't keep us with TFTP windowsize
Date: Thu,  2 Feb 2023 13:57:37 +0100	[thread overview]
Message-ID: <20230202125738.233147-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230202125738.233147-1-a.fatoum@pengutronix.de>

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@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




  reply	other threads:[~2023-02-02 12:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 12:57 [PATCH master 1/3] include: linux/printk: implement pr_*_once macros Ahmad Fatoum
2023-02-02 12:57 ` Ahmad Fatoum [this message]
2023-02-02 12:57 ` [PATCH 3/3] include: printk: retire printk_once for pr_debug_once Ahmad Fatoum

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=20230202125738.233147-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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