From nobody Fri Mar 01 20:23:21 2024 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 4Tmffx3TrGz5D0TV; Fri, 1 Mar 2024 20:23:21 +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 4Tmffx2cmdz4s2d; Fri, 1 Mar 2024 20:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709324601; 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=Ggrk7ZX9gu7AB6wAg3eTITeyg8gETAFsSnlGRvXSro4=; b=DPpx06NAShW5bQq5g9QBCp+QwvVvKy1jv4c8HUxw5yt0gMJQNruZKHPLstQwcXQxDa+Wgx Kl0ekBlN4zqi+98a8mgliYMVu8AktvwtTj5HxdewM/gM3xN04f8ptgD42PY896BmUinsjc yxlmS0W7PjNZvMrhSYmF2FsxSgw4+oo8Xr2KL2Wg3CKeruyNEXgp6P2R+atwT7M/yQPnxL VnMqMNeAdo6Sw4yH5Sx0X2jiSl/WC0MSWvA0mkvLxdWUOl8rbJH4X2d8woK07Xp53v6fLA doNEftNCiCBFqMh1jgHtcT4xtLxZZ18qw3tdjfpycjBl6+yLUrxnByhjXHgovg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709324601; a=rsa-sha256; cv=none; b=UVMgyo1I9vIQNS8osHG6ITbEJRA5z+e0IBtNqt2MlPz5olknJ2SEyE4DnfkvqAcIathLfv Ih7U3R+Mc6G/5Wa1a/oPhTC9oTuwcsMm8Q4kSd830XRqjwiucKMlugOWfyKlJm8gl2oq2q Hfy7Ozkt/tgGr2xKfhGuv59TkV6EF5X4BuVGgvbNR6B9BNVWQEosmWhmZQORdt1efaNHiJ nV0OWRZ2xk9+qk4mrY5yH8iS7yMnWegjTizSmJZu8sUg4L6OePdJW+A5yxoug1MhuTnlHM LaETIiNxnjv8FTqq3ZG27IdbjT69MeojYBUsjBImxXJ3ckTu/T/CS9vC75uTgg== 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=1709324601; 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=Ggrk7ZX9gu7AB6wAg3eTITeyg8gETAFsSnlGRvXSro4=; b=V3pZtZGuZLuOmDzFGqD4Z5LlOTsmOgtwT+p3Lyqg6L+SZ/6YYM5TZe9ed8u7cKDngb+mGr 84eynLeDuKNzamuJK/OmdLbf0Pt7pVOJRIbyqvcJRRa03b4pjkW6UlmAlbNzrKlRGRFQiN JywNj8AMAB/Um50b0OkbDAnJ90MLtBE4fXO7r+iYPihSDL4pzCd4gRUmRB9abIUsyLBBlM EE3K19bISFxI+xyK/3wp4W3USC1Vw3+wA8OlD+sKd1Z3V/+U94r50QBb+4UMnFdSwlLATw QC+1C1uDmDAx1+E0JPbDX2qZ2s3RkODMH+OL23f5POX600enMiqUd9KQQCAgrQ== 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 4Tmffx2D8mzgsC; Fri, 1 Mar 2024 20:23:21 +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 421KNLbk066167; Fri, 1 Mar 2024 20:23:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 421KNLia066164; Fri, 1 Mar 2024 20:23:21 GMT (envelope-from git) Date: Fri, 1 Mar 2024 20:23:21 GMT Message-Id: <202403012023.421KNLia066164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: 638b5ae1c785 - main - HTPS has actually three states not two so the macro needs to account for that. 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: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 638b5ae1c7858373344bc7b9dcb5a1e7fab80bd9 Auto-Submitted: auto-generated The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=638b5ae1c7858373344bc7b9dcb5a1e7fab80bd9 commit 638b5ae1c7858373344bc7b9dcb5a1e7fab80bd9 Author: Randall Stewart AuthorDate: 2024-03-01 20:21:15 +0000 Commit: Randall Stewart CommitDate: 2024-03-01 20:21:15 +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 --- 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 9d192b17c41a..8c4d2d41a3eb 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -820,7 +820,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) {