From: Steven Rostedt <rostedt@goodmis.org>
To: Yan Zhai <yan@cloudflare.com>
Cc: netdev@vger.kernel.org, "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,
Jesper Dangaard Brouer <hawk@kernel.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: [RFC v3 net-next 1/7] net: add rx_sk to trace_kfree_skb
Date: Mon, 10 Jun 2024 12:54:22 -0400 [thread overview]
Message-ID: <20240610125422.252da487@rorschach.local.home> (raw)
In-Reply-To: <CAO3-PbqRNRduSAyN9CtaxPFsOs9xtGHruu1ACfJ5e-mrvTo2Cw@mail.gmail.com>
On Thu, 6 Jun 2024 10:37:46 -0500
Yan Zhai <yan@cloudflare.com> wrote:
> > name: kfree_skb
> > ID: 1799
> > format:
> > field:unsigned short common_type; offset:0; size:2; signed:0;
> > field:unsigned char common_flags; offset:2; size:1; signed:0;
> > field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
> > field:int common_pid; offset:4; size:4; signed:1;
> >
> > field:void * skbaddr; offset:8; size:8; signed:0;
> > field:void * location; offset:16; size:8; signed:0;
> > field:unsigned short protocol; offset:24; size:2; signed:0;
> > field:enum skb_drop_reason reason; offset:28; size:4; signed:0;
> >
> > Notice that "protocol" is 2 bytes in size at offset 24, but "reason" starts
> > at offset 28. This means at offset 26, there's a 2 byte hole.
> >
> The reason I added the pointer as the last argument is trying to
> minimize the surprise to existing TP users, because for common ABIs
> it's fine to omit later arguments when defining a function, but it
> needs change and recompilation if the order of arguments changed.
Nothing should be hard coding the offsets of the fields. This is
exported to user space so that tools can see where the fields are.
That's the purpose of libtraceevent. The fields should be movable and
not affect anything. There should be no need to recompile.
>
> Looking at the actual format after the change, it does not add a new
> hole since protocol and reason are already packed into the same 8-byte
> block, so rx_skaddr starts at 8-byte aligned offset:
>
> # cat /sys/kernel/debug/tracing/events/skb/kfree_skb/format
> name: kfree_skb
> ID: 2260
> format:
> field:unsigned short common_type; offset:0;
> size:2; signed:0;
> field:unsigned char common_flags; offset:2;
> size:1; signed:0;
> field:unsigned char common_preempt_count; offset:3;
> size:1; signed:0;
> field:int common_pid; offset:4; size:4; signed:1;
>
> field:void * skbaddr; offset:8; size:8; signed:0;
> field:void * location; offset:16; size:8; signed:0;
> field:unsigned short protocol; offset:24; size:2; signed:0;
> field:enum skb_drop_reason reason; offset:28;
> size:4; signed:0;
> field:void * rx_skaddr; offset:32; size:8; signed:0;
>
> Do you think we still need to change the order?
Up to you, just wanted to point it out.
-- Steve
next prev parent reply other threads:[~2024-06-10 16:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 21:47 [RFC v3 net-next 0/7] net: pass receive socket to drop tracepoint Yan Zhai
2024-06-04 21:47 ` [RFC v3 net-next 1/7] net: add rx_sk to trace_kfree_skb Yan Zhai
2024-06-05 23:57 ` Steven Rostedt
2024-06-06 15:37 ` Yan Zhai
2024-06-07 14:29 ` David Ahern
2024-06-10 16:54 ` Steven Rostedt [this message]
2024-06-10 20:25 ` Yan Zhai
2024-06-04 21:47 ` [RFC v3 net-next 2/7] net: introduce sk_skb_reason_drop function Yan Zhai
2024-06-04 21:47 ` [RFC v3 net-next 3/7] ping: use sk_skb_reason_drop to free rx packets Yan Zhai
2024-06-04 21:47 ` [RFC v3 net-next 4/7] net: raw: " Yan Zhai
2024-06-04 21:47 ` [RFC v3 net-next 5/7] tcp: " Yan Zhai
2024-06-04 21:47 ` [RFC v3 net-next 6/7] udp: " Yan Zhai
2024-06-04 21:47 ` [RFC v3 net-next 7/7] af_packet: " Yan Zhai
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=20240610125422.252da487@rorschach.local.home \
--to=rostedt@goodmis.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=hawk@kernel.org \
--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=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).