From nobody Mon May 29 20:16:49 2023 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 4QVRdF2l9Fz4WrQD; Mon, 29 May 2023 20:16:49 +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 4QVRdF29HHz4LDT; Mon, 29 May 2023 20:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685391409; 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=Lk8cdtKpNgqL/MrxVUJeox/Ght40puEbkRp/0K6pC7E=; b=Z764IVVhv1qnk7Hyh4KJ5K+jmIfvRnoaCa03GP644zNW7OytFvaeMnuRijB3d8qSl9Bfto ZhZQ4zfWLx2DAuS6TQ1kWyJdgVVrvgHRUANKStQ0mkuvTDm1qZxnXGhLBv8eDYIgQVJS6t mPagyWqxGtSTrxcmhRzwflYrdvkUKctdIx/mhiPB49f6eOPmjQqRNakM7Oq64/51VdagI+ T3nM0FfMHqPScgZrvu9jwVetotPBLgCCdXgZGxRyCPhInBCnWYV2xxAP1csokJ6nF/uz2c AsESXHukDOXv+ccX1UkZN4ITWp5mlLLvbcXctqEGwm6ohPhufJlFz1AN6F3N1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685391409; 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=Lk8cdtKpNgqL/MrxVUJeox/Ght40puEbkRp/0K6pC7E=; b=rfvTJLhW/YHtaVHK2nNI60v07o+o6zv34Vw59GPE61PPbrmlthhCcWR96H9la5Pgo9sP+x w17P/v0zsIzk8xPL9DHMXCehLK7H3zbC8zToSQnEt82Q5u3mXo+oPstvbZeo5U/r8v4Rz9 WG7rUFY+deIr3snc9jX5EBTvs/lBBdg8o5o3SSsMcqcD7MckH41vZfCqls3LLmGgVAXbJy XK8b9tXCT+inRQcU7t+SZDFuSLzLpAxOBUUOgXWeD2T6nbiW5ORZZsPygmu7SoE0pAhxkN Gf6eXWmpgEr0ybxqcKRCkfdUD5omQ9D6hMXsS47s9r7syz+JDb9NonWjGuexAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685391409; a=rsa-sha256; cv=none; b=nxZC+B/60/JFBPVg7cbEdeaRvX3ux2pZs52fu8/2cvTsikOnEvhHgyigZ2eWSFkOcXhKpD O0UTWu0jJCM9/CXgtcvTVQZmu/MAD7YpxCwinYx4HJb31JQg2Jtj+8AHFHUoUzPD7J+w7Y Bmvc6/96yAOcKuXbWr1r8/zgIL2mv5YiiCmIuo/V2+CPT0pJ49drVyGdtoh6lPy5rt3Iza D+sm5DzEUHbMUwkMBluv5W1gnoV3W4KiAfVzFantw/pGepezefIxd2bF2afaYuftMFUFJr TFk4Ekn+lZy7sTYXIAm6bBM2isi2NsgviqODO+ZeuM8A2NWDJglJmZDRqg/jAw== 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 4QVRdF1860zQ3Q; Mon, 29 May 2023 20:16:49 +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 34TKGn24050158; Mon, 29 May 2023 20:16:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34TKGnsd050157; Mon, 29 May 2023 20:16:49 GMT (envelope-from git) Date: Mon, 29 May 2023 20:16:49 GMT Message-Id: <202305292016.34TKGnsd050157@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cheng Cui Subject: git: 78914cd641cc - main - siftr: sync-up man page with recent code changes, and cleanup code 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: cc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78914cd641ccf00cc45e720a10dba24927c0a3b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cc: URL: https://cgit.FreeBSD.org/src/commit/?id=78914cd641ccf00cc45e720a10dba24927c0a3b8 commit 78914cd641ccf00cc45e720a10dba24927c0a3b8 Author: Cheng Cui AuthorDate: 2023-05-29 14:53:11 +0000 Commit: Cheng Cui CommitDate: 2023-05-29 16:16:09 +0000 siftr: sync-up man page with recent code changes, and cleanup code Reviewers: rscheff, tuexen Approved by: tuexen (mentor) Subscribers: imp, melifaro, glebius Differential Revision: https://reviews.freebsd.org/D40322 --- share/man/man4/siftr.4 | 48 ++++++++++++++++++++++++------------------------ sys/netinet/siftr.c | 4 +--- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/share/man/man4/siftr.4 b/share/man/man4/siftr.4 index 131cc2ca0791..fefa67f8673f 100644 --- a/share/man/man4/siftr.4 +++ b/share/man/man4/siftr.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2023 +.Dd May 29, 2023 .Dt SIFTR 4 .Os .Sh NAME @@ -120,8 +120,9 @@ The path can be changed at any time, even while the module is enabled. .El .Bl -tag -offset indent -width Va .It Va net.inet.siftr.port_filter -controls on which source or destination port siftr should capture -.Nm . +controls on which source or destination port +.Nm +should capture. By default, the value is set to 0, which means all ports are eligible for logging. Set to any other value, only packets where either the source or destination port is equal to this number are logged. @@ -143,9 +144,8 @@ The text below shows an example module enable log. The fields are tab delimited key-value pairs which describe some basic information about the system. .Bd -literal -offset indent -enable_time_secs=1238556193 enable_time_usecs=462104 \\ -siftrver=1.2.2 hz=1000 tcp_rtt_scale=32 \\ -sysname=FreeBSD sysver=604000 ipmode=4 +enable_time_secs=1685191807 enable_time_usecs=160752 \\ +siftrver=1.3.0 sysname=FreeBSD sysver=1400089 ipmode=4 .Ed .Pp Field descriptions are as follows: @@ -187,9 +187,9 @@ The text below shows an example data log triggered by an IPv4 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,34,66560,66608,8,1,4,1448,936,1,996,255, \\ -33304,208,66608,0,208,0 +o,1685191814.185109,10.1.1.2,32291,10.1.1.3,5001,1073725440, \\ +14480,2,65160,65700,7,9,4,1460,1000,1,16778209,230000,33580,0, \\ +65700,0,0,0,86707916,130 .Ed .Pp Field descriptions are as follows: @@ -242,8 +242,7 @@ The current state of the t_flags2 field for the flow. .Bl -tag -offset indent -width Va .It Va 10 The current sending window for the flow, in bytes. -The post scaled value is reported, except during the initial handshake (first -few packets), during which time the unscaled value is reported. +The post scaled value is reported. .El .Bl -tag -offset indent -width Va .It Va 11 @@ -336,13 +335,13 @@ The text below shows an example module disable log. The fields are tab delimited key-value pairs which provide statistics about operations since the module was most recently enabled. .Bd -literal -offset indent -disable_time_secs=1238556197 disable_time_usecs=933607 \\ -num_inbound_tcp_pkts=356 num_outbound_tcp_pkts=627 \\ -total_tcp_pkts=983 num_inbound_skipped_pkts_malloc=0 \\ -num_outbound_skipped_pkts_malloc=0 num_inbound_skipped_pkts_tcb=0 \\ -num_outbound_skipped_pkts_tcb=0 num_inbound_skipped_pkts_icb=0 \\ -num_outbound_skipped_pkts_icb=0 total_skipped_tcp_pkts=0 \\ -flow_list=172.16.7.28;22-172.16.2.5;55931, +disable_time_secs=1685191816 disable_time_usecs=629397 \\ +num_inbound_tcp_pkts=10 num_outbound_tcp_pkts=10 \\ +total_tcp_pkts=20 num_inbound_skipped_pkts_malloc=0 \\ +num_outbound_skipped_pkts_malloc=0 num_inbound_skipped_pkts_tcpcb=2 \\ +num_outbound_skipped_pkts_tcpcb=2 num_inbound_skipped_pkts_inpcb=0 \\ +num_outbound_skipped_pkts_inpcb=0 total_skipped_tcp_pkts=4 \\ +flow_list=10.1.1.2;32291-10.1.1.3;5001,10.1.1.2;58544-10.1.1.3;5001, .Ed .Pp Field descriptions are as follows: @@ -385,22 +384,22 @@ Number of outbound packets that were not processed because of failed calls. .El .Bl -tag -offset indent -width Va -.It Va num_inbound_skipped_pkts_tcb +.It Va num_inbound_skipped_pkts_tcpcb Number of inbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El .Bl -tag -offset indent -width Va -.It Va num_outbound_skipped_pkts_tcb +.It Va num_outbound_skipped_pkts_tcpcb Number of outbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El .Bl -tag -offset indent -width Va -.It Va num_inbound_skipped_pkts_icb +.It Va num_inbound_skipped_pkts_inpcb Number of inbound packets that were not processed because of failure to find the IP control block associated with the packet. .El .Bl -tag -offset indent -width Va -.It Va num_outbound_skipped_pkts_icb +.It Va num_outbound_skipped_pkts_inpcb Number of outbound packets that were not processed because of failure to find the IP control block associated with the packet. .El @@ -513,8 +512,9 @@ As a result of needing to interrogate the TCP control block, certain packets during the lifecycle of a connection are unable to trigger a .Nm log message. -The initial handshake takes place without the existence of a control block and -the final ACK is exchanged when the connection is in the TIMEWAIT state. +The initial handshake takes place without the existence of a control block or +the complete initialization of the control block, and the final ACK is +exchanged when the connection is in the TIMEWAIT state. .Pp .Nm was designed to minimise the delay introduced to packets traversing the network diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index 9cad93b3ecf7..2741553ed757 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -946,8 +946,6 @@ siftr_chkpkt6(struct mbuf **m, struct ifnet *ifp, int flags, siftr_siftdata(pn, inp, tp, INP_IPV6, dir, inp_locally_locked); - /* XXX: Figure out how to generate hashes for IPv6 packets. */ - mtx_lock(&siftr_pkt_queue_mtx); STAILQ_INSERT_TAIL(&pkt_queue, pn, nodes); mtx_unlock(&siftr_pkt_queue_mtx); @@ -1029,7 +1027,7 @@ siftr_sysctl_logfile_name_handler(SYSCTL_HANDLER_ARGS) strncmp(siftr_logfile, arg1, arg2) == 0) goto done; - /* Filname changed */ + /* file name changed */ error = alq_open(&new_alq, arg1, curthread->td_ucred, SIFTR_LOG_FILE_MODE, SIFTR_ALQ_BUFLEN, 0); if (error != 0)