[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y1f2f20f.fsf@cloudflare.com>
Date: Mon, 13 Nov 2023 10:02:49 +0100
From: Jakub Sitnicki <jakub@...udflare.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>, Pengcheng Yang
<yangpc@...gsu.com>
Cc: John Fastabend <john.fastabend@...il.com>, bpf <bpf@...r.kernel.org>,
Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf-next] bpf, sockmap: Bundle psock->sk_redir and
redir_ingress into a tagged pointer
On Fri, Nov 10, 2023 at 07:42 AM -08, Alexei Starovoitov wrote:
> On Fri, Nov 10, 2023 at 1:44 AM Pengcheng Yang <yangpc@...gsu.com> wrote:
>>
>> Like skb->_sk_redir, we bundle the sock redirect pointer and
>> the ingress bit to manage them together.
>>
>> Suggested-by: Jakub Sitnicki <jakub@...udflare.com>
>> Link: https://lore.kernel.org/bpf/87cz97cnz8.fsf@cloudflare.com
>> Signed-off-by: Pengcheng Yang <yangpc@...gsu.com>
>> ---
>> include/linux/skmsg.h | 30 ++++++++++++++++++++++++++++--
>> net/core/skmsg.c | 18 ++++++++++--------
>> net/ipv4/tcp_bpf.c | 13 +++++++------
>> net/tls/tls_sw.c | 11 ++++++-----
>> 4 files changed, 51 insertions(+), 21 deletions(-)
>>
>> diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
>> index c1637515a8a4..ae021f511f46 100644
>> --- a/include/linux/skmsg.h
>> +++ b/include/linux/skmsg.h
>> @@ -78,11 +78,10 @@ struct sk_psock_work_state {
>>
>> struct sk_psock {
>> struct sock *sk;
>> - struct sock *sk_redir;
>> + unsigned long _sk_redir;
>
> Please don't.
> There is no need to bundle them together.
Seeing how the code turned out, I agree - it didn't work out.
Code is not any simpler. My gut feeling was wrong here.
I gotta ask for, for the future, though -
this is not a "no" to tagged pointers in general, right?
Powered by blists - more mailing lists