[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoB3BA+qTdjEDPbZRzhXOXL58p5bt9uZVKe_Gr4oGoPfxA@mail.gmail.com>
Date: Sat, 25 Jan 2025 09:16:51 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Martin KaFai Lau <martin.lau@...ux.dev>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, dsahern@...nel.org, willemdebruijn.kernel@...il.com,
willemb@...gle.com, ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
eddyz87@...il.com, song@...nel.org, yonghong.song@...ux.dev,
john.fastabend@...il.com, kpsingh@...nel.org, sdf@...ichev.me,
haoluo@...gle.com, jolsa@...nel.org, horms@...nel.org, bpf@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [RFC PATCH net-next v6 06/13] net-timestamp: support
SCM_TSTAMP_SCHED for bpf extension
On Sat, Jan 25, 2025 at 8:38 AM Martin KaFai Lau <martin.lau@...ux.dev> wrote:
>
> On 1/20/25 5:28 PM, Jason Xing wrote:
> > Introducing SKBTX_BPF is used as an indicator telling us whether
> > the skb should be traced by the bpf prog.
> >
> > Signed-off-by: Jason Xing <kerneljasonxing@...il.com>
> > ---
> > include/linux/skbuff.h | 6 +++++-
> > include/uapi/linux/bpf.h | 5 +++++
> > net/core/dev.c | 3 ++-
> > net/core/skbuff.c | 23 +++++++++++++++++++++++
> > tools/include/uapi/linux/bpf.h | 5 +++++
> > 5 files changed, 40 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> > index dfc419281cc9..35c2e864dd4b 100644
> > --- a/include/linux/skbuff.h
> > +++ b/include/linux/skbuff.h
> > @@ -490,10 +490,14 @@ enum {
> >
> > /* generate software time stamp when entering packet scheduling */
> > SKBTX_SCHED_TSTAMP = 1 << 6,
> > +
> > + /* used for bpf extension when a bpf program is loaded */
> > + SKBTX_BPF = 1 << 7,
> > };
> >
> > #define SKBTX_ANY_SW_TSTAMP (SKBTX_SW_TSTAMP | \
> > - SKBTX_SCHED_TSTAMP)
> > + SKBTX_SCHED_TSTAMP | \
> > + SKBTX_BPF)
> > #define SKBTX_ANY_TSTAMP (SKBTX_HW_TSTAMP | \
> > SKBTX_HW_TSTAMP_USE_CYCLES | \
> > SKBTX_ANY_SW_TSTAMP)
> > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> > index e629e09b0b31..72f93c6e45c1 100644
> > --- a/include/uapi/linux/bpf.h
> > +++ b/include/uapi/linux/bpf.h
> > @@ -7022,6 +7022,11 @@ enum {
> > * by the kernel or the
> > * earlier bpf-progs.
> > */
> > + BPF_SOCK_OPS_TS_SCHED_OPT_CB, /* Called when skb is passing through
> > + * dev layer when SO_TIMESTAMPING
>
> The "SO_TIMESTAMPING" term is not accurate. I guess you meant
> "SK_BPF_CB_TX_TIMESTAMPING"?
>
> Also, may be "Called before skb entering qdisc"?
>
> > + * feature is on. It indicates the
> > + * recorded timestamp.
>
> There is no timestamp recorded also.
Thanks for correcting me. I'll adjust them.
Thanks,
Jason
Powered by blists - more mailing lists