summaryrefslogtreecommitdiffstats
path: root/fs/Kconfig
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>2022-08-30 09:38:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-09-12 12:09:43 +0200
commit207210e9d07f3437b67e6a6fb15843052ebe3ac8 (patch)
treee809040760addad87fe9372c5c618f0c1a24623e /fs/Kconfig
parent46ff23b4468dabf5cec3ca6db1bad8dab4818943 (diff)
downloadbarebox-207210e9d07f3437b67e6a6fb15843052ebe3ac8.tar.gz
barebox-207210e9d07f3437b67e6a6fb15843052ebe3ac8.tar.xz
tftp: reorder tftp packets
With the tftp "windowsize" option, reordering of udp datagrams becomes an issue. Depending on the network topology, this reordering occurs several times with large tftp transfers and will heavily reduce the transfer speed. This patch adds a packet cache so that datagrams can be reassembled in the correct order. Because it increases memory usage and barebox binary size, it is an Kconfig option. bloat-o-meter reports with a non-zero FS_TFTP_REORDER_CACHE_SIZE | add/remove: 3/0 grow/shrink: 4/0 up/down: 916/0 (916) | Function old new delta | tftp_handler 920 1244 +324 | tftp_put_data - 184 +184 | tftp_window_cache_remove - 124 +124 | tftp_window_cache_get_pos - 120 +120 | tftp_allocate_transfer 104 188 +84 | tftp_do_close 260 312 +52 | tftp_send 384 412 +28 | Total: Before=630104, After=631020, chg +0.15% After setting FS_TFTP_REORDER_CACHE_SIZE Kconfig option to 0, numbers are going down to | add/remove: 0/0 grow/shrink: 3/0 up/down: 152/0 (152) | Function old new delta | tftp_handler 920 1012 +92 | tftp_allocate_transfer 104 136 +32 | tftp_send 384 412 +28 | Total: Before=630104, After=630256, chg +0.02% Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Link: https://lore.barebox.org/20220830073816.2694734-19-enrico.scholz@sigma-chemnitz.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/Kconfig')
-rw-r--r--fs/Kconfig22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/Kconfig b/fs/Kconfig
index 0c49342859..cf884e0646 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -57,6 +57,28 @@ config FS_TFTP_MAX_WINDOW_SIZE
Requires tftp "windowsize" (RFC 7440) support on server side
to have an effect.
+config FS_TFTP_REORDER_CACHE_SIZE
+ int
+ prompt "number of out-of-order tftp packets to be cached"
+ depends on FS_TFTP
+ default 16 if FS_TFTP_MAX_WINDOW_SIZE > 16
+ default 0 if FS_TFTP_MAX_WINDOW_SIZE = 1
+ ## TODO: it should be 'FS_TFTP_MAX_WINDOW_SIZE - 1' but this
+ ## is not supported by Kconfig
+ default FS_TFTP_MAX_WINDOW_SIZE
+ range 0 FS_TFTP_MAX_WINDOW_SIZE
+ help
+ UDP allows reordering of datagrams; with this option,
+ unexpected tftp packets will be cached and later
+ reassembled. This increases stability of the tftp download
+ with the cost of memory (around 1440 bytes per cache
+ element) and barebox binary size (around 700 bytes).
+
+ A value of 0 disables caching.
+
+ Requires tftp "windowsize" (RFC 7440) support on server side
+ to have an effect.
+
config FS_OMAP4_USBBOOT
bool
prompt "Filesystem over usb boot"