From nobody Sat Jan 06 19:25:32 2024 X-Original-To: dev-commits-src-branches@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 4T6qzc6d7gz571Q3; Sat, 6 Jan 2024 19:25:32 +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 4T6qzc3bScz3x6L; Sat, 6 Jan 2024 19:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704569132; 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=hZNa+ZoW4aeSKQWqy8uq4Hx6uafNv9/IW7rS6tfNY2A=; b=sPL/dkp4paVxFLU02PxdZnF5+F8LFIxs3e3ojVxjZYoqEpq+Y8LP9i2wdAg4jSZ4l0vsNS Hv3IF7Nd2i4COFwB/vFGl+QpY8lsAlY6IsQ4dTqFpa9aSjes6ocMnuwh5ieFMwz9dqYvK1 xWFLaAwWlhR8nFXo8jaJ9dQK/nDmMaG1MeAJc9E9uahsABbD7zOUJimigPMYx8NWfpA7du xvneJtqwKQLNwnVngDmZY/ditclwhtZIZV0ZBG1q2lm5JY4KGhjR3e7S+LCLXQ1szrCXW1 Lb7V6k8dOgr7MqE380R5/toAfdhzilbOolVj/zHTFtqQFnOWJvXQYJ+YbO7/uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704569132; 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=hZNa+ZoW4aeSKQWqy8uq4Hx6uafNv9/IW7rS6tfNY2A=; b=tAaruXxlQ/ouvtSiCjjJRENCWuOj8QsJnAEfxyOXvl5i1K8VqRgEjJXedsf21jFj97N+Gb 3lst2TanQgW+l1wqr1yAe+1X+2oxqTBRvfa6lINtrUV+Y07BCq8PdQyKeUkfBVzeIbfRXm Ih1Zm0KCFwU+/csUR7K2e8TSdyfWUEEnIZQ4l33h2NHcaYSV7MAjoiZKiwan1OQDUwIXVH bQbCipTK43DW9W8uv2WTNhJedmLfcAtOEPDYc6rcgPiugABtbb50pTH0rK6vPwth48KYEl xc+vXVCeJi/XEctPrCmgIO100ox5NxUsPpoGzwfae+mtfwJSuQtIh3nIJDkopQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704569132; a=rsa-sha256; cv=none; b=DMkyL1S/kzt2uAXnJT0Rfc2oybKpSkFRP7TBRrTvJPBCF3FYx1j/7vaESoGBFgLc0toXCr BHNyyufVA5Ky4G/fbFQr8V6CiY4dCjISHseEdelBkZoPJhi5cb2zbAwjfsiPrOKd0TUjEW LyGcXmwwVHHQlprODAKBkci2E2X4cU+Z65JwwSZTU3zZ/xJ+p+B02JuBx+IdTgz8LGY70+ Rpv4dDMzKIhb9hnMmVvFDMQ7vNeAvTPkefnBEn7rXJf4kvR1t4FpETQEk1vvZIB9ShxPQj gQ9FSclQcaixkEWcYUcBBCILzf1s0nr9rJ0ZQJkkFsytjK/to7U7PYncnDadJQ== 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 4T6qzc2jDKztB2; Sat, 6 Jan 2024 19:25:32 +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 406JPWMZ065202; Sat, 6 Jan 2024 19:25:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 406JPW5N065198; Sat, 6 Jan 2024 19:25:32 GMT (envelope-from git) Date: Sat, 6 Jan 2024 19:25:32 GMT Message-Id: <202401061925.406JPW5N065198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marius Strobl Subject: git: 1d15c4548576 - stable/13 - tcp_info: Add and export more FreeBSD-specific fields List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1d15c4548576763843ea7268e494bf6015758ef8 Auto-Submitted: auto-generated The branch stable/13 has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=1d15c4548576763843ea7268e494bf6015758ef8 commit 1d15c4548576763843ea7268e494bf6015758ef8 Author: Marius Strobl AuthorDate: 2023-08-22 18:12:59 +0000 Commit: Marius Strobl CommitDate: 2024-01-06 01:15:23 +0000 tcp_info: Add and export more FreeBSD-specific fields This change adds struct tcp_info fields corresponding to the following struct tcpcb ones: - snd_una - snd_max - rcv_numsacks - rcv_adv - dupacks Note that while both tcp_fill_info() and fill_tcp_info_from_tcb() are extended accordingly, no counterpart of rcv_numsacks is available in the cxgbe(4) TOE PCB, though. Sponsored by: NetApp, Inc. (originally) (cherry picked from commit dc485b968ddeb070d23354f55164a8c336acf081) Conflicts (due tue missing 945f9a7c): sys/netinet/tcp.h --- sys/dev/cxgbe/tom/t4_tom.c | 4 ++++ sys/netinet/tcp.h | 11 ++++++++++- sys/netinet/tcp_usrreq.c | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index b1982341f4d5..2939ec9b5564 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -737,9 +737,13 @@ fill_tcp_info_from_tcb(struct adapter *sc, uint64_t *tcb, struct tcp_info *ti) ti->tcpi_snd_ssthresh = GET_TCB_FIELD(tcb, SND_SSTHRESH); ti->tcpi_snd_cwnd = GET_TCB_FIELD(tcb, SND_CWND); ti->tcpi_rcv_nxt = GET_TCB_FIELD(tcb, RCV_NXT); + ti->tcpi_rcv_adv = GET_TCB_FIELD(tcb, RCV_ADV); + ti->tcpi_dupacks = GET_TCB_FIELD(tcb, T_DUPACKS); v = GET_TCB_FIELD(tcb, TX_MAX); ti->tcpi_snd_nxt = v - GET_TCB_FIELD(tcb, SND_NXT_RAW); + ti->tcpi_snd_una = v - GET_TCB_FIELD(tcb, SND_UNA_RAW); + ti->tcpi_snd_max = v - GET_TCB_FIELD(tcb, SND_MAX_RAW); /* Receive window being advertised by us. */ ti->tcpi_rcv_wscale = GET_TCB_FIELD(tcb, SND_SCALE); /* Yes, SND. */ diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 16307161e6ac..25a02f1b4319 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -398,8 +398,17 @@ struct tcp_info { u_int32_t __tcpi_received_e0_bytes; u_int32_t __tcpi_received_ce_bytes; + u_int32_t __tcpi_total_tlp; /* tail loss probes sent */ + u_int64_t __tcpi_total_tlp_bytes; /* tail loss probe bytes sent */ + + u_int32_t tcpi_snd_una; /* Unacked seqno sent */ + u_int32_t tcpi_snd_max; /* Highest seqno sent */ + u_int32_t tcpi_rcv_numsacks; /* Distinct SACK blks present */ + u_int32_t tcpi_rcv_adv; /* Peer advertised window */ + u_int32_t tcpi_dupacks; /* Consecutive dup ACKs recvd */ + /* Padding to grow without breaking ABI. */ - u_int32_t __tcpi_pad[18]; /* Padding. */ + u_int32_t __tcpi_pad[10]; /* Padding. */ }; /* diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 7e9c871df87a..f1c7fbafc210 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1672,6 +1672,11 @@ tcp_fill_info(const struct tcpcb *tp, struct tcp_info *ti) ti->tcpi_snd_rexmitpack = tp->t_sndrexmitpack; ti->tcpi_rcv_ooopack = tp->t_rcvoopack; ti->tcpi_snd_zerowin = tp->t_sndzerowin; + ti->tcpi_snd_una = tp->snd_una; + ti->tcpi_snd_max = tp->snd_max; + ti->tcpi_rcv_numsacks = tp->rcv_numsacks; + ti->tcpi_rcv_adv = tp->rcv_adv; + ti->tcpi_dupacks = tp->t_dupacks; #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) { ti->tcpi_options |= TCPI_OPT_TOE;