From patchwork Wed Oct 16 10:04:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 835804 Delivered-To: patch@linaro.org Received: by 2002:a5d:6804:0:b0:37d:45d0:187 with SMTP id w4csp346918wru; Wed, 16 Oct 2024 03:06:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVCH6LE7Nb5TAVGkLqkYu/a3CaXTb+/k+GvOJtjbnEdZuTSSAv3M+RlcrfgKINimAuhZpps7g==@linaro.org X-Google-Smtp-Source: AGHT+IGK5st4FxHNdh2pLuQ1tmWCkCTC77xf6FQCO3WXwRCPgW8x2HSKD7EypAXOoWY4pQHM8wrR X-Received: by 2002:a92:c24f:0:b0:3a3:449b:5989 with SMTP id e9e14a558f8ab-3a3dc4f635emr33445125ab.21.1729073207340; Wed, 16 Oct 2024 03:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729073207; cv=none; d=google.com; s=arc-20240605; b=QkYCdYhux0agGOY3vzo9iCtmVWuRcTN2OPVfcRI4tneH8Ah8ggN9xXNXcn4yN1FELx eka6YpYdxlsfHueEzEvLKfAUjRErfwbysnPeOoMPWjZLsgjWiL348r6IOglMkW6YuQDl gFvFXqs+hOormIhffewJzHeAfVsC90z5kY3SvvynFB65pmArF8Rxgm8pVY9caZdT8PIT Y8gLVWn39CxEcb797RK7pG69rr89lY+u8rDMN6XJcBQg/ZrJR3zJBOovvKTCiyFIT/CE 3Uoof6FC4MqFKsWJZlos4O0zulAZ5A/v3lCwWcbbxN9atxks8tqWA0gDajO/ywNrwoHH uSbw== 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=8LAzHPYFumYV4f2J8/2jQOtKLAr6TBnp6a+gbEwg0U4=; b=e9a8QyRvEDi3Cslp2Zzg+lMtK24GoyWGFmfghLE5ieJ56kEpr4ojbI7X+ObD0DkNJx gr6zxba58qA4I/2B5tfIfo5IwhG48G2WgVWDi+tYItKx3vTWCTbTC0qD/GyQczwN2qB+ 0tBXd1pkA3eN55BIvIcTq97XWrNM75CUlPuWQcvvctOkxzRe+r3ZxVTa8HXBmGq5Shwi qe96GPwRVVijCyCMv+TygRwkuIUr7i1sWpw9QRiiqibR3lFtVF1NoerpniOk2X8QysMs /F49agQAcOubOG4omUULjnH4rvTdnPCbAEot+IPW3hp6V+5OxH0mtQlpbP8sO9WhIsXN 2l4A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YZudyCAf; 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 e9e14a558f8ab-3a3d71d3203si16646115ab.164.2024.10.16.03.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 03:06:47 -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=YZudyCAf; 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 68A9589024; Wed, 16 Oct 2024 12:05:18 +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="YZudyCAf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2300689043; Wed, 16 Oct 2024 12:05:15 +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-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 22E0688FCF for ; Wed, 16 Oct 2024 12:05:13 +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-x331.google.com with SMTP id 5b1f17b1804b1-43140a2f7f7so14955765e9.1 for ; Wed, 16 Oct 2024 03:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729073112; x=1729677912; 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=YZudyCAfJOvDLvDMeoQv1aCH0N/O8KmTz+TPs9AaJBMbLQSQQyMj8wtUcZmDLlHxtr GVkU3yaBwe+VAkcF5we7eOv65eW7nDPHKViczbaE7v0j+FGf6eWGk5e85AGnOwucAy9I Vbv7qCZ2Cw8unQipONzLuFSZekKZjbc2XajkXql0++WaRMJPoNFlZQBNVyYbD8Gb7rQ2 muCm+i+55MNoZ/R45UDtqZfBtZ37pwYFdTLgbTkPzbwuIr/TKjFiCCWW5GIlncgN/0CR hdjHJas+PGWFM6DGx/k9uo1hZdNQv5KwZt1tj3k9YuiBjVE0fZPnVErOO2y4qj6g4BDB hyeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729073112; x=1729677912; 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=eqz1aSJrHwub6qBxk7SriuHW2bV5RNnXjFWxWWG1X327I3ptBwwFcZmqcl4XIHLcpd M5DOHvAkh8yptPRNiuT1/taouaYlEU0GSDMrUXYlz3kv7IykgOMfveUqsAGSEhBteMf8 SrLTwQPlemADmP5gtK/11C/U27xn5mYJqI+mRy2n55AeXTbYSliHda6bDXXCpjv2d4SP lmWLcEBHMW+h1aNHZYAANDMd/e/ECtcqvmh2J07yzwi3MGH0PPDxUjyLxgiyCpbZlTrz fDebIl3vy1XngmhIovhHbjgFmnpAPkEmrtdlkOnMJ/omwEjvAEhtiMk0Z/+htaWsu+H8 NTfg== X-Gm-Message-State: AOJu0Yws2QpkimhgFh2pvLxFLnGVT/sUDR5mCly53XvFXvm/CCcEYSod Lk4fLT4SntvYJY3nodWo74s1srY1Xu0InGYC53TZBTxt9cI0qU4CSbnAfNOfkxWoSqimaFEPbka T1mqu5mlu X-Received: by 2002:a05:600c:348d:b0:42c:bb10:7292 with SMTP id 5b1f17b1804b1-4314a283c84mr32736995e9.1.1729073112357; Wed, 16 Oct 2024 03:05:12 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6417:8cf6:a7f7:ee38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4313f56f241sm44634515e9.22.2024.10.16.03.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 03:05:12 -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 , Baruch Siach , Simon Glass , Anand Moon Subject: [PATCH v13 19/21] net: lwip: add TFTP_BLOCKSIZE Date: Wed, 16 Oct 2024 12:04:13 +0200 Message-Id: <73f71d0e474d581a693e980ab95beccd23e8f646.1729070678.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 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 */