From patchwork Thu Oct 3 15:46:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 832421 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp354511wra; Thu, 3 Oct 2024 08:49:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWSBm13eLGfXE847/pXnjLeBkUb118l51OaUj2iYLlrLWcJN/5IGzZTsVbT92nHjVikdD9ALQ==@linaro.org X-Google-Smtp-Source: AGHT+IGh3f77jMUTJ/d2RehgKEQx46/k0sWnCW0vmdS6PIVioYNGumjzmkCMAc3oqcFF0pyAg3RR X-Received: by 2002:a92:cd87:0:b0:3a0:9238:d3c with SMTP id e9e14a558f8ab-3a36e219623mr25432005ab.3.1727970555624; Thu, 03 Oct 2024 08:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727970555; cv=none; d=google.com; s=arc-20240605; b=EnKuwZawQb3t7wwB9YUap2dQMkc2TOEA+Kv1malw8WZ0VMyy+N53vsYNmcxRmyJiNF ZNNB1k0NrjkAB9/Mz8+vUy7bMzT0aY366BF1MBzfL+4HlbD66dnlkpyqw+KRJ2HQgx8n mkod5N2447YlVVUM6WWAEPo9ZPKNmbZgHD6kw+aGdc3YDDPKykIZmLb+KiALqF3MKUZd KWbtPvmwOrLTvt5EjGRAa7FWmqfFg4Kqm+lUt1VPe5kN0vkyBvziyS0RYQzA2NmFmng9 LUD/aU9PcQzsfFNA5V/75k3D+iV27wlFECpGLxbjk7QnHV+qhTzu6BWtWLKZsUupXxoj ED0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5G+9QtFQpBdFjhMWrV1vO4Z5+gjUnIBRwFl+FYgTv68=; fh=0b25qEv3hzIOOWq4VOVebC/hTOJSSO0hOqDEspxbJTk=; b=li+kA2aWSCsjy0I9WYhtaOaeMvRz5ImgHlupTxbMcFeoPkvEDU1EyXBjowPxmMO3QH d7jbikUfarxYfiYKCHL7k3JjNY5Zi2QsrD0m3Unx0GGbExdIqTBjzjr6qbzBCJFHVPqx tbAGDgnXKhN8a/Oqp/rSChPCxzzIa+gFOjko/gIXbSMAS3u8pOozLCQtpI3/dlR8Tq2y 8wXk58Sz3D3MpfQj8dSGjkWXt7epyYYxwRsK7Jx7YTts6W0MTuHwbrk41CrRkCcyz+y+ UA/TY5EqF6rUqZ4e4aNEmB7sjYwAxZv3GnI95yad2Wm8bi1NwZ/iJVIAjARqffYflnbe Eryg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zh+KgQvP; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id e9e14a558f8ab-3a3716362basi6259055ab.176.2024.10.03.08.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:49:15 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zh+KgQvP; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C184388EF7; Thu, 3 Oct 2024 17:47:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Zh+KgQvP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8F0D688EE8; Thu, 3 Oct 2024 17:47:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 950E688F3D for ; Thu, 3 Oct 2024 17:47:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-42cde6b5094so11349385e9.3 for ; Thu, 03 Oct 2024 08:47:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727970450; x=1728575250; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5G+9QtFQpBdFjhMWrV1vO4Z5+gjUnIBRwFl+FYgTv68=; b=Zh+KgQvPS9qXyjUYV/rKdHE5VwXnaNoaJrvVPYxNI02B8SUXxZLihk91ClFy2sAHQv rRpNUaJvCQcGpFujeI4K1sal7lE7yWplJ8vnIH3NXgvs63BSNp05eshtLh17s1Nzm/q6 WK3mZRnwhXz03+Bp5mT61VYtw3SigcoWsilgJdgeN49xToxPr9ChcW/xmQ+o4/C60Mjp lgGFyz3mNptvZITxiHLgZCRWA/R3Ulur+cyjWgU0r2BoM8H4kjAShQ5vXJMc9AXaRh7q /0KHzbn2w/LROFYaEOMV8hxgFF0yoxxGkdEH20q7JumglF/j4PZfBQM7CFR3WwxoV69c ZPrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727970450; x=1728575250; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5G+9QtFQpBdFjhMWrV1vO4Z5+gjUnIBRwFl+FYgTv68=; b=Lvw4tRlb8j7F0twAgpjmQbNOXbuS68+sdL1eW1WE117zf0FHzNVLozgmbtqG/4VDwL FYJbzOpQdc4PyxCU8Ee0HHHExuxXEy2R4EqCRMlF4XviGGjnNhfHqSpqKagNZb/FxrQz uH2NOxBaL6uGUiey50/rGjP4o+8lnB4mz0/eE1uU/vQH+5JazqUrhAXHf4FJlQaEWu5A fg0F0UN1Bw75SSZN8I6A8Kqal6VLWDUhSFjIDpChE8+VS6gtkNjWX4bwFMLypM0Ntymy 61WMW1PBcwHG3Od9E58Nttx2SqP6xVkmexCrMcZz8YKI3Ag6AQxJIEJ08Q6jQWNiV1tN zLsw== X-Gm-Message-State: AOJu0YwvNi6hSHeybVe0w9kOhBATI3QHPvkLyo1UdUBU2vz2BXSiotaX S7ChAN9IBmroCYW2msA3uZpPfgym2SUpWUeEPzjZJDsGh0reZoMUwzEJvpr92dxbUcu8PeiPr71 PQjX0ynvo X-Received: by 2002:adf:9bcf:0:b0:374:c847:83a with SMTP id ffacd0b85a97d-37cfb8b536cmr4373984f8f.8.1727970450523; Thu, 03 Oct 2024 08:47:30 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:d888:7a58:deed:47d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d08245059sm1541748f8f.55.2024.10.03.08.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 08:47:29 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Joe Hershberger , Ramon Fried , Tom Rini , Anand Moon , Baruch Siach , Simon Glass Subject: [PATCH v11 24/29] net-lwip: add TFTP_BLOCKSIZE Date: Thu, 3 Oct 2024 17:46:28 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 Reviewed-by: Ilias Apalodimas --- net/Kconfig | 20 ++++++++++---------- net/lwip/tftp.c | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/net/Kconfig b/net/Kconfig index 16a9de47e94..76ab7d91eeb 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -60,16 +60,6 @@ config SYS_FAULT_ECHO_LINK_DOWN this option is active, then CONFIG_SYS_FAULT_MII_ADDR also needs to be configured. -config TFTP_BLOCKSIZE - int "TFTP block size" - default 1468 - help - Default TFTP block size. - The MTU is typically 1500 for ethernet, so a TFTP block of - 1468 (MTU minus eth.hdrs) provides a good throughput with - almost-MTU block sizes. - You can also activate CONFIG_IP_DEFRAG to set a larger block. - config TFTP_PORT bool "Set TFTP UDP source/destination ports via the environment" help @@ -254,6 +244,16 @@ config NET_RANDOM_ETHADDR generated. It will be saved to the appropriate environment variable, too. +config TFTP_BLOCKSIZE + int "TFTP block size" + default 1468 + help + Default TFTP block size. + The MTU is typically 1500 for ethernet, so a TFTP block of + 1468 (MTU minus eth.hdrs) provides a good throughput with + almost-MTU block sizes. + You can also activate CONFIG_IP_DEFRAG to set a larger block. + endif # if NET || NET_LWIP config SYS_RX_ETH_BUFFER 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 */