From patchwork Fri Sep 6 12:33:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 825968 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp778790wrb; Fri, 6 Sep 2024 05:37:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWO7zt+qRdWBZP4I7609slsbUGMtzXD9M2Kk6kQ1F0C67TUUl2gpA6XQYO0IYO3V33MoVN3+A==@linaro.org X-Google-Smtp-Source: AGHT+IFGaeJa4sxNkjRo3i0h74FLjXNdxRQ1sZRkcqEVNTPBEO47F1Byj4AhxwM/c+I9SFlV4B4L X-Received: by 2002:a17:906:c14b:b0:a86:91ae:85e7 with SMTP id a640c23a62f3a-a8a885bfc28mr195664266b.8.1725626239231; Fri, 06 Sep 2024 05:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725626239; cv=none; d=google.com; s=arc-20240605; b=Hf6N4vlwqkrq/FhhNzdwTJ3GqYTfeLKAb88s8jA+am/EdS6PTeTxryaST7jlzS2j5C n2ly4Zzk65gldePBuXJtYVSC6Wd7EEl4vu2HSSU+x7fj7ysKvOd5B/yZf5FMi71+yFHk TimnQUrYH5N2liL4OpT0wDIlq9rjkRzKfUQel278+O46Fy4k3KF5tDDZuA2uSDWYjxRj OMbdkRlVHLe6f1MZCZqiQLM09BszauTRPizUVpIkaRSZKeCTGuHGiC67PDZ4quUBt6Ub KW+JDwROpHz8LjH3n34g7W71cdK+1azqBzrsI+MTlVclB8XLMHdl2QWpQMbFxa6S3HGa Kijg== 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=w5Ti40FD60twAqgTogRIah0zrrRbOJ+6aN+DRYhjcLI=; fh=1xnSqnpYa1DPcifqqeRY0YER2OXRzj8zHA65PDZaCyQ=; b=AvIBsvr/K0GhfXTMvDVQWhD17ol+nvSKXiwUR568/B4NyI0dJQJUuq2XeuHo8SB5Ef QnLazeMekd4A+NxAcf+EJZcTfdWxSbKzL6yMto3jHShBb9MjNdzUg9Qnu26evoG9mbNo aQjFx2A7x0py3gWdAp8bsMlM9TfLAIjwiG9MtuCFtsEITi/gJk7JMjpEG5uyw1o3k+fJ BYMsh3xpxSwGYQwhUVwe7cOM4drhR7GqWAPYjuJWUI7hoWeXftRebUWU24jb6R6UAeWj 8YBSqdMu9nc6kTU5ecuagLbbxfQea0HdG0ozz+dhUoTZeCoIL8pc7JowcMb32+0z2RN/ MW0w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XUyLA1hM; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a640c23a62f3a-a8a62379a72si304042566b.425.2024.09.06.05.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 05:37:19 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XUyLA1hM; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 8458088D1C; Fri, 6 Sep 2024 14:35:25 +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="XUyLA1hM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E867688D2F; Fri, 6 Sep 2024 14:35:22 +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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 0CC4588D04 for ; Fri, 6 Sep 2024 14:35:21 +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-x32d.google.com with SMTP id 5b1f17b1804b1-42bbf138477so17070565e9.2 for ; Fri, 06 Sep 2024 05:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725626120; x=1726230920; 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=w5Ti40FD60twAqgTogRIah0zrrRbOJ+6aN+DRYhjcLI=; b=XUyLA1hMQi5msT/FC9+rY9tyzD7j5ghe6kfR0BZTl7D+ShTUCN4rUuptJc782cssvV SW6cFUceSEInXpQrP3qOwgHHikr5pEGvSAYNcSBJ1Q2rselW+9VaQ41VYg2AyrK160kv wcdne49oqRFBx3xpVk9n9fi2BOOEU8HPXhJETfoni7HYxG4yJ0N/ZQDsGlcwErRpyRfK yazaNccLfK2l/Pj0WZpvefeRrELxM8JbmpoDY+fcrjn5ZGl1DFk8BPEI9nR0Ht3Pf8Fp UVz1H5yUO6AogHSCqPC2MeQxUFIvkvcGTI8h+JbTGJwffgEQZrMYjWWf3wxyTjrz1vLC zGaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725626120; x=1726230920; 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=w5Ti40FD60twAqgTogRIah0zrrRbOJ+6aN+DRYhjcLI=; b=FpLeRS/2OHGaRdp8u/vkm4upMcPkauw/4jmVx9paZCXxCvvXSrZDXS1roVB1e6BCGh b5AS/uaL/P9MJm3sUOJ9Clek4m7nTTx74wqwJYMHAj//SBeofqe5S2Ay82jgbE2lrNot ACBGxBmI67Vx+jr46feDuk4yR4gLmJbTrMyfVIvhEC76vtN7RlH/82IQv7yad5FpxNVG bBsIkDkxKzhXYm/8fUWw3+5MtRebnRjDosBy8S94bhLkfFfYFHTot7zmQHs7pEXEOTTy N6k/3mXsV1qQ7Mrk4GZimgbw2XdN0zMJavaHBFRdaWoUF2dI+9eMhX2+JZIPID44N7zh 7YWw== X-Gm-Message-State: AOJu0YyUkVAfxN77u7aIo5VKb6DkGqbDSlmQQYOrhWe9VBPGAcHU8QTE ykffKiD455GWB3IeA3grdczqv1aYHvfab84xThKFoUsgp5gX4qgTWQrq1f6gkgksGIK2rBn6D6X g1UWzSN16 X-Received: by 2002:a05:600c:1c01:b0:42b:ac94:692c with SMTP id 5b1f17b1804b1-42c9f8eede2mr19209765e9.0.1725626120302; Fri, 06 Sep 2024 05:35:20 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:1ff1:215c:d8a4:9f99]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ca05cf0e8sm19640125e9.27.2024.09.06.05.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 05:35:19 -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 , Simon Glass , Anand Moon , Baruch Siach Subject: [PATCH v10 18/25] net-lwip: add TFTP_BLOCKSIZE Date: Fri, 6 Sep 2024 14:33:34 +0200 Message-Id: <318048700dfb511c4634505adb1e95ce8be189c0.1725625913.git.jerome.forissier@linaro.org> 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 50b8fbad00d..51cd1e0207c 100644 --- a/net/lwip/tftp.c +++ b/net/lwip/tftp.c @@ -138,6 +138,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 */