[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoB5AVYkHu74VN+Xsiq=Lu-H=9q5qFEr-331T5YV8OfThA@mail.gmail.com>
Date: Tue, 4 Feb 2025 08:19:54 +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: [PATCH bpf-next v7 06/13] net-timestamp: support SCM_TSTAMP_SCHED
for bpf extension
On Tue, Feb 4, 2025 at 7:23 AM Martin KaFai Lau <martin.lau@...ux.dev> wrote:
>
> On 1/28/25 12:46 AM, Jason Xing wrote:
> > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> > index 6042961dfc02..d19d577b996f 100644
> > --- a/net/core/skbuff.c
> > +++ b/net/core/skbuff.c
> > @@ -5564,6 +5564,24 @@ static bool skb_enable_app_tstamp(struct sk_buff *skb, int tstype, bool sw)
> > return false;
> > }
> >
> > +static void skb_tstamp_tx_bpf(struct sk_buff *skb, struct sock *sk, int tstype)
> > +{
> > + int op;
> > +
> > + if (!sk)
>
> This check is redundant.
Thanks. Will remove it.
>
> > + return;
> > +
> > + switch (tstype) {
> > + case SCM_TSTAMP_SCHED:
> > + op = BPF_SOCK_OPS_TS_SCHED_OPT_CB;
> > + break;
> > + default:
> > + return;
> > + }
> > +
> > + bpf_skops_tx_timestamping(sk, skb, op);
> > +}
> > +
> > void __skb_tstamp_tx(struct sk_buff *orig_skb,
> > const struct sk_buff *ack_skb,
> > struct skb_shared_hwtstamps *hwtstamps,
> > @@ -5576,6 +5594,11 @@ void __skb_tstamp_tx(struct sk_buff *orig_skb,
> > if (!sk)
>
> It has been tested here...
>
> > return;
> >
> > + /* bpf extension feature entry */
> > + if (skb_shinfo(orig_skb)->tx_flags & SKBTX_BPF)
> > + skb_tstamp_tx_bpf(orig_skb, sk, tstype);
>
> ...before calling this.
>
> > +
> > + /* application feature entry */
> > if (!skb_enable_app_tstamp(orig_skb, tstype, sw))
> > return;
Powered by blists - more mailing lists