[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221206125801.21203419@kernel.org>
Date: Tue, 6 Dec 2022 12:58:01 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, soheil@...gle.com
Subject: Re: [PATCH net-next] net_tstamp: add SOF_TIMESTAMPING_OPT_ID_TCP
On Tue, 6 Dec 2022 15:46:25 -0500 Willem de Bruijn wrote:
> > We can't just copy back the value of
> >
> > tcp_sk(sk)->snd_una - tcp_sk(sk)->write_seq
> >
> > to the user if the input of setsockopt is large enough (ie. extend the
> > struct, if len >= sizeof(new struct) -> user is asking to get this?
> > Or even add a bit somewhere that requests a copy back?
>
> We could, but indeed then we first need a way to signal that the
> kernel is new enough to actually write something meaningful back that
> is safe to read.
It should be sufficient to init the memory to -1.
(I guess I'm not helping my own "this is less hacky" argument? :)
> And if we change the kernel API and applications, I find this a
> somewhat hacky approach: why program the slightly wrong thing and
> return the offset to patch it up in userspace, if we can just program
> the right thing to begin with?
Ah, so you'd also switch all your apps to use this new bit?
What wasn't clear to me whether this is a
1 - we clearly did the wrong thing
or
2 - there is a legit use case for un-packetized(?) data not being
counted
In case of (1) we should make it clearer that the new bit is in fact
a "fixed" version of the functionality.
For (2) we can view this as an extension of the existing functionality
so combining in the same bit with write back seems natural (and TBH
I like the single syscall probing path more than try-one-then-the-other,
but that's 100% subjective).
Anyway, don't wanna waste too much of your time. If you prefer to keep
as is the doc change is good enough for me.
Powered by blists - more mailing lists