* [PATCH] udp6: add a missing call into udp_fail_queue_rcv_skb tracepoint
@ 2023-07-06 17:22 Ivan Babrou
2023-07-06 17:37 ` Paolo Abeni
2023-07-07 2:17 ` Jakub Kicinski
0 siblings, 2 replies; 5+ messages in thread
From: Ivan Babrou @ 2023-07-06 17:22 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, kernel-team, Ivan Babrou, Willem de Bruijn,
David S. Miller, David Ahern, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Neil Horman, Satoru Moriya
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;
}
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] udp6: add a missing call into udp_fail_queue_rcv_skb tracepoint 2023-07-06 17:22 [PATCH] udp6: add a missing call into udp_fail_queue_rcv_skb tracepoint Ivan Babrou @ 2023-07-06 17:37 ` Paolo Abeni 2023-07-06 17:49 ` Ivan Babrou 2023-07-07 2:17 ` Jakub Kicinski 1 sibling, 1 reply; 5+ messages in thread From: Paolo Abeni @ 2023-07-06 17:37 UTC (permalink / raw) To: Ivan Babrou, netdev Cc: linux-kernel, kernel-team, Willem de Bruijn, David S. Miller, David Ahern, Eric Dumazet, Jakub Kicinski, Neil Horman, Satoru Moriya 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? Thanks! Paolo ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] udp6: add a missing call into udp_fail_queue_rcv_skb tracepoint 2023-07-06 17:37 ` Paolo Abeni @ 2023-07-06 17:49 ` Ivan Babrou 0 siblings, 0 replies; 5+ messages in thread From: Ivan Babrou @ 2023-07-06 17:49 UTC (permalink / raw) To: Paolo Abeni Cc: netdev, linux-kernel, kernel-team, Willem de Bruijn, David S. Miller, David Ahern, Eric Dumazet, Jakub Kicinski, Neil Horman, Satoru Moriya 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. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] udp6: add a missing call into udp_fail_queue_rcv_skb tracepoint 2023-07-06 17:22 [PATCH] udp6: add a missing call into udp_fail_queue_rcv_skb tracepoint Ivan Babrou 2023-07-06 17:37 ` Paolo Abeni @ 2023-07-07 2:17 ` Jakub Kicinski 2023-07-07 4:42 ` Ivan Babrou 1 sibling, 1 reply; 5+ messages in thread From: Jakub Kicinski @ 2023-07-07 2:17 UTC (permalink / raw) To: Ivan Babrou Cc: netdev, linux-kernel, kernel-team, Willem de Bruijn, David S. Miller, David Ahern, Eric Dumazet, Paolo Abeni, Neil Horman, Satoru Moriya 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? -- pw-bot: cr ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] udp6: add a missing call into udp_fail_queue_rcv_skb tracepoint 2023-07-07 2:17 ` Jakub Kicinski @ 2023-07-07 4:42 ` Ivan Babrou 0 siblings, 0 replies; 5+ messages in thread From: Ivan Babrou @ 2023-07-07 4:42 UTC (permalink / raw) To: Jakub Kicinski Cc: netdev, linux-kernel, kernel-team, Willem de Bruijn, David S. Miller, David Ahern, Eric Dumazet, Paolo Abeni, Neil Horman, Satoru Moriya 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/ ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-07 4:42 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-07-06 17:22 [PATCH] udp6: add a missing call into udp_fail_queue_rcv_skb tracepoint Ivan Babrou 2023-07-06 17:37 ` Paolo Abeni 2023-07-06 17:49 ` Ivan Babrou 2023-07-07 2:17 ` Jakub Kicinski 2023-07-07 4:42 ` Ivan Babrou
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).