From nobody Thu Jun 23 19:12:01 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 AF3EF865C19; Thu, 23 Jun 2022 19:12:01 +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 4LTVHP4W1xz4RKV; Thu, 23 Jun 2022 19:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656011521; 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=FSTw9jaLQPFJ1DaEpjzqkX8jh1dNDZ1aKyOsdwqXbyg=; b=JG2CfTnMJJFeSvO4uIjMdG3TN0Vxug7ozvVNP+1Es0qi9xv6V3pmHNItjTl0qhEjHjdCYB Juw19IJi1LymGxN63j7ieunZPQheahzoK9hZQ5t2cotQYmWc2JiENMU7qWLJcD5quu9iDb s2Y60ksjroXcYUZ/1uwV2wRN1ClieWu7e70lDB9U1kRYaZyuFCY/yBJf7NbSDwy2mFMp+3 I5CMPuCy0z/OYuFQlvDxH16Jx3NQV5SciZ4WoRqBNMUe+Z2KCsZItv5U2yxDRGBKk37oDD diDI2JRrEajZagk7p1VCdTwUQG+95J6CRxrwPmGT0JaHmCgZcitWWKWmlpg5gg== 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 7C7B4211BA; Thu, 23 Jun 2022 19:12:01 +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 25NJC1Ko096575; Thu, 23 Jun 2022 19:12:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25NJC1JM096574; Thu, 23 Jun 2022 19:12:01 GMT (envelope-from git) Date: Thu, 23 Jun 2022 19:12:01 GMT Message-Id: <202206231912.25NJC1JM096574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: f5766992c0d0 - main - 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/main X-Git-Reftype: branch X-Git-Commit: f5766992c0d0491d571cb6d1c47f373314f527a8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656011521; 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=FSTw9jaLQPFJ1DaEpjzqkX8jh1dNDZ1aKyOsdwqXbyg=; b=HqA7YavYW1G/AwPwOvp2XCgFfJZgN956KzqMRUGu7OlA4403AfQcJ4l97ChZ/2OyWDdJqx kEtQ1JrMfTbQyBAbuWKVcBRlA67ecD0DGWSZfXQtZ+2VBeaZVepW7zfvQ98HPbkTrlSBzA edXyzyLDF1UdsfQAFbGnlJMKI0pjR1N1jKX6htSf+n6rQYV7WvdiXbcC6tc2BPvbC0jPny OjWjFT4wAN3XvsQJOfsUiXJfEKAhLRPxwc4sQ3+tqPyKBzku2Y4z3hWjylIc7qd+fcBVxD /CfjpHzcdG2e5QNOf6Wanqt7y/hI8WUvN2TJUkQ+Ru4g7ha3CFdGxAv1FPLd8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656011521; a=rsa-sha256; cv=none; b=T389eobD9QSeIj+ZHPg+zBQtSQxpsWJnVCtfcihrgjZQvPh+/liYBcf2bsQfbwIuyh1n+5 naR3dotWUHeLBDwYiBRaf/Y000Mqa+kJU6ET53QYAvGMJk684qwG7S0WJI/kkHkTW4+kLs 8qQGNb7dWRyVV1L0fVMQaVBDB7I3aEjUnJihyCMm2epppLpY0s1JP0i++yUndldUqgf7V/ Hw6cws6FW6oyCDmLMFqyfWKwVjwPI86M2mO8CQKl0hfP5EgeVaz0ehhoudCQTrlD5DUT6X m5kAiq9hMWv0y1ruPXsk6OpgObSUXv5l6O4vP8Z2hq8IrM4vScZmvQewRoH3rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=f5766992c0d0491d571cb6d1c47f373314f527a8 commit f5766992c0d0491d571cb6d1c47f373314f527a8 Author: Hans Petter Selasky AuthorDate: 2022-06-16 02:42:46 +0000 Commit: Hans Petter Selasky CommitDate: 2022-06-23 19:10:39 +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@ MFC after: 1 week Sponsored by: NVIDIA Networking --- 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 be86ceca445c..92858291a05b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -324,7 +324,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);