[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLo6A__U5HqeA65NuBnrg36jpt9EOUC7T0fLdNEpa6eRQ@mail.gmail.com>
Date: Fri, 31 May 2024 08:51:30 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Yan Zhai <yan@...udflare.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
David Ahern <dsahern@...nel.org>, Abhishek Chauhan <quic_abchauha@...cinc.com>,
Mina Almasry <almasrymina@...gle.com>, Florian Westphal <fw@...len.de>,
Alexander Lobakin <aleksander.lobakin@...el.com>, David Howells <dhowells@...hat.com>,
Jiri Pirko <jiri@...nulli.us>, Daniel Borkmann <daniel@...earbox.net>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>, Lorenzo Bianconi <lorenzo@...nel.org>,
Pavel Begunkov <asml.silence@...il.com>, linux-kernel@...r.kernel.org,
kernel-team@...udflare.com, Jesper Dangaard Brouer <hawk@...nel.org>
Subject: Re: [RFC net-next 1/6] net: add kfree_skb_for_sk function
On Thu, May 30, 2024 at 11:46 PM Yan Zhai <yan@...udflare.com> wrote:
>
> Implement a new kfree_skb_for_sk to replace kfree_skb_reason on a few
> local receive path. The function accepts an extra receiving socket
> argument, which will be set in skb->cb for kfree_skb/consume_skb
> tracepoint consumption. With this extra bit of information, it will be
> easier to attribute dropped packets to netns/containers and
> sockets/services for performance and error monitoring purpose.
This is a lot of code churn...
I have to ask : Why not simply adding an sk parameter to an existing
trace point ?
If this not possible, I would rather add new tracepoints, adding new classes,
because it will ease your debugging :
When looking for TCP drops, simply use a tcp_event_sk_skb_reason instance,
and voila, no distractions caused by RAW/ICMP/ICMPv6/af_packet drops.
DECLARE_EVENT_CLASS(tcp_event_sk_skb_reason,
TP_PROTO(const struct sock *sk, const struct sk_buff *skb, enum
skb_drop_reason reason),
..
);
Also, the name ( kfree_skb_for_sk) and order of parameters is confusing.
I always prefer this kind of ordering/names :
void sk_skb_reason_drop( [struct net *net ] // not relevant here, but
to expand the rationale
struct sock *sk, struct sk_buff *skb, enum skb_drop_reason reason)
Looking at the name, we immediately see the parameter order.
The consume one (no @reason there) would be called
void sk_skb_consume(struct sock *sk, struct sk_buff *skb);
Powered by blists - more mailing lists