From nobody Thu Jun 30 09:40:15 2022 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 CD2FF8762C8; Thu, 30 Jun 2022 09:40:15 +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 4LYYGR45BQz3tYf; Thu, 30 Jun 2022 09:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656582015; 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=P9wieUgfH6xst3rMtGgH27GnAGBXBlizsmDawfVxhPs=; b=dNMpLj/pu2x3rhTDU5xVvuW+Tv0s9C4nn40HDkwM3UxO62y0ziPjR1eKv59z0ID1/rL7gC ao8+RBOgffVwno4GBvx8R50nki2pO4M5sC5WZHVuZinAGtVKyBupKbe9xoYophPH9uyU4w Y9gr8jaScMQ6GavQRstclbVacZXcGI+XTLIz2iBw3p1BAD0gfkifZFia+BcDp7UyriBGDW WqDpQDUFNiW2FrTuXgNANs9xX9ShLpxhrw2HMe0hOSoU58dfOEbK3kF7WHEeCCf/Avipdj 5jUP0SvOInDS1Sctdr93Zd7sznndXvf4GfZNHIFbOaBVRLuAz2RrYFnRfUqz5w== 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 674CC23E00; Thu, 30 Jun 2022 09:40:15 +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 25U9eFDq078995; Thu, 30 Jun 2022 09:40:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25U9eFXF078990; Thu, 30 Jun 2022 09:40:15 GMT (envelope-from git) Date: Thu, 30 Jun 2022 09:40:15 GMT Message-Id: <202206300940.25U9eFXF078990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 973716df6c2e - stable/13 - tcp: Correctly compute the TCP goodput in bits per second by using SEQ_SUB(). 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 973716df6c2e960b90c9b0fe9e0dd6a978623c21 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656582015; 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=P9wieUgfH6xst3rMtGgH27GnAGBXBlizsmDawfVxhPs=; b=Nakl/s9DcdYQknz+rYSzdjMNGVPemYUVxCT/qxnuc5/opfqCC5J70f0e91BXuJl+3L3WMA V0cK8eXqe5I9YeIBkniLod3zdZLaDBmqC3OaIQrBpo9vDbP8inBOhOTerODy9qgOwNE4oU 4gqHJNjB/Vc/UudyvSkMlraij6SmShomDeTFdpL26gZknhUolbkmmgeUlsQnXDIDtFc8d6 uqik/8Htl0HctDf9yB5M3HQQQE5ViXawfXT4eLmyzE9R1+b8X8ttrUERNcnHD76y5gUdWu MiT4fZL/7cz4vAxhM+t0rd2kQgyidXfX35vhHs48HDJTaMKRFlkto3xkWwV1Vw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656582015; a=rsa-sha256; cv=none; b=qHUjyXEslwBavUwI/n6Ou9pF2degZ5/Em37Dety2tOcQNQIbWNgDv4CCdC1quHkNkXDnqg +xAQSM7dhLLJB1gMHCRKIx1PrN9NiuFToJKQmCmKrQgdI91t+G5svU1jxl0KSbY/CeiE+F uVwEYAg4WGQz8mvkR1FwGepHiFluaMNwX+xjh+MluzXD00nKspYlF+1H5745Goa8Z2Av67 s0ls5y1WXRvjJRam9s1izZqSM+K9D9JrpPrYF3cFsOsqI6qemjFU+ZE37i9TuRTQwxWFmj 4JOTlci6dVMKQ/MqiX88aJcdPLrIEJLw9pg1F9l8Y0OLbNz0lbLUtY1W0XdN/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=973716df6c2e960b90c9b0fe9e0dd6a978623c21 commit 973716df6c2e960b90c9b0fe9e0dd6a978623c21 Author: Hans Petter Selasky AuthorDate: 2022-06-16 02:42:46 +0000 Commit: Hans Petter Selasky CommitDate: 2022-06-30 09:39:43 +0000 tcp: Correctly compute the TCP goodput in bits per second by using SEQ_SUB(). TCP sequence number differences should be computed using SEQ_SUB(). Differential Revision: https://reviews.freebsd.org/D35505 Reviewed by: rscheff@ Sponsored by: NVIDIA Networking (cherry picked from commit f5766992c0d0491d571cb6d1c47f373314f527a8) --- sys/netinet/tcp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 2c7d15368483..601b4a63716f 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -341,7 +341,7 @@ cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t nsegs, /* * Compute goodput in bits per millisecond. */ - gput = (((int64_t)(th->th_ack - tp->gput_seq)) << 3) / + gput = (((int64_t)SEQ_SUB(th->th_ack, tp->gput_seq)) << 3) / max(1, tcp_ts_getticks() - tp->gput_ts); stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_GPUT, gput);