Re: [Patch bpf-next v8 10/16] sock: introduce sk->sk_prot->psock_update_sk_prot()

2021-04-06 Thread John Fastabend
Cong Wang wrote: > On Mon, Apr 5, 2021 at 1:25 AM Eric Dumazet wrote: > > > > > > > > On 3/31/21 4:32 AM, Cong Wang wrote: > > > From: Cong Wang > > > > > > Currently sockmap calls into each protocol to update the struct > > > proto and replace it. This certainly won't work when the protocol > >

Re: [Patch bpf-next v8 10/16] sock: introduce sk->sk_prot->psock_update_sk_prot()

2021-04-06 Thread Cong Wang
On Mon, Apr 5, 2021 at 1:25 AM Eric Dumazet wrote: > > > > On 3/31/21 4:32 AM, Cong Wang wrote: > > From: Cong Wang > > > > Currently sockmap calls into each protocol to update the struct > > proto and replace it. This certainly won't work when the protocol > > is implemented as a module, for exa

Re: [Patch bpf-next v8 10/16] sock: introduce sk->sk_prot->psock_update_sk_prot()

2021-04-06 Thread John Fastabend
Eric Dumazet wrote: > > > On 3/31/21 4:32 AM, Cong Wang wrote: > > From: Cong Wang > > > > Currently sockmap calls into each protocol to update the struct > > proto and replace it. This certainly won't work when the protocol > > is implemented as a module, for example, AF_UNIX. > > > > Introdu

Re: [Patch bpf-next v8 10/16] sock: introduce sk->sk_prot->psock_update_sk_prot()

2021-04-05 Thread Eric Dumazet
On 3/31/21 4:32 AM, Cong Wang wrote: > From: Cong Wang > > Currently sockmap calls into each protocol to update the struct > proto and replace it. This certainly won't work when the protocol > is implemented as a module, for example, AF_UNIX. > > Introduce a new ops sk->sk_prot->psock_update_

Re: [Patch bpf-next v8 10/16] sock: introduce sk->sk_prot->psock_update_sk_prot()

2021-04-02 Thread Cong Wang
On Fri, Apr 2, 2021 at 3:16 AM Jakub Sitnicki wrote: > > -struct proto *udp_bpf_get_proto(struct sock *sk, struct sk_psock *psock) > > +int udp_bpf_update_proto(struct sock *sk, bool restore) > > { > > int family = sk->sk_family == AF_INET ? UDP_BPF_IPV4 : UDP_BPF_IPV6; > > + struct sk_

Re: [Patch bpf-next v8 10/16] sock: introduce sk->sk_prot->psock_update_sk_prot()

2021-04-02 Thread Jakub Sitnicki
On Wed, Mar 31, 2021 at 04:32 AM CEST, Cong Wang wrote: > From: Cong Wang > > Currently sockmap calls into each protocol to update the struct > proto and replace it. This certainly won't work when the protocol > is implemented as a module, for example, AF_UNIX. > > Introduce a new ops sk->sk_prot-

[Patch bpf-next v8 10/16] sock: introduce sk->sk_prot->psock_update_sk_prot()

2021-03-30 Thread Cong Wang
From: Cong Wang Currently sockmap calls into each protocol to update the struct proto and replace it. This certainly won't work when the protocol is implemented as a module, for example, AF_UNIX. Introduce a new ops sk->sk_prot->psock_update_sk_prot(), so each protocol can implement its own way