From nobody Wed Apr 24 20:37:08 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 4VPrPw6kgbz5J3qB; Wed, 24 Apr 2024 20:37:08 +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 4VPrPw5n34z4Lr5; Wed, 24 Apr 2024 20:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713991028; 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=fYTt4kJ7a7b8Kt6dSu8GmybXNavVGF6sBVhuBkHpFNE=; b=lG750ncaIRYjCiP2o/0oA0i0Tbq4W2Uw+h3ocQu8MHUqs7aUO4r/zx0dbTx5oCBdPBQxQE L4+VEHuw2kZcAk9JAVax+yLOVQMdVo6atd72jm4vihv6jAB50jRCNr/K1q1bbYT66agt48 eyDSErhaucYwnFelERarsL70mRBYMT45bVYR8mcHtRmQQ1quroq5gx1TRvw25E0pyS+XU/ cL/6LTcAdFAN/Al/leQLev0PrE0qe/tDVVjaNQHTdyl38wDv1GBRlCOkhGSrS5conMj+bH aW7Nr+n3UOzKmv6dtROki2+4D2+EileG2ckInxQHds74/IlZaZ1Y+2eRuAXYiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713991028; a=rsa-sha256; cv=none; b=OXjKY26Dit/usBF+YZEPx6nUYeETB9MQ57jwEN29RJ1Ui3YbOO5NGG8SKKDWmXr+wOohMP roBIvORml0L6gYT5zBLoX/+sLkip17PtDlmn/AGNJJcoxbOXVfFkxEaRKrCFp9K22ng2TN zjTfJuA2kDpX8rF5h8erRIxsfLOdzHIsVHe9QyBbrx8gksY4EkcOzMTvlq39bRCrH8RFbZ 0C4KC4H3KTEkaLu6X6HdkshgdCLSJ7jCDjXjeB5Iv7JNJkXKfDUzKKTVmKPMKKITukxmGH cjSXRIT2sFu8vG1bJanJhm91IVK/8BYcGJF4NC0Mhqr0fV9sTtBYf0UcTBNM8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713991028; 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=fYTt4kJ7a7b8Kt6dSu8GmybXNavVGF6sBVhuBkHpFNE=; b=iyOBBw2CrP1eEfdfBSLnUXqOFgTtnOqUVTP0X/yrF6Yymanf6BS+wkxDWBXTGW886oX4fc 2Wjk2kY1mz6KTHlTRhRdISuSq6uYizR4SsRSzrILSvPwqreldM9ZDpmEKDQaOiOMbn3Y1X xJO9f1CDLlvueUqq5Lg8j4m1YvEN/OiX+eRP1gpsz6IKXZCZL+hmL0rB3dKJ4UusmWKLNC BnrqMkdLuN4KzSWBuga8WHX6wL6rgg35dOATCVImik5oCJQDiQvqMAbOWEhiXVYnpYUgiv tVBvvDAsWbI/5sjqKVGqGXiLB+ACkkdnNhkTIHfpbHGpwTT7y0/Pses86YKixA== 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 4VPrPw5GBSzWBy; Wed, 24 Apr 2024 20:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43OKb85O099291; Wed, 24 Apr 2024 20:37:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43OKb89E099288; Wed, 24 Apr 2024 20:37:08 GMT (envelope-from git) Date: Wed, 24 Apr 2024 20:37:08 GMT Message-Id: <202404242037.43OKb89E099288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 917b5431453d - stable/14 - HTPS has actually three states not two so the macro needs to account for that. 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 917b5431453d0a02ac4f976b76511357ed6c5604 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=917b5431453d0a02ac4f976b76511357ed6c5604 commit 917b5431453d0a02ac4f976b76511357ed6c5604 Author: Randall Stewart AuthorDate: 2024-03-01 20:21:15 +0000 Commit: Michael Tuexen CommitDate: 2024-04-24 20:36:32 +0000 HTPS has actually three states not two so the macro needs to account for that. Ok lets fix up the tcp_in_hpts() so that it also says yes if you are in the race state moving and you are scheduled to be put in. This also requires changing the MPASS to be the old version non inline function of tcp_in_hpts(). This change also adds a new inline macro so that a uint64_t timestamp can be obtained by a transport (aka Rack will use this). Reviewed by: glebius, tuexen Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D44157 (cherry picked from commit 638b5ae1c7858373344bc7b9dcb5a1e7fab80bd9) --- sys/netinet/tcp_hpts.c | 2 +- sys/netinet/tcp_hpts.h | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index af7b2691ff2e..07c5f04b907e 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -821,7 +821,7 @@ tcp_hpts_insert_diag(struct tcpcb *tp, uint32_t slot, int32_t line, struct hpts_ INP_WLOCK_ASSERT(tptoinpcb(tp)); MPASS(!(tptoinpcb(tp)->inp_flags & INP_DROPPED)); - MPASS(!tcp_in_hpts(tp)); + MPASS(!(tp->t_in_hpts == IHPTS_ONQUEUE)); /* * We now return the next-slot the hpts will be on, beyond its diff --git a/sys/netinet/tcp_hpts.h b/sys/netinet/tcp_hpts.h index 0c5cfac28a6c..b097a2b98db9 100644 --- a/sys/netinet/tcp_hpts.h +++ b/sys/netinet/tcp_hpts.h @@ -115,7 +115,9 @@ void tcp_hpts_remove(struct tcpcb *); static inline bool tcp_in_hpts(struct tcpcb *tp) { - return (tp->t_in_hpts == IHPTS_ONQUEUE); + return ((tp->t_in_hpts == IHPTS_ONQUEUE) || + ((tp->t_in_hpts == IHPTS_MOVING) && + (tp->t_hpts_slot != -1))); } /* @@ -208,6 +210,17 @@ tcp_gethptstick(struct timeval *sv) return (tcp_tv_to_hptstick(sv)); } +static __inline uint64_t +tcp_get_u64_usecs(struct timeval *tv) +{ + struct timeval tvd; + + if (tv == NULL) + tv = &tvd; + microuptime(tv); + return (tcp_tv_to_lusectick(tv)); +} + static __inline uint32_t tcp_get_usecs(struct timeval *tv) {