From nobody Tue Jun 20 21:54:04 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 4Qm0lK1fHbz4fyGR; Tue, 20 Jun 2023 21:54:05 +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 4Qm0lK1CSRz3LYY; Tue, 20 Jun 2023 21:54:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687298045; 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=rH7T4s8p1n6hWoS9CBAR3mO0zj0qWZLCnE6tYWbbH5I=; b=TlnaIIKdQaCsfRvKItd0safZgzjW+czTML5FCUQUOC09LNndyyOFa5HsmAs/8zo2bhmBN/ fZ0z2h621Nrn5iFB/Rlg1rvDGFynG2Hn+yoazWddoIDNE1NdEWx8cpHH/gx/yrCuek4aPp JozTG42MOJZ5fUt+7C850v3TSqfDwKN1S7njcF75emYUpLdgOC3nGPbM6gwp/+H52N7BJb SBRwd9VycuhgGvUFFcl4qnLOPAhPLk+5J/EYY5oIoo7lH85bMkKquJk50w/ZhdohPHJzED 4AB7GkELMJFwc9QSOoy0i8r8j4QowqAb8WWYIrSqiPj2uAw79WAvNp1xa8ew/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687298045; 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=rH7T4s8p1n6hWoS9CBAR3mO0zj0qWZLCnE6tYWbbH5I=; b=a/GaeEcPQ64aelIgPqkyBJAmtVgzMVeuRpMlWfwtMw720q1cxowj93ynlrg43VpN3v/98s QH0ePSCDPCFd1ZpBNeQEFPls4oeV/cu/eB7tnj9b+ndUh6NIBkZWAU805l452PdB3Pxfx4 Hip0ElluBeZoWBfe4Ypjv4xLmZ/txj36k7vQjbJqIfh9S4XYWi5EgoMqor9+OjilSGYyYX 4CHglFhhhaebYsztb+q1x9zkEhpomAaiOl9UuyPGJbZtM5CwPm/6boZk64aHMCz2leGsmk E/QHw+jTJjGyBxT0x68o+wxfotk4baHZbe+5Nz+R4PXHjlBcNrOokmD+FSjIlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687298045; a=rsa-sha256; cv=none; b=GRRo0oDitC2xdw1zx3NB4lX08ufS/JkWRQY0J+he86/lzeDzPeVd4BAFa+l/BVIJn4H1Ns R15P1MTmpOvB4s+87MnzFOjElsZHnX1s/SY/mWnNKHJSq/n2KaVxqjGTtUyPmpKAP/wGfw CEDlafpxpeau8ra7+MyC/npJqZWRhqwaTQbYk055g3wJpHzykbkuQtIl7AeHnya5/DYpQM /7mUhgTx/i8Ldad3dMmHi84Ug1TeNmLB7JBtwJFlv7ek30ggF9hbnOdl9XB/aerU17NOWJ BsOvKI7u6zSZVQO6U2ooTZQmVAyP6apsL053hmpbK6pjWRWCooXPAc0Fnv13pw== 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 4Qm0lK0JSzzGdl; Tue, 20 Jun 2023 21:54:05 +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 35KLs4Q5089191; Tue, 20 Jun 2023 21:54:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35KLs4gB089190; Tue, 20 Jun 2023 21:54:04 GMT (envelope-from git) Date: Tue, 20 Jun 2023 21:54:04 GMT Message-Id: <202306202154.35KLs4gB089190@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: 04682968c3f7 - main - tcp: expose AccECN mode and TCP FastOpen (TFO) in TCPI 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: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04682968c3f7993cf9c07d091c9411d38fb5540b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=04682968c3f7993cf9c07d091c9411d38fb5540b commit 04682968c3f7993cf9c07d091c9411d38fb5540b Author: Richard Scheffenegger AuthorDate: 2023-06-20 21:27:11 +0000 Commit: Richard Scheffenegger CommitDate: 2023-06-20 21:48:56 +0000 tcp: expose AccECN mode and TCP FastOpen (TFO) in TCPI Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D40621 --- sys/netinet/tcp.h | 1 + sys/netinet/tcp_usrreq.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 3c3086eabaf4..dbafc96927b2 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -336,6 +336,7 @@ struct tcphdr { #define TCPI_OPT_ECN 0x08 #define TCPI_OPT_TOE 0x10 #define TCPI_OPT_TFO 0x20 +#define TCPI_OPT_ACE 0x40 /* Maximum length of log ID. */ #define TCP_LOG_ID_LEN 64 diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index a9aee98f1332..629b47f04142 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1556,8 +1556,20 @@ tcp_fill_info(struct tcpcb *tp, struct tcp_info *ti) ti->tcpi_snd_wscale = tp->snd_scale; ti->tcpi_rcv_wscale = tp->rcv_scale; } - if (tp->t_flags2 & (TF2_ECN_PERMIT | TF2_ACE_PERMIT)) - ti->tcpi_options |= TCPI_OPT_ECN; + switch (tp->t_flags2 & (TF2_ECN_PERMIT | TF2_ACE_PERMIT)) { + case TF2_ECN_PERMIT: + ti->tcpi_options |= TCPI_OPT_ECN; + break; + case TF2_ACE_PERMIT: + /* FALLTHROUGH */ + case TF2_ECN_PERMIT | TF2_ACE_PERMIT: + ti->tcpi_options |= TCPI_OPT_ACE; + break; + default: + break; + } + if (IS_FASTOPEN(tp->t_flags)) + ti->tcpi_options |= TCPI_OPT_TFO; ti->tcpi_rto = tp->t_rxtcur * tick; ti->tcpi_last_data_recv = ((uint32_t)ticks - tp->t_rcvtime) * tick;