All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Vadim Fedorenko <vadfed@meta.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Willem de Bruijn <willemb@google.com>,
	Paolo Abeni <pabeni@redhat.com>, David Ahern <dsahern@kernel.org>
Cc: netdev@vger.kernel.org
Subject: Re: [RFC PATCH] net_tstamp: add SCM_TS_OPT_ID to provide OPT_ID in control message
Date: Thu, 29 Aug 2024 16:00:21 +0100	[thread overview]
Message-ID: <f5e46e19-b045-4ac8-b871-32affe3202c0@linux.dev> (raw)
In-Reply-To: <66d0856b4234a_38c94929436@willemb.c.googlers.com.notmuch>

On 29/08/2024 15:27, Willem de Bruijn wrote:
> Vadim Fedorenko wrote:
>> On 29/08/2024 14:31, Willem de Bruijn wrote:
>>> Vadim Fedorenko wrote:
>>>> SOF_TIMESTAMPING_OPT_ID socket option flag gives a way to correlate TX
>>>> timestamps
>>>
>>> +1 on the feature. Few minor points only.
>>>
>>> Not a hard requirement, but would be nice if there was a test,
>>> e.g., as a tools/testing/../txtimestamp.c extension.
>>
>> Sure, I'll add some tests in the next version.
>>
>>
>>>> and packets sent via socket. Unfortunately, there is no way
>>>> to reliably predict socket timestamp ID value in case of error returned
>>>> by sendmsg [1].
>>>
>>> Might be good to copy more context from the discussion to explain why
>>> reliable OPT_ID is infeasible. For UDP, it is as simple as lockless
>>> transmit. For RAW, things like MSG_MORE come into play.
>>
>> Ok, I'll add it, thanks!
>>
>>>> This patch adds new control message type to give user-space
>>>> software an opportunity to control the mapping between packets and
>>>> values by providing ID with each sendmsg. This works fine for UDP
>>>> sockets only, and explicit check is added to control message parser.
>>>> Also, there is no easy way to use 0 as provided ID, so this is value
>>>> treated as invalid.
>>>
>>> This is because the code branches on non-zero value in the cookie,
>>> else uses ts_key. Please make this explicit. Or perhaps better, add a
>>> bit in the cookie so that the full 32-bit space can be used.
>>
>> Adding a bit in the cookie is not enough, I have to add another flag to
>> inet_cork. And we are running out of space for tx flags,
>> inet_cork::tx_flags is u8 and we have only 1 bit left for SKBTX* enum.
>> Do you think it's OK to use this last bit for OPT_ID feature?
> 
> No, that space is particularly constrained in skb_shinfo.
> 
> Either a separate bit in inet_cork, or just keep as is.

Ok, got it. I'll add IPCORK_TS_OPT_ID flag then. Thanks!

      reply	other threads:[~2024-08-29 15:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29  0:03 [RFC PATCH] net_tstamp: add SCM_TS_OPT_ID to provide OPT_ID in control message Vadim Fedorenko
2024-08-29 13:31 ` Willem de Bruijn
2024-08-29 14:13   ` Vadim Fedorenko
2024-08-29 14:27     ` Willem de Bruijn
2024-08-29 15:00       ` Vadim Fedorenko [this message]

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=f5e46e19-b045-4ac8-b871-32affe3202c0@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=dsahern@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vadfed@meta.com \
    --cc=willemb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.