Message ID | 20230706172237.28341-1-ivan@cloudflare.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2729803vqx; Thu, 6 Jul 2023 10:45:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlE/FFu3pcxzlVjcVdGVcNPyPBEQE7TFpmyUk5XC/1+MNSKUaMa/anLuNPeDLDo1K85DGpex X-Received: by 2002:a05:6a20:429f:b0:12f:6500:8504 with SMTP id o31-20020a056a20429f00b0012f65008504mr2937921pzj.46.1688665551956; Thu, 06 Jul 2023 10:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688665551; cv=none; d=google.com; s=arc-20160816; b=D6KRRwz7FzkBO8mZBk6XdkRfKkuGIkhEiQ6rbjuCBbKDk/C9gK5xanevoKVIO/VHlS 9FyFTYp/DX+Qgo7Jq8BCgt7lIb0J0I0kFBmd2ja5agUtkEgtdgUI/MPy8XbSU7I3e6sK c/Wpl/If+vnQVofyKNFAANnubqfh0EvM6YPpuyCGO2+lFfLb30804/E2bbmLy4Etfp82 ze0dFSEjComJnFL8VbyEE1xuKr9j27TTWmBZ5YyMMBnJMFyiHmwWmn0AnL6aUf691Zu3 K63QXh0wUKNisDNBXsog8fGzDg/hXHDrx0KVIV2re03Dgh9f8NnJ6Lro6aYL2ph999cc Fh3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3w6eM1h+0P8X1QDbGu2Q17kb8M2qnV/qp1NskbLt6Z0=; fh=g18A6d9IPj/17B1fInqDttS84i39uYHf5eygkaDVRgM=; b=frswRaaA4A1CZ0Hlv+Fnj81SS9dkCEqPr1zEIJsE/8FwGf4B7cbTdx/+AhHMQZWiAe aM9e9dYDO+hlAEVepLzLy0WMj31QoN9sFOZqCgt6zq18sU6ESZ/NDQcuCMOReK2HMPa1 ibmk1Li3NqitbBLfFJfYSYhthyfGWr8t+1E5LJOwWZTCMSUreayTvzE0xqR3YC1QwvFW Toh4B1kdZVRwlOu6obeB0JzIZD/CTyw6Ul1DCQspEjYxcIoh5yqRLr8FauuuMV9mk/7p j3sH6k3G4n2DYkVEnbwewKBWlZpwhu03+MSMmCoysb1/236d3LiX0gtNoBwquOnQf9/g iKCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=BUPdN44P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a6566d4000000b0053439c1712esi1787082pgw.713.2023.07.06.10.45.38; Thu, 06 Jul 2023 10:45:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=BUPdN44P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229964AbjGFRXX (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Thu, 6 Jul 2023 13:23:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbjGFRXW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 6 Jul 2023 13:23:22 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AD991BE9 for <linux-kernel@vger.kernel.org>; Thu, 6 Jul 2023 10:23:21 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-55b83ae9be2so728814a12.2 for <linux-kernel@vger.kernel.org>; Thu, 06 Jul 2023 10:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; t=1688664200; x=1691256200; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3w6eM1h+0P8X1QDbGu2Q17kb8M2qnV/qp1NskbLt6Z0=; b=BUPdN44Pqpap981nerjdz0tmWFl99Jhx/pTjf/uNWurNdXG0E8Aya+43lFIjrQakt3 aTVTSRMtB6Qre/swdUDlKkB51mf/8gU0WbwhkChkq3WHXezkMH74Qiea6VOZMcvmFixL m/qNgag4jj6XXQKOE7w2+lkZSjvJlz02Fh6yg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688664200; x=1691256200; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3w6eM1h+0P8X1QDbGu2Q17kb8M2qnV/qp1NskbLt6Z0=; b=NHBx225afbA5q2EIFqf4utYhqflbOIvx+z10k+GWNVkvlsNuNNHRtGGLShYq3gsRtX HfRXpBrbR0zV0oWn1QqMlGZolWbUXgdKP4Nc5Zqe76AFU7YkhZAAUnvGcvqnjurR2LyN g3n1318Jcs+epmyLG3mXErcrVsayRTsn2cjPEVotAZsBVU4IXZdOD4fhxYv9GK2pLK/C 6WIr1bUkBKdlL+ea5WlcknmgKjhSjV8YCpzSZzizXn2fk0zC+h8COIL67Di6ahahVswW O4T+Nw4UjHoyQK5kJfGnmLgWKQHy1ZHPYgAsxYvhz4pqu3IfTWk4OrUh4pRRuyNlrc4b xoTA== X-Gm-Message-State: ABy/qLaHgCjLt8ZllexeEemeREJrCpn7wfwmsH2udg/oFoDq0GI/2bDg B1JeqFXLjFWnC602SgA8HWW5mZiK2a4NzoUNpr6m3g== X-Received: by 2002:a05:6a20:9384:b0:130:3c8b:4204 with SMTP id x4-20020a056a20938400b001303c8b4204mr2118043pzh.8.1688664200464; Thu, 06 Jul 2023 10:23:20 -0700 (PDT) Received: from localhost ([2601:644:200:aea:502d:5846:fd1f:55e7]) by smtp.gmail.com with ESMTPSA id p22-20020aa78616000000b0067903510abbsm1528509pfn.163.2023.07.06.10.23.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 10:23:20 -0700 (PDT) From: Ivan Babrou <ivan@cloudflare.com> To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@cloudflare.com, Ivan Babrou <ivan@cloudflare.com>, Willem de Bruijn <willemdebruijn.kernel@gmail.com>, "David S. Miller" <davem@davemloft.net>, David Ahern <dsahern@kernel.org>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Neil Horman <nhorman@tuxdriver.com>, Satoru Moriya <satoru.moriya@hds.com> Subject: [PATCH] udp6: add a missing call into udp_fail_queue_rcv_skb tracepoint Date: Thu, 6 Jul 2023 10:22:36 -0700 Message-ID: <20230706172237.28341-1-ivan@cloudflare.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770693948965800684?= X-GMAIL-MSGID: =?utf-8?q?1770694170069286907?= |
Series |
udp6: add a missing call into udp_fail_queue_rcv_skb tracepoint
|
|
Commit Message
Ivan Babrou
July 6, 2023, 5:22 p.m. UTC
The tracepoint has existed for 12 years, but it only covered udp
over the legacy IPv4 protocol. Having it enabled for udp6 removes
the unnecessary difference in error visibility.
Signed-off-by: Ivan Babrou <ivan@cloudflare.com>
Fixes: 296f7ea75b45 ("udp: add tracepoints for queueing skb to rcvbuf")
---
net/ipv6/udp.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On Thu, Jul 6, 2023 at 10:39 AM Paolo Abeni <pabeni@redhat.com> wrote: > > Hi, > > On Thu, 2023-07-06 at 10:22 -0700, Ivan Babrou wrote: > > The tracepoint has existed for 12 years, but it only covered udp > > over the legacy IPv4 protocol. Having it enabled for udp6 removes > > the unnecessary difference in error visibility. > > > > Signed-off-by: Ivan Babrou <ivan@cloudflare.com> > > Fixes: 296f7ea75b45 ("udp: add tracepoints for queueing skb to rcvbuf") > > --- > > net/ipv6/udp.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c > > index e5a337e6b970..debb98fb23c0 100644 > > --- a/net/ipv6/udp.c > > +++ b/net/ipv6/udp.c > > @@ -45,6 +45,7 @@ > > #include <net/tcp_states.h> > > #include <net/ip6_checksum.h> > > #include <net/ip6_tunnel.h> > > +#include <trace/events/udp.h> > > #include <net/xfrm.h> > > #include <net/inet_hashtables.h> > > #include <net/inet6_hashtables.h> > > @@ -680,6 +681,7 @@ static int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) > > } > > UDP6_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, is_udplite); > > kfree_skb_reason(skb, drop_reason); > > + trace_udp_fail_queue_rcv_skb(rc, sk); > > return -1; > > } > > The patch looks correct and consistency is a nice thing, but I'm > wondering if we should instead remove the tracepoint from the UDP v4 > code? We already have drop reason and MIBs to pin-point quite > accurately UDP drops, and the trace point does not cover a few UDPv4 > spots (e.g. mcast). WDYT? We are using this tracepoint in production monitoring: * https://github.com/cloudflare/ebpf_exporter/blob/master/examples/udp-drops.bpf.c It gives us a metric with a port and through internal port ownership we can automatically notify the responsible people to address the issue. It is not possible with MIB, as it lacks the port information. As for kfree_skb, it is much higher frequency (literally infinitely more frequent in a happy state): $ sudo perf stat -a -e skb:kfree_skb,udp:udp_fail_queue_rcv_skb -- sleep 10 70,546 skb:kfree_skb 0 udp:udp_fail_queue_rcv_skb It would be a lot more expensive to use kfree_skb to drive the metric we have today. It would be even more expensive for machines that have high bandwidth traffic, since they would see a lot more skbs (the one above is not that busy). As a matter of fact, I have a local patch to introduce a tracepoint for tcp listen drops with the similar reasoning, waiting for net-next to open.
On Thu, 6 Jul 2023 10:22:36 -0700 Ivan Babrou wrote: > The tracepoint has existed for 12 years, but it only covered udp > over the legacy IPv4 protocol. Having it enabled for udp6 removes > the unnecessary difference in error visibility. > > Signed-off-by: Ivan Babrou <ivan@cloudflare.com> > Fixes: 296f7ea75b45 ("udp: add tracepoints for queueing skb to rcvbuf") Doesn't build when IPv6=m, you need to export the tp?
On Thu, Jul 6, 2023 at 7:17 PM Jakub Kicinski <kuba@kernel.org> wrote: > > On Thu, 6 Jul 2023 10:22:36 -0700 Ivan Babrou wrote: > > The tracepoint has existed for 12 years, but it only covered udp > > over the legacy IPv4 protocol. Having it enabled for udp6 removes > > the unnecessary difference in error visibility. > > > > Signed-off-by: Ivan Babrou <ivan@cloudflare.com> > > Fixes: 296f7ea75b45 ("udp: add tracepoints for queueing skb to rcvbuf") > > Doesn't build when IPv6=m, you need to export the tp? Thank you, I just sent v2 with the fix: * https://lore.kernel.org/netdev/20230707043923.35578-1-ivan@cloudflare.com/
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index e5a337e6b970..debb98fb23c0 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -45,6 +45,7 @@ #include <net/tcp_states.h> #include <net/ip6_checksum.h> #include <net/ip6_tunnel.h> +#include <trace/events/udp.h> #include <net/xfrm.h> #include <net/inet_hashtables.h> #include <net/inet6_hashtables.h> @@ -680,6 +681,7 @@ static int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) } UDP6_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, is_udplite); kfree_skb_reason(skb, drop_reason); + trace_udp_fail_queue_rcv_skb(rc, sk); return -1; }