From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Abhishek Chauhan <quic_abchauha@quicinc.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Andrew Halaney <ahalaney@redhat.com>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Martin KaFai Lau <martin.lau@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Daniel Borkmann <daniel@iogearbox.net>,
bpf <bpf@vger.kernel.org>
Cc: kernel@quicinc.com
Subject: Re: [RFC PATCH bpf-next v1 2/3] net: assign enum to skb->tstamp_type to distinguish between tstamp
Date: Wed, 10 Apr 2024 11:35:42 -0400 [thread overview]
Message-ID: <6616b1ceeecad_2a98a529472@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <20240409210547.3815806-3-quic_abchauha@quicinc.com>
Abhishek Chauhan wrote:
> As we are renaming the mono_delivery_time to tstamp_type, it makes
> sense to start assigning tstamp_type based out if enum defined as
> part of this commit
>
> Earlier we used bool arg flag to check if the tstamp is mono in
> function skb_set_delivery_time, Now the signature of the functions
> accepts enum to distinguish between mono and real time.
>
> Link: https://lore.kernel.org/netdev/bc037db4-58bb-4861-ac31-a361a93841d3@linux.dev/
> Signed-off-by: Abhishek Chauhan <quic_abchauha@quicinc.com>
> ---
> include/linux/skbuff.h | 13 +++++++++----
> net/bridge/netfilter/nf_conntrack_bridge.c | 2 +-
> net/core/dev.c | 2 +-
> net/core/filter.c | 4 ++--
> net/ipv4/ip_output.c | 2 +-
> net/ipv4/tcp_output.c | 14 +++++++-------
> net/ipv6/ip6_output.c | 2 +-
> net/ipv6/tcp_ipv6.c | 2 +-
> net/sched/act_bpf.c | 2 +-
> net/sched/cls_bpf.c | 2 +-
> 10 files changed, 25 insertions(+), 20 deletions(-)
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 8210d699d8e9..6160185f0fe0 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -701,6 +701,11 @@ typedef unsigned int sk_buff_data_t;
> #else
> typedef unsigned char *sk_buff_data_t;
> #endif
> +
>
>
> +enum skb_tstamp_type {
> + SKB_TSTAMP_TYPE_RX_REAL = 0, /* A RX (receive) time in real */
> + SKB_TSTAMP_TYPE_TX_MONO = 1, /* A TX (delivery) time in mono */
> +};
I'd drop the RX_/TX_. This is just a version of clockid_t, compressed
to minimize space taken in sk_buff. Simpler to keep to the CLOCK_..
types. Where a clock was set (TX vs RX) is not relevant to the code
that later references skb->tstamp.
> static inline void skb_set_delivery_time(struct sk_buff *skb, ktime_t kt,
> - bool mono)
> + enum skb_tstamp_type tstamp_type)
> {
> skb->tstamp = kt;
> - skb->tstamp_type = kt && mono;
> + skb->tstamp_type = kt && tstamp_type;
Already introduce a switch here?
next prev parent reply other threads:[~2024-04-10 15:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-09 21:05 [RFC PATCH bpf-next v1 0/3] Rename mono_delivery_time to Abhishek Chauhan
2024-04-09 21:05 ` [RFC PATCH bpf-next v1 1/3] net: Rename mono_delivery_time to tstamp_type for scalabilty Abhishek Chauhan
2024-04-10 15:30 ` Willem de Bruijn
2024-04-10 19:04 ` Abhishek Chauhan (ABC)
2024-04-09 21:05 ` [RFC PATCH bpf-next v1 2/3] net: assign enum to skb->tstamp_type to distinguish between tstamp Abhishek Chauhan
2024-04-10 15:35 ` Willem de Bruijn [this message]
2024-04-10 19:07 ` Abhishek Chauhan (ABC)
2024-04-09 21:05 ` [RFC PATCH bpf-next v1 3/3] net: Add additional bit to support userspace timestamp type Abhishek Chauhan
2024-04-10 15:42 ` Willem de Bruijn
2024-04-10 20:25 ` Abhishek Chauhan (ABC)
2024-04-10 22:58 ` Willem de Bruijn
2024-04-10 23:25 ` Martin KaFai Lau
2024-04-10 23:39 ` Abhishek Chauhan (ABC)
2024-04-12 21:14 ` Abhishek Chauhan (ABC)
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=6616b1ceeecad_2a98a529472@willemb.c.googlers.com.notmuch \
--to=willemdebruijn.kernel@gmail.com \
--cc=ahalaney@redhat.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kernel@quicinc.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_abchauha@quicinc.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
all inboxes | Powered by JetHome®