From: Martin KaFai Lau <martin.lau@linux.dev>
To: "Abhishek Chauhan (ABC)" <quic_abchauha@quicinc.com>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: "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>,
Martin KaFai Lau <martin.lau@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
kernel@quicinc.com
Subject: Re: [RFC PATCH bpf-next v5 2/2] net: Add additional bit to support clockid_t timestamp type
Date: Fri, 26 Apr 2024 16:50:59 -0700 [thread overview]
Message-ID: <379558fe-a6e2-444b-a6a7-ef233efa8311@linux.dev> (raw)
In-Reply-To: <e761e1de-0e11-4541-a4db-a1b793a60674@quicinc.com>
On 4/26/24 11:46 AM, Abhishek Chauhan (ABC) wrote:
>>> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
>>> index 591226dcde26..f195b31d6e75 100644
>>> --- a/net/ipv4/ip_output.c
>>> +++ b/net/ipv4/ip_output.c
>>> @@ -1457,7 +1457,7 @@ struct sk_buff *__ip_make_skb(struct sock *sk,
>>> skb->priority = (cork->tos != -1) ? cork->priority: READ_ONCE(sk->sk_priority);
>>> skb->mark = cork->mark;
>>> - skb->tstamp = cork->transmit_time;
>>> + skb_set_tstamp_type_frm_clkid(skb, cork->transmit_time, sk->sk_clockid);
>> hmm... I think this will break for tcp. This sequence in particular:
>>
>> tcp_v4_timewait_ack()
>> tcp_v4_send_ack()
>> ip_send_unicast_reply()
>> ip_push_pending_frames()
>> ip_finish_skb()
>> __ip_make_skb()
>> /* sk_clockid is REAL but cork->transmit_time should be in mono */
>> skb_set_tstamp_type_frm_clkid(skb, cork->transmit_time, sk->sk_clockid);;
>>
>> I think I hit it from time to time when running the test in this patch set.
>>
> do you think i need to check for protocol type here . since tcp uses Mono and the rest according to the new design is based on
> sk->sk_clockid
> if (iph->protocol == IPPROTO_TCP)
> skb_set_tstamp_type_frm_clkid(skb, cork->transmit_time, CLOCK_MONOTONIC);
> else
> skb_set_tstamp_type_frm_clkid(skb, cork->transmit_time, sk->sk_clockid);
Looks ok. iph->protocol is from sk->sk_protocol. I would defer to Willem input here.
There is at least one more place that needs this protocol check, __ip6_make_skb().
next prev parent reply other threads:[~2024-04-26 23:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-24 22:20 [RFC PATCH bpf-next v5 0/2] Replace mono_delivery_time with tstamp_type Abhishek Chauhan
2024-04-24 22:20 ` [RFC PATCH bpf-next v5 1/2] net: Rename mono_delivery_time to tstamp_type for scalabilty Abhishek Chauhan
2024-04-25 14:31 ` Willem de Bruijn
2024-04-25 19:02 ` Abhishek Chauhan (ABC)
2024-04-25 23:50 ` Martin KaFai Lau
2024-04-25 23:55 ` Abhishek Chauhan (ABC)
2024-04-24 22:20 ` [RFC PATCH bpf-next v5 2/2] net: Add additional bit to support clockid_t timestamp type Abhishek Chauhan
2024-04-25 14:42 ` Willem de Bruijn
2024-04-25 19:12 ` Abhishek Chauhan (ABC)
2024-04-26 4:37 ` Martin KaFai Lau
2024-04-26 18:46 ` Abhishek Chauhan (ABC)
2024-04-26 23:50 ` Martin KaFai Lau [this message]
2024-04-30 19:16 ` Abhishek Chauhan (ABC)
2024-04-30 20:26 ` Willem de Bruijn
2024-04-30 20:40 ` Abhishek Chauhan (ABC)
2024-05-03 21:33 ` Abhishek Chauhan (ABC)
2024-05-03 21:41 ` Martin KaFai Lau
2024-05-03 22:14 ` Abhishek Chauhan (ABC)
2024-04-26 23:55 ` Martin KaFai Lau
2024-04-30 19:59 ` 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=379558fe-a6e2-444b-a6a7-ef233efa8311@linux.dev \
--to=martin.lau@linux.dev \
--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=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_abchauha@quicinc.com \
--cc=willemdebruijn.kernel@gmail.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).