lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e96805aa-2ce8-46c0-b136-4781cf4092ce@gmail.com>
Date: Mon, 16 Jun 2025 17:44:57 +0100
From: Pavel Begunkov <asml.silence@...il.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>,
 io-uring@...r.kernel.org, Vadim Fedorenko <vadim.fedorenko@...ux.dev>
Cc: netdev@...r.kernel.org, Eric Dumazet <edumazet@...gle.com>,
 Kuniyuki Iwashima <kuniyu@...zon.com>, Paolo Abeni <pabeni@...hat.com>,
 Willem de Bruijn <willemb@...gle.com>, "David S . Miller"
 <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
 Richard Cochran <richardcochran@...il.com>,
 Stanislav Fomichev <sdf@...ichev.me>, Jason Xing <kerneljasonxing@...il.com>
Subject: Re: [PATCH v4 1/5] net: timestamp: add helper returning skb's tx
 tstamp

On 6/16/25 15:58, Willem de Bruijn wrote:
> Pavel Begunkov wrote:
>> On 6/16/25 03:31, Willem de Bruijn wrote:
>>> Pavel Begunkov wrote:
>>>> Add a helper function skb_get_tx_timestamp() that returns a tx timestamp
>>>> associated with an error queue skb.
>>>>
>>>> Signed-off-by: Pavel Begunkov <asml.silence@...il.com>
>>>> ---
>>>>    include/net/sock.h |  9 +++++++++
>>>>    net/socket.c       | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>>>>    2 files changed, 55 insertions(+)
>>>>
>>>> diff --git a/include/net/sock.h b/include/net/sock.h
>>>> index 92e7c1aae3cc..0b96196d8a34 100644
>>>> --- a/include/net/sock.h
>>>> +++ b/include/net/sock.h
>>>> @@ -2677,6 +2677,15 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
>>>>    void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
>>>>    			     struct sk_buff *skb);
>>>>    
>>>> +enum {
>>>> +	NET_TIMESTAMP_ORIGIN_SW		= 0,
>>>> +	NET_TIMESTAMP_ORIGIN_HW		= 1,
>>>> +};
>>>
>>> Can you avoid introducing a new enum, and instead just return
>>> SOF_TIMESTAMPING_TX_HARDWARE (1) or SOF_TIMESTAMPING_TX_SOFTWARE (2)?
>>
>> I can't say I like it more because TX_{SW,HW} is just a small
>> subset of SOF_TIMESTAMPING_* flags and the caller by default
>> could assume that there might be other values as well, but let
>> me send v5 and we'll see which is better.
> 
> This is quite a lot of new timestamping logic for only io_uring as
> user, and I don't see any other user of it coming soon. I also see no
> easy way to make it more concise, so it's fine. But this at least
> avoids one extra new enum.

enums are free :) Anyway, I don't have plans for further changes,
so I agree, SOF_TIMESTAMPING_* shouldn't be a problem.

-- 
Pavel Begunkov


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ