From nobody Mon Dec 16 14:53:00 2024 X-Original-To: dev-commits-src-all@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 4YBjbw5cGGz5hXC3; Mon, 16 Dec 2024 14:53:00 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBjbw3sk1z3y4q; Mon, 16 Dec 2024 14:53:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360780; 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=cglqA4itI9Nf+ZF7ggogG1rw3WOH8vvnHuguHNjPZu8=; b=SBWy2E0ro6vJtknuYWv1sYQSfDv2lAIUr0t30skkgnWJseAaQkph/Go0Kt1g+RXEoad9pq UhVDfbMmrB6UrqTfwE7xIoarFQzF7R08afyTMzLRYAninKvmZPJsH/GnOJ7lhry4o+G8cm jiZx86JdtxtHh3gmSbJ/a/Ycs6/8Ori3ldYDUsJ8S7qG6cS21dB8WnaggOA3l3bU4fBTSi ZqHrCOaWxsq4JI1x+EGRJuTZRnzvPy+wAZFz2rK+DWC6ik6azKuHn95w8tIGhNTfo185M7 er0xk6WkHOCopGEGs9T5j6/VZtMNU3w+0EiI2WNEfq5GKgGkee8pWAtznKYASA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734360780; 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=cglqA4itI9Nf+ZF7ggogG1rw3WOH8vvnHuguHNjPZu8=; b=lMnZv7l4loK5k4Yre+mi81KUxs8A7vfeWdvZ8yJeSjrdcOg6aJfsyCKYFl1U7/myPJAai3 tnroXtpYex/5mGtT9lBzSTj332jrllLclV8F6k7NIa309Q8GOcUI7EvboIqytv2FwPDiFd SVPTp5emyUt5g3cqs6CA6pPLWhgNk6ccCFJRpm1WyTwO4cGjPtOY8MrJhO5IV/EikVmayf sR7KsqCk0a0gdYmu/f/yPuie7zWlUW4FPApaNLJK725ycJJEw77YKSPGi8O25EdrOb64nI IUvvgF2BQaCOwK0741ryoR8aA1z8IQxBvQjaEICnsOCjPCgLXpPYnYuIGCqwWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734360780; a=rsa-sha256; cv=none; b=DFPDJoPqoWdSI8fjc47RycvaO9wp1LHbWEz52kJAoooPlBxhxWKBdczG94cgO0Xc+yNepL 5YZyWzD3OA8iuqJfiGwJ5I9FZ3dixFvq7h2oCFe1BFfChwxg/ZY5Z3Wimh+tAAlRaI96Y/ lEm+Iw7YUcbvdfTS0ZfKrS8/awvdChGJ86gLAlD05D0+VjIOREMpYnrSoiOZzhxMVBkLJv dBc1unKgwzXXNGvPK4lCf+i03Oz43Nh+Y5DbTOKF/9yDTyeYRd3yLwW5N0CFWq8jJdOU5o 9HRzcw6rCG7eVmTLXSYIbFRgXu788Of5tfgoROo2HEGvqvabNABlnA5OTM3LBg== 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 4YBjbw3Tpczy8X; Mon, 16 Dec 2024 14:53:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGEr0Jt072197; Mon, 16 Dec 2024 14:53:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGEr0ds072194; Mon, 16 Dec 2024 14:53:00 GMT (envelope-from git) Date: Mon, 16 Dec 2024 14:53:00 GMT Message-Id: <202412161453.4BGEr0ds072194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 3604a050eedb - main - tcp_hpts: refactor the per tcpcb call to either input/output method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3604a050eedbf5af3fd0beca8342cb3779342007 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3604a050eedbf5af3fd0beca8342cb3779342007 commit 3604a050eedbf5af3fd0beca8342cb3779342007 Author: Gleb Smirnoff AuthorDate: 2024-12-16 14:52:06 +0000 Commit: Gleb Smirnoff CommitDate: 2024-12-16 14:52:06 +0000 tcp_hpts: refactor the per tcpcb call to either input/output method Either input or output return unlocked on failure. Should be no functional change. Reviewed by: rrs Differential Revision: https://reviews.freebsd.org/D47925 --- sys/netinet/tcp_hpts.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 0c7338eb222b..5b39c94e0e58 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -1374,24 +1374,20 @@ again: * cause a call to output if it is needed so we do * not need a second call to tcp_output(). So we do * one or the other but not both. + * + * XXXGL: some KPI abuse here. tfb_do_queued_segments + * returns unlocked with positive error (always 1) and + * tcp_output returns unlocked with negative error. */ tp->t_flags2 |= TF2_HPTS_CALLS; if ((tp->t_flags2 & TF2_SUPPORTS_MBUFQ) && - !STAILQ_EMPTY(&tp->t_inqueue)) { - error = (*tp->t_fb->tfb_do_queued_segments)(tp, 0); - /* - * A non-zero return for input queue processing - * is the lock is released and most likely the - * inp is gone. - */ - if (error) - goto skip_pacing; - } else + !STAILQ_EMPTY(&tp->t_inqueue)) + error = -(*tp->t_fb->tfb_do_queued_segments)(tp, + 0); + else error = tcp_output(tp); - if (error < 0) - goto skip_pacing; - INP_WUNLOCK(inp); - skip_pacing: + if (__predict_true(error >= 0)) + INP_WUNLOCK(inp); CURVNET_RESTORE(); } if (seen_endpoint) {