From nobody Tue Aug 22 18:38:44 2023 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 4RVdQr5Rg9z4qGVk; Tue, 22 Aug 2023 18:38:44 +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 4RVdQr3hyDz3Sgs; Tue, 22 Aug 2023 18:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692729524; 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=jpW1i9v32nfsD5tr0gcrMWV2+oF/5OmieZy9AftCpq8=; b=T61zv8tlmrbAgE+nNJ2+7oWxuspMrT0047TK2rCRHgqEC4sU35AARVMO8FenyiRZvAEU+C YFhgNQsnRVV2dav9PLMsYOmB047UNGHEa141+Y/0gfyaOv2ZvhAv7TgflUZ24ihv5xK9oY nidZFGmbZkMnzUCAtkupgDVAi1xi0OaSa4lqRH7rF3br4IXiTNpnG05TnNtX0Rnm8GfcLt reFcFnsMGtlewtrfBrSWInjqUe6kpGF6LdKhFaXLktNsf0DkYDAZe24S8gjDdFLJyif28Z TaBUFlWQxN3iPvt7GeZFxXMNFcihd6pmMb+07JmKyzpaiG081OcG953vWhBjsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692729524; 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=jpW1i9v32nfsD5tr0gcrMWV2+oF/5OmieZy9AftCpq8=; b=Z7k5x59dda2mhTxTsmdqnG7/zPvS0I2euxq8imhwrPDGrJCc5RFjAtRfKBnSzbGhFmTMwY qN8/gliDAqxkTi2o82fML1UgwUZm6V+qhfnuGKtNreqbtuGkOYJmNjKBKxaZks9yWbt40J imgbxvD9nwmDjHG+1ENZOqKk9392vxed72EV4ZjOQKKu8TmriHy/5ypVOiLguqISjP5H2q PUQsZfFkgeh03oZootqHnDu6UlFuJMyDV17RdYDAo9lMXWXRuWju1wmJDqRZVw5MorvqaA NTMoxr3BbUGJ4+/dY1qLQf8a+ngpFY7iN+xJrE2nXpdR4vYVagzNtEZcAvB3Ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692729524; a=rsa-sha256; cv=none; b=Txxrnj8hoRXxo5ZJalc1xSWibNJwvLFMlQid0OeWSeH6wSCFekMng0Bj+/bcO+ECo7PjSQ PAaQs4cwmXlUgL5KOrxz+oiYyALF0FeXnmpIz/yepCw/vcAUeTdobDxmliaISiLlRn/oGL l/tsiVjkqioBY3I2UNeT/Rjdhx4vMknKS7INlgU7N8iN4n8fn62tGyjKX7qZBmzhFdDdFO 0LWtnEpfO/EymPCWlGGMj2PMLylC1pgBl4gLUXWBj+wpTupxHGyyc/+Z/XJGnbM9iMrSXt Faj3G/hV/EzM/C8Vqwzm3BW++HsGiZYDwsIoSMBRGS2KGpfrlCUeZyxVoWBwpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RVdQr2cKMz1CyN; Tue, 22 Aug 2023 18:38:44 +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 37MIciLZ034210; Tue, 22 Aug 2023 18:38:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37MIcisE034207; Tue, 22 Aug 2023 18:38:44 GMT (envelope-from git) Date: Tue, 22 Aug 2023 18:38:44 GMT Message-Id: <202308221838.37MIcisE034207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: dc485b968dde - main - tcp_info: Add and export more FreeBSD-specific fields 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: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc485b968ddeb070d23354f55164a8c336acf081 Auto-Submitted: auto-generated The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=dc485b968ddeb070d23354f55164a8c336acf081 commit dc485b968ddeb070d23354f55164a8c336acf081 Author: Marius Strobl AuthorDate: 2023-08-22 18:12:59 +0000 Commit: Marius Strobl CommitDate: 2023-08-22 18:34:01 +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) --- sys/dev/cxgbe/tom/t4_tom.c | 4 ++++ sys/netinet/tcp.h | 8 +++++++- sys/netinet/tcp_usrreq.c | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index c5a7e9290666..e5b173964451 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -730,9 +730,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 209be3c9345a..2b898d062b0d 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -427,8 +427,14 @@ struct tcp_info { 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[19]; /* Padding. */ + u_int32_t __tcpi_pad[14]; /* Padding. */ }; /* diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index a6101bc422f7..8b0b3c296c62 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1591,6 +1591,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;