Date: Fri, 8 Mar 2024 11:31:59 +0100 From: tuexen@freebsd.org To: Zhenlei Huang <zlei@FreeBSD.org> Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Subject: Re: git: 96ad640178ea - main - TCP LRO: add dtrace probe points Message-ID: <F7B36358-0DA0-40F6-B03E-8032A8D21F48@freebsd.org> In-Reply-To: <62073048-DC1D-4A40-8325-701022E9A356@FreeBSD.org> References: <202403080925.4289P2E4079996@gitrepo.freebsd.org> <62073048-DC1D-4A40-8325-701022E9A356@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> On Mar 8, 2024, at 10:57, Zhenlei Huang <zlei@FreeBSD.org> wrote: >=20 >=20 >=20 >> On Mar 8, 2024, at 5:25 PM, Michael Tuexen <tuexen@freebsd.org> = wrote: >>=20 >> The branch main has been updated by tuexen: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D96ad640178ea0a8a9d1772687659dce5= be18fbd9 >>=20 >> commit 96ad640178ea0a8a9d1772687659dce5be18fbd9 >> Author: Michael Tuexen <tuexen@FreeBSD.org> >> AuthorDate: 2024-03-08 09:21:09 +0000 >> Commit: Michael Tuexen <tuexen@FreeBSD.org> >> CommitDate: 2024-03-08 09:21:09 +0000 >>=20 >> TCP LRO: add dtrace probe points >>=20 >> Add the IP, UDP, and TCP receive static probes to the code path, >> which avoids if_input. >>=20 >> Reviewed by: rrs, markj >> MFC after: 1 week` >=20 > Be aware the last character ` in meta message 'MFC after' . No idea = whether the reminder mail > for MFCing will be correctly composed or not. Typo on side. Sorry for it and thanks for drawing attention to it. Best regards Michael >=20 >> Sponsored by: Netflix, Inc. >> Differential Revision: https://reviews.freebsd.org/D43727 >> --- >> sys/netinet/tcp_lro_hpts.c | 44 = ++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 44 insertions(+) >>=20 >> 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 <net/pfil.h> >>=20 >> #include <netinet/in.h> >> +#include <netinet/in_kdtrace.h> >> #include <netinet/ip6.h> >> #include <netinet/ip.h> >> #include <netinet/ip_var.h> >> @@ -281,22 +282,64 @@ do_bpf_strip_and_compress(struct tcpcb *tp, = struct lro_ctrl *lc, >> case LRO_TYPE_IPV4_TCP: >> tcp_hdr_offset -=3D sizeof(*le->outer.ip4); >> m->m_pkthdr.lro_etype =3D 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 -=3D sizeof(*le->outer.ip6); >> m->m_pkthdr.lro_etype =3D 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 -=3D sizeof(*le->outer.ip4); >> m->m_pkthdr.lro_etype =3D 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 -=3D sizeof(*le->outer.ip6); >> m->m_pkthdr.lro_etype =3D 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, >>=20 >> th->th_sum =3D 0; /* TCP checksum is valid. */ >> tcp_fields_to_host(th); >> + TCP_PROBE5(receive, NULL, tp, m, tp, th); >>=20 >> /* Check if ACK can be compressed */ >> can_compress =3D tcp_lro_ack_valid(m, th, &ts_ptr, &other_opts); >=20 > Best regards, > Zhenlei >=20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F7B36358-0DA0-40F6-B03E-8032A8D21F48>