From nobody Wed Apr 17 13:49:04 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 4VKMhK1N3Zz5Gwjj; Wed, 17 Apr 2024 13:49: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 4VKMhJ6DY5z4nTQ; Wed, 17 Apr 2024 13:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713361744; 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=fg7q5jA3Q3ykD6N2fnY6V9JZOgkhf15ZLxFs5wkhVuc=; b=cG1CzvSwhjC6l+C4Rc3sZhwpqjeUkOUHpD/zUd7F/UMwJz63BrMtTABshWrsjV9pzmeUc4 ss0dsISOJD4JKdiEOnceKd7OOLBya5msb0E4g8Ij71AVKKuCpLmwq3Q0e+38VPFGOlqqZ4 tDDXPsoOekUyCNoYF70w/22WS4RaB2j3tEHew+4c+a1qScYn5AlPnj+WGzddnjrV8n+/TP kTdf72FtpTJQy7OwHhPEPjNK3sly4eWVXSHSVkzd2C+vJzjBJv1OiHDmmjb8P9rOpqbs/v 2mli1lIhDPtbrooLskHAJce29EP4RDhmTzEyrJlqSs9tHDHsD+MNKG2bSfP1CA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713361744; a=rsa-sha256; cv=none; b=o0QusgjoDZXH2T2LUM3iITbz/5g8q1EYhHVljU6diwjmSYXLg9LjAFzyDUsSAD/MB6yyk3 xcacOPcRSPDvua7Zoq0jnUEBpjt32G5sd5YpKipYgpaEQKLCFawd7RNqQVx6yQtLu/4ANb E3fqKougWrgmwHPLA4iwjwfWSRNgNRyXug4HegDMByVFuu97RAvOj/kuCE/PbnTDXnfo8u jqBtiILY9HknIttoqo2IqSQnChwf0GYpTZopH5J0ywiCEcRXaxBIh9yY/2hobfrbQ8GHeB DDOL2q8n2jWhPy6g4/aVO3PEuT4VTtLBZttqCrbZmFhtN2EJNAOfL/lJJ2mZ5A== 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=1713361744; 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=fg7q5jA3Q3ykD6N2fnY6V9JZOgkhf15ZLxFs5wkhVuc=; b=ycWec9dMYkNtlfPmfSq4QCPyOuiIrTsvCuZ94zvSKNaTte5DPG/4MfIpN2oQNJwu34N3TJ mu+20byua2KLVJEuQkCiCANxVELBZL16PpKwtB/2MoKKCvc38HuAV3WlzZaYAACJnZtve4 IUxkgB/YpMb698Ebka7zVc/N/6B/JhTyLN3bJ+wxaaco/eYn3fyFPfRL1qbbomc65i8UMj 6nLDCpuuJgLcHxdXsOzEhSrX8BsSeGc0CUT+pSU5DYVTz9deazY3cx+Bl9AHIADZyw4I1o gQ5AsF7dNT2OCNwKvLROoRZ72YCjnDLsyPU+y22MVgtZWLuTnQZFUnslJlNDkQ== 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 4VKMhJ5rdxzTPd; Wed, 17 Apr 2024 13:49:04 +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 43HDn4rx020838; Wed, 17 Apr 2024 13:49:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43HDn4ds020835; Wed, 17 Apr 2024 13:49:04 GMT (envelope-from git) Date: Wed, 17 Apr 2024 13:49:04 GMT Message-Id: <202404171349.43HDn4ds020835@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: d69099e4330e - stable/14 - TCP LRO: add dtrace probe points 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: d69099e4330e1e2c4aa7349a3ab3f4ce47e8dc42 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d69099e4330e1e2c4aa7349a3ab3f4ce47e8dc42 commit d69099e4330e1e2c4aa7349a3ab3f4ce47e8dc42 Author: Michael Tuexen AuthorDate: 2024-03-08 09:21:09 +0000 Commit: Michael Tuexen CommitDate: 2024-04-17 13:48:45 +0000 TCP LRO: add dtrace probe points Add the IP, UDP, and TCP receive static probes to the code path, which avoids if_input. Reviewed by: rrs, markj Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D43727 (cherry picked from commit 96ad640178ea0a8a9d1772687659dce5be18fbd9) --- sys/netinet/tcp_lro_hpts.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/sys/netinet/tcp_lro_hpts.c b/sys/netinet/tcp_lro_hpts.c index 9c0d4be91d53..cd757d5a6164 100644 --- a/sys/netinet/tcp_lro_hpts.c +++ b/sys/netinet/tcp_lro_hpts.c @@ -50,6 +50,7 @@ #include #include +#include #include #include #include @@ -281,22 +282,64 @@ do_bpf_strip_and_compress(struct tcpcb *tp, struct lro_ctrl *lc, case LRO_TYPE_IPV4_TCP: tcp_hdr_offset -= sizeof(*le->outer.ip4); m->m_pkthdr.lro_etype = ETHERTYPE_IP; + IP_PROBE(receive, NULL, NULL, le->outer.ip4, lc->ifp, + le->outer.ip4, NULL); break; case LRO_TYPE_IPV6_TCP: tcp_hdr_offset -= sizeof(*le->outer.ip6); m->m_pkthdr.lro_etype = ETHERTYPE_IPV6; + IP_PROBE(receive, NULL, NULL, le->outer.ip6, lc->ifp, + NULL, le->outer.ip6); break; default: goto compressed; } break; case LRO_TYPE_IPV4_TCP: + switch (le->outer.data.lro_type) { + case LRO_TYPE_IPV4_UDP: + IP_PROBE(receive, NULL, NULL, le->outer.ip4, lc->ifp, + le->outer.ip4, NULL); + UDP_PROBE(receive, NULL, NULL, le->outer.ip4, NULL, + le->outer.udp); + break; + case LRO_TYPE_IPV6_UDP: + IP_PROBE(receive, NULL, NULL, le->outer.ip6, lc->ifp, + NULL, le->outer.ip6); + UDP_PROBE(receive, NULL, NULL, le->outer.ip6, NULL, + le->outer.udp); + break; + default: + __assert_unreachable(); + break; + } tcp_hdr_offset -= sizeof(*le->outer.ip4); m->m_pkthdr.lro_etype = ETHERTYPE_IP; + IP_PROBE(receive, NULL, NULL, le->inner.ip4, NULL, + le->inner.ip4, NULL); break; case LRO_TYPE_IPV6_TCP: + switch (le->outer.data.lro_type) { + case LRO_TYPE_IPV4_UDP: + IP_PROBE(receive, NULL, NULL, le->outer.ip4, lc->ifp, + le->outer.ip4, NULL); + UDP_PROBE(receive, NULL, NULL, le->outer.ip4, NULL, + le->outer.udp); + break; + case LRO_TYPE_IPV6_UDP: + IP_PROBE(receive, NULL, NULL, le->outer.ip6, lc->ifp, + NULL, le->outer.ip6); + UDP_PROBE(receive, NULL, NULL, le->outer.ip6, NULL, + le->outer.udp); + break; + default: + __assert_unreachable(); + break; + } tcp_hdr_offset -= sizeof(*le->outer.ip6); m->m_pkthdr.lro_etype = ETHERTYPE_IPV6; + IP_PROBE(receive, NULL, NULL, le->inner.ip6, NULL, NULL, + le->inner.ip6); break; default: goto compressed; @@ -313,6 +356,7 @@ do_bpf_strip_and_compress(struct tcpcb *tp, struct lro_ctrl *lc, th->th_sum = 0; /* TCP checksum is valid. */ tcp_fields_to_host(th); + TCP_PROBE5(receive, NULL, tp, m, tp, th); /* Check if ACK can be compressed */ can_compress = tcp_lro_ack_valid(m, th, &ts_ptr, &other_opts);