From nobody Thu Dec 16 10:53:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 16FFC18F1088; Thu, 16 Dec 2021 10:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JF89F37QMz4f8p; Thu, 16 Dec 2021 10:53:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2454A2E4F1; Thu, 16 Dec 2021 10:53:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BGArLuD091121; Thu, 16 Dec 2021 10:53:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BGArLqm091120; Thu, 16 Dec 2021 10:53:21 GMT (envelope-from git) Date: Thu, 16 Dec 2021 10:53:21 GMT Message-Id: <202112161053.1BGArLqm091120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 4f36ed513cc8 - main - loader: tftp: Don't let tftp timeout List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f36ed513cc8fc3fe780b23ecda8cb1fdc6edf7d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639652001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l+vjqTI/d1ECBcXVHpCSBMrKjtL3iIgGCAvMxDF9cfQ=; b=p2qzHO3pYt/OZhBfb4DHkM/iMQAz9r9J6hVds+Snk/jGh4ndtCmYOWdl6JP0shi0IJByBJ qMrTFPiinXwEWRgB5QmNqaPgXpkLtVAxCXFIVNxb8wSTN8WpW+jImiVOuDdBjEPtm6BDJD TD9d+JVS0F6+zMhV389YaXvf+9hpIfY5RQfkUshysGnqJc3cihp7IIk4RP/uYgBSc8u/Wo Cvo33UmGEgtzdLbc1EG5LqVwT3JlcYQUtMIAMcKCotZBzzMEq8+N9EbbyTuBSjFKe8BzTg uJlcXNCgX/EKAawUBY2VouEqzO4AZqT3mkomyNtYY0ibe1LvutfaQlkJAxBFfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639652001; a=rsa-sha256; cv=none; b=LQs0Cw3Anu8VuZzYhbosvQunKp1fLTYK/MTuaV6W6CHjeIYm2n9AoXGtr5Dt8eZ/ARC1xC 2ipjA8V2Vxd3XIYNfiLfn6ROA5UGO60+71dcBUDPttF3Ug1/xHiX/5L0gUz3gSWMMMXIm4 nP6xwOcx/mLV5mY2J3prKDASs1VVXy76T6sgkjKU7khN383I+acv+ygnkpjfE7R9cW+gKj mwzYZ6xHXfZhwHhUTHBfHWaLyJm7NKUSkRFmzQuAI8+8sZ1xfLI9Ef2i9+ZXyxdcNiXvT3 XXIizLS753FKbyoaKqDRjtkIVXmAGaJ9By52ppSklSnTObt9biqssYTsZCps+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=4f36ed513cc8fc3fe780b23ecda8cb1fdc6edf7d commit 4f36ed513cc8fc3fe780b23ecda8cb1fdc6edf7d Author: Emmanuel Vadot AuthorDate: 2021-12-13 09:35:23 +0000 Commit: Emmanuel Vadot CommitDate: 2021-12-16 10:50:34 +0000 loader: tftp: Don't let tftp timeout When we load a kernel or module we open/close it a few times. Since we're using the same port number each time and that we requested the same file the ACK that we send are valid on the server side and the server send us the file multiple times. This makes tftp loading time very inconsistant due to the UDP "flood" that we have to process. Reviewed by: imp, tsoome MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33407 --- stand/libsa/tftp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stand/libsa/tftp.c b/stand/libsa/tftp.c index 78eedddcb1f6..dcfce29a9968 100644 --- a/stand/libsa/tftp.c +++ b/stand/libsa/tftp.c @@ -114,6 +114,8 @@ struct tftp_handle { unsigned long tftp_tsize; void *pkt; struct tftphdr *tftp_hdr; + char *tftp_cache; + bool lastacksent; }; struct tftprecv_extra { @@ -378,6 +380,7 @@ tftp_makereq(struct tftp_handle *h) if (res < h->tftp_blksize) { h->islastblock = 1; /* very short file */ tftp_sendack(h, h->currblock); + h->lastacksent = true; } return (0); } @@ -594,7 +597,8 @@ tftp_close(struct open_file *f) struct tftp_handle *tftpfile; tftpfile = f->f_fsdata; - /* let it time out ... */ + if (tftpfile->lastacksent == false) + tftp_senderr(tftpfile, 0, "No error: file closed"); if (tftpfile) { free(tftpfile->path);