From nobody Thu Apr 07 09:17:32 2022 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 6ECDF1A86403; Thu, 7 Apr 2022 09:17: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 4KYwl02hg8z3tGf; Thu, 7 Apr 2022 09:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649323052; 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=VYQ3sjxv/rTBwgqUuYaTd49bARpkLX7ibxYg85jTPRM=; b=V4WZTwXt/XME6kC7ElimdZyvXOzc3s8tc0E1z1oqcFVgyXS7lrJEBCBIP8hZgRhIq+/erb AlbjfFAaQUR67uMysT3do7yt7iOC4YMGG0v8JgETauYerBwz3czqE6mtBmX4OIdZjqjAK6 H/ZBc7vvvNnOpb1MjByQI6DGtdJQSqKvp9aDTWydr3Ezp17x5RAN+kT12PKn7FhzDiWgfb akFy0D2NFMl1s0SI5yzCPriOXkfkVq9G7OvQB+ya0RqX09tY95GYDQ5YpsE4vDVlieZaCJ GwgexTrWW2e5fLKCtUg8wl1reF1+sdJtNWS8JVj6LxK2RPobscSo8zFxbkSU5w== 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 3DB575387; Thu, 7 Apr 2022 09:17:32 +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 2379HWsY081881; Thu, 7 Apr 2022 09:17:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2379HWpT081880; Thu, 7 Apr 2022 09:17:32 GMT (envelope-from git) Date: Thu, 7 Apr 2022 09:17:32 GMT Message-Id: <202204070917.2379HWpT081880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: 1241e8e7aed5 - main - siftr: expose t_flags2 in siftr output 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: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1241e8e7aed5d709a6cf62024e9ae750981c03ae Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649323052; 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=VYQ3sjxv/rTBwgqUuYaTd49bARpkLX7ibxYg85jTPRM=; b=DexkjkfEyQRCf9I8p5VzOL5DU0BwOlvslJ4tODzMM0BhYnfewSYaRxBJ/9SuRBIEVdPGhR c+mIYXngzYNvHcHNH5fFc+GWIf7fAxA+mxzcz5C6QBYT+P5G2omJT2L8pwD/YwMFIdKq4H dQ2jhQfoWqg51Tjb4kxQc0z0i2WCkQLZVsos/p4DFhGoZxRsk/Avg0mCkYPAtVckHD9qe0 79gPT+4Z0gOx4hk5cdhCgVZOKEqER6NMgzNbd5TfDCTHH2QZiF95Ha3HBBQCJJq9BqTlOO qlgzp0PtNxDCd9YqvDuz3FgR4ZnGjvyLDEn+TFNywB0TZONBeD5OCvzGZYfh2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649323052; a=rsa-sha256; cv=none; b=C9e7Xy/2ykFKEW9GBei6EcmPRP7q5VUwcua/sbfyeW3LRmTA9Ii5OkaR2lwn1UogOKZOxf N1IV8eI3MybesJRAsgC1yr5sh99CZhKXbKtTH/sYPRVIH2k23AefLBwBqjEysULfHpeKBS Ge8k960kZjUvt3qeA8HwNQq4dSt3s7xa4DVJMJoT1mewxBIH8iHj6Q6SMbyWYzTABn6yr2 iJLVVf6va8XSPsWMXg26MlEtX6/IeTGDs6QoekDq3XYyC/Ikq5ga4NBIV7NEkIdRD8r4mU 2Okh6hhvw8H2BkANIpyC62U9JujkGu8QTx6laMrZYM8zgzE2WGYGFbMN+TAe5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=1241e8e7aed5d709a6cf62024e9ae750981c03ae commit 1241e8e7aed5d709a6cf62024e9ae750981c03ae Author: Tom Jones AuthorDate: 2022-04-07 09:12:33 +0000 Commit: Tom Jones CommitDate: 2022-04-07 09:17:09 +0000 siftr: expose t_flags2 in siftr output Replace the old snd_bwnd field which was kept for compatibility with the t_flags2 field from the tcpcb. This exposes in siftr logs interesting things such as ECN, PLPMTUD, Accurate ECN and if first bytes are complete. Reviewed by: rscheff (transport), chengc_netapp.com, debdrup (manpages) Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #73 Differential Revision: https://reviews.freebsd.org/D34672 --- share/man/man4/siftr.4 | 6 +++--- sys/netinet/siftr.c | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/share/man/man4/siftr.4 b/share/man/man4/siftr.4 index d26aaec340ea..d06d0bf89e80 100644 --- a/share/man/man4/siftr.4 +++ b/share/man/man4/siftr.4 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2019 +.Dd April 7, 2022 .Dt SIFTR 4 .Os .Sh NAME @@ -209,7 +209,7 @@ TCP/IP packet. The data is CSV formatted. .Bd -literal -offset indent o,0xbec491a5,1238556193.463551,172.16.7.28,22,172.16.2.5,55931, \\ -1073725440,172312,6144,66560,66608,8,1,4,1448,936,1,996,255, \\ +1073725440,172312,34,66560,66608,8,1,4,1448,936,1,996,255, \\ 33304,208,66608,0,208,0 .Ed .Pp @@ -262,7 +262,7 @@ The current congestion window for the flow, in bytes. .El .Bl -tag -offset indent -width Va .It Va 10 -The current bandwidth-controlled window for the flow, in bytes. +The current state of the t_flags2 field for the flow. .El .Bl -tag -offset indent -width Va .It Va 11 diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index 00a4f477ad2e..1b675b8afe23 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -132,7 +132,7 @@ __FBSDID("$FreeBSD$"); * Hard upper limit on the length of log messages. Bump this up if you add new * data fields such that the line length could exceed the below value. */ -#define MAX_LOG_MSG_LEN 200 +#define MAX_LOG_MSG_LEN 300 /* XXX: Make this a sysctl tunable. */ #define SIFTR_ALQ_BUFLEN (1000*MAX_LOG_MSG_LEN) @@ -194,15 +194,15 @@ struct pkt_node { /* Foreign TCP port. */ uint16_t tcp_foreignport; /* Congestion Window (bytes). */ - u_long snd_cwnd; + uint32_t snd_cwnd; /* Sending Window (bytes). */ - u_long snd_wnd; + uint32_t snd_wnd; /* Receive Window (bytes). */ - u_long rcv_wnd; - /* Unused (was: Bandwidth Controlled Window (bytes)). */ - u_long snd_bwnd; + uint32_t rcv_wnd; + /* More tcpcb flags storage */ + uint32_t t_flags2; /* Slow Start Threshold (bytes). */ - u_long snd_ssthresh; + uint32_t snd_ssthresh; /* Current state of the TCP FSM. */ int conn_state; /* Max Segment Size (bytes). */ @@ -455,7 +455,7 @@ siftr_process_pkt(struct pkt_node * pkt_node) log_buf->ae_bytesused = snprintf(log_buf->ae_data, MAX_LOG_MSG_LEN, "%c,0x%08x,%zd.%06ld,%x:%x:%x:%x:%x:%x:%x:%x,%u,%x:%x:%x:" - "%x:%x:%x:%x:%x,%u,%ld,%ld,%ld,%ld,%ld,%u,%u,%u,%u,%u,%u," + "%x:%x:%x:%x:%x,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u," "%u,%d,%u,%u,%u,%u,%u,%u,%u,%u\n", direction[pkt_node->direction], pkt_node->hash, @@ -481,7 +481,7 @@ siftr_process_pkt(struct pkt_node * pkt_node) ntohs(pkt_node->tcp_foreignport), pkt_node->snd_ssthresh, pkt_node->snd_cwnd, - pkt_node->snd_bwnd, + pkt_node->t_flags2, pkt_node->snd_wnd, pkt_node->rcv_wnd, pkt_node->snd_scale, @@ -514,8 +514,8 @@ siftr_process_pkt(struct pkt_node * pkt_node) /* Construct an IPv4 log message. */ log_buf->ae_bytesused = snprintf(log_buf->ae_data, MAX_LOG_MSG_LEN, - "%c,0x%08x,%jd.%06ld,%u.%u.%u.%u,%u,%u.%u.%u.%u,%u,%ld,%ld," - "%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u,%u,%u,%u\n", + "%c,0x%08x,%jd.%06ld,%u.%u.%u.%u,%u,%u.%u.%u.%u,%u,%u,%u," + "%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u,%u,%u,%u\n", direction[pkt_node->direction], pkt_node->hash, (intmax_t)pkt_node->tval.tv_sec, @@ -532,7 +532,7 @@ siftr_process_pkt(struct pkt_node * pkt_node) ntohs(pkt_node->tcp_foreignport), pkt_node->snd_ssthresh, pkt_node->snd_cwnd, - pkt_node->snd_bwnd, + pkt_node->t_flags2, pkt_node->snd_wnd, pkt_node->rcv_wnd, pkt_node->snd_scale, @@ -782,7 +782,7 @@ siftr_siftdata(struct pkt_node *pn, struct inpcb *inp, struct tcpcb *tp, pn->snd_cwnd = tp->snd_cwnd; pn->snd_wnd = tp->snd_wnd; pn->rcv_wnd = tp->rcv_wnd; - pn->snd_bwnd = 0; /* Unused, kept for compat. */ + pn->t_flags2 = tp->t_flags2; pn->snd_ssthresh = tp->snd_ssthresh; pn->snd_scale = tp->snd_scale; pn->rcv_scale = tp->rcv_scale;