From nobody Wed Apr 17 13:42:35 2024 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 4VKMXr1C2tz5Gw1m; Wed, 17 Apr 2024 13:42:36 +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 4VKMXr053Nz4lTt; Wed, 17 Apr 2024 13:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713361356; 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=p7Gulhys2xTgcQOMe//oHO5pMApjjz0PwD/1pOe3fH4=; b=Rz1bKwaThHKW2+kk4Lu1XHPEa31OnBysskRFF2ChYdz7DOkHdB7mCbBgpssLBfHv8cE87u kKcYXHnIWMKhnow3I59m0VlStFfVXcBF6lY/2y65oS9SrlPdHDpze4t/ShP5B6Gsk6lExq wW/EEOuS6hc5Dg5bbvnZJPjMoFSdunWdMnE2UViPIZeq62FSpU0Ci3LFxNYuUu1xIIn4Xz lbVV57aDnge2riZw43kEdZmowc9Y1tFGPeCKTt+GE5NA9YCSBnL/BHkQeDmFrvzSr1TsI8 XvhX5AQmq7xBV4HSgBuf90sSatrpKd5waHsqp4tMNSs/YerQzykX7DcYgl4ESQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713361356; a=rsa-sha256; cv=none; b=H2H26swrVDu6DwqRfsUKIVOi7RAXaxYxD06i1ZV1suavhUiDGMiUNMYsOyuUrl1Dt5myzL em3FM8O6PkeFXxavieLCxmDCuU/gfzfXk1914rplPqxoFwyW09kbbg7VLGR+7vkLkdZ02g nXzE6RAucvm11lwOdJnAx4xEwAqwehdf9yNUIgcPQBTLcSgiOzYxnN97jRdyTAO3AVcVFw tQeTK0ililDtyxUPzZssh6dX7Lsm+82//nz5Mq73/SMl93rrP70CGkmXFYGx9tUbR1hkxC zqECy7gzj5mkMJBWtL7WwnIpMFD9NIO2o4dDr+y06frz49IElXFoLMPVO9k90A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713361356; 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=p7Gulhys2xTgcQOMe//oHO5pMApjjz0PwD/1pOe3fH4=; b=bz2ZW6uOZSxtcTl28lSRwrVOunzxEGTAMFx1cCT3n6FzTK1XS/QXhwefmNdHT522gNdp4O 4Elafgu41gS/W2k/hx31E8QRotfupEvIbDI7k7dZoe2MWte7ikPPoTbb9lvoH7MaIu/UXW +eFYfQPXPUPvMLwDxzt3Q8jTpojxQIYs+J1KKcTJlNuhfXiWfVcZdmYT3TCVJT3QiyrCxQ COhqWLuHVqD/Osi9cRyAVd2v1rIx36R6C/qHpaIyg5Zo2qecHzMmzf+EdJiyICrLNcDAXj DR2WsjiehG8s4LCPZs1Ut6ZoJmczLp8BRxM8b47cctSdRoGfH6TKntuMIWCVsg== 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 4VKMXq6pkhzSq0; Wed, 17 Apr 2024 13:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43HDgZbt018928; Wed, 17 Apr 2024 13:42:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43HDgZ7n018925; Wed, 17 Apr 2024 13:42:35 GMT (envelope-from git) Date: Wed, 17 Apr 2024 13:42:35 GMT Message-Id: <202404171342.43HDgZ7n018925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 2da45e304dba - stable/14 - TCP LRO: convert TCP header fields to host byte order earlier 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2da45e304dba8004f953206a6fdfc4f801478251 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2da45e304dba8004f953206a6fdfc4f801478251 commit 2da45e304dba8004f953206a6fdfc4f801478251 Author: Michael Tuexen AuthorDate: 2024-01-29 17:41:24 +0000 Commit: Michael Tuexen CommitDate: 2024-04-17 13:42:13 +0000 TCP LRO: convert TCP header fields to host byte order earlier This is a preparation for adding dtrace hooks in a follow-up commit, which are missing in the code path, where packets are directly queued to the tcpcb. The dtrace hooks expect the fields to be in host byte order. This only applies when TCP HPTS is used. No functional change intended. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D43594 (cherry picked from commit f30c7d56546b9f36e42351fb385d96e37dbac1d5) --- sys/netinet/tcp_lro_hpts.c | 7 ++++--- sys/netinet/tcp_stacks/rack_bbr_common.c | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/netinet/tcp_lro_hpts.c b/sys/netinet/tcp_lro_hpts.c index 7724e727d5ce..84944c8db1ce 100644 --- a/sys/netinet/tcp_lro_hpts.c +++ b/sys/netinet/tcp_lro_hpts.c @@ -74,15 +74,15 @@ build_ack_entry(struct tcp_ackent *ae, struct tcphdr *th, struct mbuf *m, ae->flags |= TSTMP_LRO; else if (m->m_flags & M_TSTMP) ae->flags |= TSTMP_HDWR; - ae->seq = ntohl(th->th_seq); - ae->ack = ntohl(th->th_ack); + ae->seq = th->th_seq; + ae->ack = th->th_ack; ae->flags |= tcp_get_flags(th); if (ts_ptr != NULL) { ae->ts_value = ntohl(ts_ptr[1]); ae->ts_echo = ntohl(ts_ptr[2]); ae->flags |= HAS_TSTMP; } - ae->win = ntohs(th->th_win); + ae->win = th->th_win; ae->codepoint = iptos; } @@ -310,6 +310,7 @@ do_bpf_strip_and_compress(struct tcpcb *tp, struct lro_ctrl *lc, th = tcp_lro_get_th(m); th->th_sum = 0; /* TCP checksum is valid. */ + tcp_fields_to_host(th); /* Check if ACK can be compressed */ can_compress = tcp_lro_ack_valid(m, th, &ts_ptr, &other_opts); diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c index b265e8e6f20b..4a4a8af2bd78 100644 --- a/sys/netinet/tcp_stacks/rack_bbr_common.c +++ b/sys/netinet/tcp_stacks/rack_bbr_common.c @@ -415,10 +415,6 @@ skip_vnet: break; #endif } /* end switch */ - /* - * Convert TCP protocol specific fields to host format. - */ - tcp_fields_to_host(th); off = th->th_off << 2; if (off < sizeof (struct tcphdr) || off > tlen) { printf("off:%d < hdrlen:%zu || > tlen:%u -- dump\n",