mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
To: Sascha Hauer <sha@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2 09/13] tftp: implement 'windowsize' (RFC 7440) support
Date: Tue, 09 Aug 2022 11:28:16 +0200	[thread overview]
Message-ID: <lyiln1zryn.fsf@ensc-pc.intern.sigma-chemnitz.de> (raw)
In-Reply-To: <20220809084900.GJ31528@pengutronix.de> (Sascha Hauer's message of "Tue, 9 Aug 2022 10:49:00 +0200")

Sascha Hauer <sha@pengutronix.de> writes:

>> +config FS_TFTP_MAX_WINDOW_SIZE
>> +	int
>> +	prompt "maximum tftp window size (RFC 7440)"
>> +	depends on FS_TFTP
>> +	default 128
>> +	range 1 128
>> +	help
>> +	  The maximum allowed tftp "windowsize" (RFC 7440).  Higher
>> +	  value increase speed of the tftp download with the cost of
>> +	  memory (1432 bytes per slot).
>> +
>> +	  Requires tftp "windowsize" (RFC 7440) support on server side
>> +	  to have an effect.
>
> Can we agree on some sane default here and drop this from Kconfig?

I think, it is difficult to find a sane default.  Processors like iMX8
can deal with large window sizes, but low end ones like iMX6ULL can not
handle data fast enough and require smaller sizes (around max 30).

Workloads like writing to slow memory (cp /mnt/tftp/... /dev/nand) might
require smaller sizes too.  Or networks with high drop rates.

That's why, I think it should be possible to configure it in some
_defconfig.


>> +/* calculate fifo so that it can hold the complete window plus the incoming
>> +   packet.  Add some extra space just in case...  */
>> +#define TFTP_FIFO_SIZE		(TFTP_MTU_SIZE * TFTP_MAX_WINDOW_SIZE + 2048)
>
> Memory should be allocated according to the actual window size, not to
> the maximum window size.

ok; I will try it.  Moving 'kfifo_alloc()' should be possible in

| static struct file_priv *tftp_do_open(struct device_d *dev,
| 		int accmode, struct dentry *dentry, bool is_getattr)
| 
| 	priv->fifo = kfifo_alloc(TFTP_FIFO_SIZE);
| 
| 		ret = tftp_poll(priv);


> Otherwise I don't see a reason to decrease the window size using
> global.tftp.windowsize when the memory allocated is always the same.

As I said above: some workloads or networks with a high packet drop rate
work better with lower window sizes.



Enrco



  reply	other threads:[~2022-08-09  9:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18 12:22 [PATCH 00/13] add "windowsize" (RFC 7440) support for tftp Enrico Scholz
2022-07-18 12:22 ` [PATCH 01/13] progress: add close_progress() to display some statistics Enrico Scholz
2022-07-18 12:22 ` [PATCH 02/13] libfile:copy_file: show statistics in verbose mode Enrico Scholz
2022-07-18 12:22 ` [PATCH 03/13] tftp: minor refactoring of RRQ/WRQ packet generation code Enrico Scholz
2022-07-18 12:22 ` [PATCH 04/13] tftp: replace hardcoded blksize by global constant Enrico Scholz
2022-07-18 12:22 ` [PATCH 05/13] tftp: record whether tftp file is opened for lookup operation only Enrico Scholz
2022-07-18 12:22 ` [PATCH 06/13] tftp: reduce block size on lookup requests Enrico Scholz
2022-07-18 12:22 ` [PATCH 07/13] tftp: refactor data processing Enrico Scholz
2022-07-18 12:22 ` [PATCH 08/13] tftp: detect out-of-memory situations Enrico Scholz
2022-07-18 12:22 ` [PATCH 09/13] tftp: implement 'windowsize' (RFC 7440) support Enrico Scholz
2022-07-31 11:36   ` [PATCH v2 " Enrico Scholz
2022-08-09  8:49     ` Sascha Hauer
2022-08-09  9:28       ` Enrico Scholz [this message]
2022-08-09  9:52         ` Sascha Hauer
2022-07-18 12:22 ` [PATCH 10/13] tftp: do not use 'priv->block' for RRQ Enrico Scholz
2022-07-18 12:22 ` [PATCH 11/13] tftp: reorder tftp packets Enrico Scholz
2022-08-09  8:58   ` Sascha Hauer
2022-07-18 12:22 ` [PATCH 12/13] tftp: allow to change tftp port Enrico Scholz
2022-08-09  8:12   ` Sascha Hauer
2022-07-18 12:22 ` [PATCH 13/13] tftp: add sanity check for OACK response Enrico Scholz
2022-07-31 11:36   ` [PATCH v2 " Enrico Scholz
2022-08-09  9:02 ` [PATCH 00/13] add "windowsize" (RFC 7440) support for tftp Sascha Hauer
2022-08-09  9:35   ` Enrico Scholz

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=lyiln1zryn.fsf@ensc-pc.intern.sigma-chemnitz.de \
    --to=enrico.scholz@sigma-chemnitz.de \
    --cc=barebox@lists.infradead.org \
    --cc=sha@pengutronix.de \
    /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