From nobody Sun Nov 6 11:02:58 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 4N4s0M1nxsz4gtgN; Sun, 6 Nov 2022 11:02:59 +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 4N4s0M1FlMz40PY; Sun, 6 Nov 2022 11:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667732579; 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=e1O1KFQd6umER2y7677tZhTcQHoTUJTrdxbDE6GEhPs=; b=gh6brdWB5qq+axqYEJ6J9Nm2UfV5ogbLneBFZOrDU1QTxQ7FlhQEPOj0UwEoA2guZlvW8Y 4ZrawhwHNNo7q9FOZ+hG63srSfiHkWgOlYGi4uCnLD9ShJK5hjuNchoanKs7FbwoQl+/Gl rDi9Z3HUWm5wwfMIbBroiR3rLhT1qWPotxcI4pPaupA2Bw6Y8QqrhJZuTwTr/MkQHZmpGf mH5uhuSpJcfCR60bPooz0zqS0hcvBjf9bGMSIiIQh6TZ/ricvi06IkFhg1ndQ6Fa3jh7JJ Z27e5yxnUKfPP8VRSdoGGZEPuS4MB3/h1aMN6MItPGECw7+3WVfHq0uDrbu9OQ== 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 4N4s0M0GyfzJXd; Sun, 6 Nov 2022 11:02:59 +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 2A6B2wbk000220; Sun, 6 Nov 2022 11:02:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A6B2w23000219; Sun, 6 Nov 2022 11:02:58 GMT (envelope-from git) Date: Sun, 6 Nov 2022 11:02:58 GMT Message-Id: <202211061102.2A6B2w23000219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 22c81cc51636 - main - tcp: add AccECN CE packet counters to tcpinfo 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: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22c81cc51636cfebe94e0979eb31556d87775938 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667732579; 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=e1O1KFQd6umER2y7677tZhTcQHoTUJTrdxbDE6GEhPs=; b=DCwPm96B7tnjDrAEbNpzMIiqY7thiMeh+ykCA1ueXmBpJomBPOrRoiKegj3EzjmqA/SsT+ BWmxXTN9FnzoSp0cKXoGGq2cyQqbb0x3Hd+PzOtYflCev2TBE2KQXg7joDEtYXAR0WV+FH VNhvm46NsshZ3XpjcuUCoHdukwcb4sUcuEoAZjyhs2ZU4BTvFp/8t54XUOX73kWQFFl0T7 lew6vYLt/hQCrfdVRbpDEepT6ElNJpgA1LyEFIJSjLuda2MWZBFOICnqm1aHpFyTSI2WB0 X3AhQE2WNiX6njaEWJQ0FTt4osjMMH78+D9S7oDwK4pIYe96WAqFGk89CgTwww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667732579; a=rsa-sha256; cv=none; b=uPOlgNvmYP3rmiw06kUTN/030aQNOTT8v5Bwyk5fNw4caEfmnSHWcnh8xq2PrnBq4/Gj76 30KMnPFVz5R9uD3xY7xEAUaUdEUvdDUGe11oODtjFR5wlkRn1KNbVl0Rh8/1KllHKdNY1h TiOPoifT65O498Y541J90ed54qQgL3gnwAb4NiUALpmeLKSVWTW+fsQq8NDHLjLAJt4Qxp 8nBFug213SkV5jpfnD4DWKgp/wXmtehCnN0rYqcPP8XvRka1jv1tL1auzLImfO55RYSS1y OeOUN4/ueQrusrOUx7/RgB8XUMctsTSu8sBPoimf89iQuC4FLqwnlZFySUq9cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=22c81cc51636cfebe94e0979eb31556d87775938 commit 22c81cc51636cfebe94e0979eb31556d87775938 Author: Richard Scheffenegger AuthorDate: 2022-11-06 10:55:52 +0000 Commit: Richard Scheffenegger CommitDate: 2022-11-06 10:56:02 +0000 tcp: add AccECN CE packet counters to tcpinfo Provide diagnostics information around AccECN into the tcpinfo struct. Event: IETF 115 Hackathon Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D37280 --- sys/netinet/tcp.h | 3 ++- sys/netinet/tcp_ecn.c | 4 +++- sys/netinet/tcp_usrreq.c | 13 +++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 7bb2efe5fae0..aa7f73f8be3c 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -390,7 +390,8 @@ struct tcp_info { u_int32_t tcpi_snd_zerowin; /* Zero-sized windows sent */ /* Accurate ECN counters. */ - u_int32_t __tcpi_received_ce; /* # of CE marks received */ + u_int32_t tcpi_delivered_ce; + u_int32_t tcpi_received_ce; /* # of CE marks received */ u_int32_t __tcpi_delivered_e1_bytes; u_int32_t __tcpi_delivered_e0_bytes; u_int32_t __tcpi_delivered_ce_bytes; diff --git a/sys/netinet/tcp_ecn.c b/sys/netinet/tcp_ecn.c index c74f4fa7c514..1d693944ac40 100644 --- a/sys/netinet/tcp_ecn.c +++ b/sys/netinet/tcp_ecn.c @@ -325,8 +325,10 @@ tcp_ecn_input_segment(struct tcpcb *tp, uint16_t thflags, int iptos) } } else { /* RFC3168 ECN handling */ - if ((thflags & (TH_SYN | TH_ECE)) == TH_ECE) + if ((thflags & (TH_SYN | TH_ECE)) == TH_ECE) { delta_ace = 1; + tp->t_scep++; + } if (thflags & TH_CWR) { tp->t_flags2 &= ~TF2_ECN_SND_ECE; tp->t_flags |= TF_ACKNOW; diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index d069c804bcc4..cc85c852ab6a 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1640,6 +1640,19 @@ tcp_fill_info(struct tcpcb *tp, struct tcp_info *ti) tcp_offload_tcp_info(tp, ti); } #endif + /* + * AccECN related counters. + */ + if ((tp->t_flags2 & (TF2_ECN_PERMIT | TF2_ACE_PERMIT)) == + (TF2_ECN_PERMIT | TF2_ACE_PERMIT)) + /* + * Internal counter starts at 5 for AccECN + * but 0 for RFC3168 ECN. + */ + ti->tcpi_delivered_ce = tp->t_scep - 5; + else + ti->tcpi_delivered_ce = tp->t_scep; + ti->tcpi_received_ce = tp->t_rcep; } /*