diff options
author | Jerome Forissier <jerome.forissier@linaro.org> | 2024-10-16 12:04:13 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-10-16 11:11:57 -0600 |
commit | e65c5e3e73b235a89b0142d3da735b0d2271b2d9 (patch) | |
tree | 6a5bd5f97530d4c86b7cc2e759d261c8e81e8e5c /net/lwip/tftp.c | |
parent | 27d7ccda94fa03d15d4d4f6f359d9fa09c697679 (diff) |
net: lwip: add TFTP_BLOCKSIZE
Add support for setting the TFTP block size. The default value (1468)
is fine for Ethernet and allows a better throughput than the TFTP
default (512), if the server supports the blksize option of course.
I tested this change with qemu_arm64_lwip_defconfig. The throughput is
now 875 KiB/s vs. 313 KiB/s before. That is still a low number, but I
think we can't expect more without implementing the windowsize option.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'net/lwip/tftp.c')
-rw-r--r-- | net/lwip/tftp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c index 26978643313..f4d0a6aa19a 100644 --- a/net/lwip/tftp.c +++ b/net/lwip/tftp.c @@ -139,6 +139,8 @@ static int tftp_loop(struct udevice *udev, ulong addr, char *fname, if (!(err == ERR_OK || err == ERR_USE)) log_err("tftp_init_client err: %d\n", err); + tftp_client_set_blksize(CONFIG_TFTP_BLOCKSIZE); + ctx.start_time = get_timer(0); err = tftp_get(&ctx, &srvip, srvport, fname, TFTP_MODE_OCTET); /* might return different errors, like routing problems */ |