From owner-dev-commits-src-all@freebsd.org Fri Aug 6 09:30:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 856A9652ADA; Fri, 6 Aug 2021 09:30:24 +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 4Gh0ZS1s1vz3pW7; Fri, 6 Aug 2021 09:30:24 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 265B53223; Fri, 6 Aug 2021 09:30:24 +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 1769UOxD044228; Fri, 6 Aug 2021 09:30:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1769UOLC044227; Fri, 6 Aug 2021 09:30:24 GMT (envelope-from git) Date: Fri, 6 Aug 2021 09:30:24 GMT Message-Id: <202108060930.1769UOLC044227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: bb5cd80e8b42 - main - Update the TCP LRO code to handle both encrypted and un-encrypted traffic. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb5cd80e8b42b31a2229077a7e93ffd3585eeb78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 09:30:24 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=bb5cd80e8b42b31a2229077a7e93ffd3585eeb78 commit bb5cd80e8b42b31a2229077a7e93ffd3585eeb78 Author: Hans Petter Selasky AuthorDate: 2021-08-02 09:53:12 +0000 Commit: Hans Petter Selasky CommitDate: 2021-08-06 09:28:44 +0000 Update the TCP LRO code to handle both encrypted and un-encrypted traffic. Encrypted and un-encrypted traffic needs to be coalesced separately. Split the 16-bit lro_type field in the address information into two 8-bit fields, and then use the last 8-bit field for flags, which among other indicate if the received mbuf is encrypted or un-encrypted. Differential Revision: https://reviews.freebsd.org/D31377 Reviewed by: gallatin MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/netinet/tcp_lro.c | 5 ++++- sys/netinet/tcp_lro.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index f0a996f685c3..cb548d457bb3 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -394,6 +394,9 @@ tcp_lro_parser(struct mbuf *m, struct lro_parser *po, struct lro_parser *pi, boo po->data.vlan_id = htons(m->m_pkthdr.ether_vtag) & htons(EVL_VLID_MASK); } + /* Store decrypted flag, if any. */ + if (__predict_false(m->m_flags & M_DECRYPTED)) + po->data.lro_flags |= LRO_FLAG_DECRYPTED; } switch (po->data.lro_type) { @@ -1583,7 +1586,7 @@ do_bpf_strip_and_compress(struct inpcb *inp, struct lro_ctrl *lc, uint32_t *ts_ptr; int32_t n_mbuf; bool other_opts, can_compress; - uint16_t lro_type; + uint8_t lro_type; uint16_t iptos; int tcp_hdr_offset; int idx; diff --git a/sys/netinet/tcp_lro.h b/sys/netinet/tcp_lro.h index 75ab78c7fc6f..3eefd4f0537c 100644 --- a/sys/netinet/tcp_lro.h +++ b/sys/netinet/tcp_lro.h @@ -67,12 +67,14 @@ struct inpcb; union lro_address { u_long raw[1]; struct { - uint16_t lro_type; /* internal */ + uint8_t lro_type; /* internal */ #define LRO_TYPE_NONE 0 #define LRO_TYPE_IPV4_TCP 1 #define LRO_TYPE_IPV6_TCP 2 #define LRO_TYPE_IPV4_UDP 3 #define LRO_TYPE_IPV6_UDP 4 + uint8_t lro_flags; +#define LRO_FLAG_DECRYPTED 1 uint16_t vlan_id; /* VLAN identifier */ uint16_t s_port; /* source TCP/UDP port */ uint16_t d_port; /* destination TCP/UDP port */