[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6705804318fa1_1a41992941a@willemb.c.googlers.com.notmuch>
Date: Tue, 08 Oct 2024 14:56:03 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Jason Xing <kerneljasonxing@...il.com>,
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,
martin.lau@...ux.dev,
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
Cc: bpf@...r.kernel.org,
netdev@...r.kernel.org,
Jason Xing <kernelxing@...cent.com>
Subject: Re: [PATCH net-next 6/9] net-timestamp: add tx OPT_ID_TCP support for
bpf case
Jason Xing wrote:
> From: Jason Xing <kernelxing@...cent.com>
>
> We can set OPT_ID|OPT_ID_TCP before we initialize the last skb
> from each sendmsg. We only set the socket once like how we use
> setsockopt() with OPT_ID|OPT_ID_TCP flags.
>
> Signed-off-by: Jason Xing <kernelxing@...cent.com>
> ---
> net/core/skbuff.c | 16 +++++++++++++---
> net/ipv4/tcp.c | 19 +++++++++++++++----
> 2 files changed, 28 insertions(+), 7 deletions(-)
>
> @@ -491,10 +491,21 @@ static u32 bpf_tcp_tx_timestamp(struct sock *sk)
> if (!(flags & SOF_TIMESTAMPING_TX_RECORD_MASK))
> return 0;
>
> + /* We require users to set both OPT_ID and OPT_ID_TCP flags
> + * together here, or else the key might be inaccurate.
> + */
> + if (flags & SOF_TIMESTAMPING_OPT_ID &&
> + flags & SOF_TIMESTAMPING_OPT_ID_TCP &&
> + !(sk->sk_tsflags & (SOF_TIMESTAMPING_OPT_ID | SOF_TIMESTAMPING_OPT_ID_TCP))) {
> + atomic_set(&sk->sk_tskey, (tcp_sk(sk)->write_seq - copied));
> + sk->sk_tsflags |= (SOF_TIMESTAMPING_OPT_ID | SOF_TIMESTAMPING_OPT_ID_TCP);
So user and BPF admin conflict on both sk_tsflags and sktskey?
I think BPF resetting this key, or incrementing it, may break user
expectations.
Powered by blists - more mailing lists