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: Christian Melki <christian.melki@t2data.com>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 2/3] fs: tftp: print message when stack can't keep us with TFTP windowsize
Date: Thu,  2 Feb 2023 14:34:14 +0100	[thread overview]
Message-ID: <20230202133415.319020-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230202133415.319020-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 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 <a.fatoum@pengutronix.de>
---
v1 -> v2:
  - reword commit and warning message to point finger at
    network stack (Michael)
---
 fs/tftp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/tftp.c b/fs/tftp.c
index 0b0b86a1a07e..a63b133caa25 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.
-- 
2.30.2




  reply	other threads:[~2023-02-02 13:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 13:34 [PATCH master v2 1/3] include: linux/printk: implement pr_*_once macros Ahmad Fatoum
2023-02-02 13:34 ` Ahmad Fatoum [this message]
2023-02-02 13:34 ` [PATCH v2 3/3] include: printk: retire printk_once for pr_debug_once Ahmad Fatoum
2023-02-03  7:58 ` [PATCH master v2 1/3] include: linux/printk: implement pr_*_once macros Sascha Hauer

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=20230202133415.319020-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=christian.melki@t2data.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