[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201001223835.kxobte2dci2jwiuz@kafai-mbp.dhcp.thefacebook.com>
Date: Thu, 1 Oct 2020 15:38:42 -0700
From: Martin KaFai Lau <kafai@...com>
To: <sdf@...gle.com>
CC: <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Eric Dumazet <edumazet@...gle.com>, <kernel-team@...com>,
Lawrence Brakmo <brakmo@...com>,
Neal Cardwell <ncardwell@...gle.com>, <netdev@...r.kernel.org>,
Yuchung Cheng <ycheng@...gle.com>
Subject: Re: [PATCH v5 bpf-next 09/12] bpf: tcp: Allow bpf prog to write and
parse TCP header option
On Wed, Sep 30, 2020 at 08:23:47AM -0700, sdf@...gle.com wrote:
> On 08/20, Martin KaFai Lau wrote:
> > [..]
> > +static inline void bpf_skops_init_child(const struct sock *sk,
> > + struct sock *child)
> > +{
> > + tcp_sk(child)->bpf_sock_ops_cb_flags =
> > + tcp_sk(sk)->bpf_sock_ops_cb_flags &
> > + (BPF_SOCK_OPS_PARSE_ALL_HDR_OPT_CB_FLAG |
> > + BPF_SOCK_OPS_PARSE_UNKNOWN_HDR_OPT_CB_FLAG |
> > + BPF_SOCK_OPS_WRITE_HDR_OPT_CB_FLAG);
> > +}
> It looks like it breaks test_tcpbpf_user test in an interesting way, can
> you verify on your side?
>
> Awhile ago, I've added retries to this test to make it less flaky.
> The test is waiting for 3 BPF_TCP_CLOSE events and now it
> only gets 2 BPF_TCP_CLOSE events.
>
> IIUC, we used to copy/inherit parent bpf_sock_ops_cb_flags and now
> we are doing only a small subset (bpf tcp header) with the code above.
>
> I'm still trying to understand whether that's working as intended
> and we need to fix the test or it's a user-visible breakage.
> Thoughts?
Thanks for the report.
Agree. bpf_skops_init_child() is unnecessary and it will break
existing assumption that the passive established socket
will inherit all cb_flags from the listen socket. It should just
allow sock_copy() to do its job.
I will post a fix.
Powered by blists - more mailing lists