From: Jesper Dangaard Brouer <hawk@kernel.org>
To: Yan Zhai <yan@cloudflare.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, David Ahern <dsahern@kernel.org>,
Abhishek Chauhan <quic_abchauha@quicinc.com>,
Mina Almasry <almasrymina@google.com>,
Florian Westphal <fw@strlen.de>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
David Howells <dhowells@redhat.com>,
Jiri Pirko <jiri@resnulli.us>,
Daniel Borkmann <daniel@iogearbox.net>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Pavel Begunkov <asml.silence@gmail.com>,
linux-kernel@vger.kernel.org, kernel-team@cloudflare.com,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Neil Horman <nhorman@tuxdriver.com>,
linux-trace-kernel@vger.kernel.org,
Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [PATCH net-next v5 2/7] net: introduce sk_skb_reason_drop function
Date: Tue, 18 Jun 2024 08:18:13 +0200 [thread overview]
Message-ID: <86512cfe-3359-4d2c-ab27-8b298f56f15f@kernel.org> (raw)
In-Reply-To: <5610bfe554a02f92dd279fad839e65503902f710.1718642328.git.yan@cloudflare.com>
On 17/06/2024 20.09, Yan Zhai wrote:
> Long used destructors kfree_skb and kfree_skb_reason do not pass
> receiving socket to packet drop tracepoints trace_kfree_skb.
> This makes it hard to track packet drops of a certain netns (container)
> or a socket (user application).
>
> The naming of these destructors are also not consistent with most sk/skb
> operating functions, i.e. functions named "sk_xxx" or "skb_xxx".
> Introduce a new functions sk_skb_reason_drop as drop-in replacement for
> kfree_skb_reason on local receiving path. Callers can now pass receiving
> sockets to the tracepoints.
>
> kfree_skb and kfree_skb_reason are still usable but they are now just
> inline helpers that call sk_skb_reason_drop.
>
> Note it is not feasible to do the same to consume_skb. Packets not
> dropped can flow through multiple receive handlers, and have multiple
> receiving sockets. Leave it untouched for now.
>
> Suggested-by: Eric Dumazet<edumazet@google.com>
> Signed-off-by: Yan Zhai<yan@cloudflare.com>
> ---
> v1->v2: changes function names to be more consistent with common sk/skb
> operations
> ---
> include/linux/skbuff.h | 10 ++++++++--
> net/core/skbuff.c | 22 ++++++++++++----------
> 2 files changed, 20 insertions(+), 12 deletions(-)
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
next prev parent reply other threads:[~2024-06-18 6:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 18:09 [PATCH net-next v5 0/7] net: pass receive socket to drop tracepoint Yan Zhai
2024-06-17 18:09 ` [PATCH net-next v5 1/7] net: add rx_sk to trace_kfree_skb Yan Zhai
2024-06-18 6:15 ` Jesper Dangaard Brouer
2024-06-17 18:09 ` [PATCH net-next v5 2/7] net: introduce sk_skb_reason_drop function Yan Zhai
2024-06-18 6:18 ` Jesper Dangaard Brouer [this message]
2024-06-17 18:09 ` [PATCH net-next v5 3/7] ping: use sk_skb_reason_drop to free rx packets Yan Zhai
2024-06-18 6:18 ` Jesper Dangaard Brouer
2024-06-17 18:09 ` [PATCH net-next v5 4/7] net: raw: " Yan Zhai
2024-06-18 6:19 ` Jesper Dangaard Brouer
2024-06-17 18:09 ` [PATCH net-next v5 5/7] tcp: " Yan Zhai
2024-06-18 6:21 ` Jesper Dangaard Brouer
2024-06-17 18:09 ` [PATCH net-next v5 6/7] udp: " Yan Zhai
2024-06-18 6:22 ` Jesper Dangaard Brouer
2024-06-17 18:09 ` [PATCH net-next v5 7/7] af_packet: " Yan Zhai
2024-06-18 6:24 ` Jesper Dangaard Brouer
2024-06-19 11:50 ` [PATCH net-next v5 0/7] net: pass receive socket to drop tracepoint patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86512cfe-3359-4d2c-ab27-8b298f56f15f@kernel.org \
--to=hawk@kernel.org \
--cc=aleksander.lobakin@intel.com \
--cc=almasrymina@google.com \
--cc=asml.silence@gmail.com \
--cc=bigeasy@linutronix.de \
--cc=dan.carpenter@linaro.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=kernel-team@cloudflare.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=pabeni@redhat.com \
--cc=quic_abchauha@quicinc.com \
--cc=rostedt@goodmis.org \
--cc=yan@cloudflare.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).