Re: [PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-08 Thread Martin Lau
On Thu, Aug 08, 2019 at 08:28:30AM -0700, Stanislav Fomichev wrote: > On 08/08, Martin Lau wrote: > > On Wed, Aug 07, 2019 at 08:47:18AM -0700, Stanislav Fomichev wrote: > > > Add new helper bpf_sk_storage_clone which optionally clones sk storage > > > and call it from bpf_sk_storage_clone. Reuse t

Re: [PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-08 Thread Stanislav Fomichev
On 08/08, Martin Lau wrote: > On Wed, Aug 07, 2019 at 08:47:18AM -0700, Stanislav Fomichev wrote: > > Add new helper bpf_sk_storage_clone which optionally clones sk storage > > and call it from bpf_sk_storage_clone. Reuse the gap in > > bpf_sk_storage_elem to store clone/non-clone flag. > > > > Cc

Re: [PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-08 Thread Martin Lau
On Wed, Aug 07, 2019 at 05:05:33PM -0700, Stanislav Fomichev wrote: [ ... ] > > > +int bpf_sk_storage_clone(const struct sock *sk, struct sock *newsk) > > > +{ > > > + struct bpf_sk_storage *new_sk_storage = NULL; > > > + struct bpf_sk_storage *sk_storage; > > > + struct bpf_sk_storage_elem *selem;

Re: [PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-07 Thread Martin Lau
On Wed, Aug 07, 2019 at 08:47:18AM -0700, Stanislav Fomichev wrote: > Add new helper bpf_sk_storage_clone which optionally clones sk storage > and call it from bpf_sk_storage_clone. Reuse the gap in > bpf_sk_storage_elem to store clone/non-clone flag. > > Cc: Martin KaFai Lau > Signed-off-by: Sta

Re: [PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-07 Thread Yonghong Song
On 8/7/19 5:05 PM, Stanislav Fomichev wrote: > On 08/07, Yonghong Song wrote: >> >> >> On 8/7/19 8:47 AM, Stanislav Fomichev wrote: >>> Add new helper bpf_sk_storage_clone which optionally clones sk storage >>> and call it from bpf_sk_storage_clone. Reuse the gap in >>> bpf_sk_storage_elem to sto

Re: [PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-07 Thread Stanislav Fomichev
On 08/07, Yonghong Song wrote: > > > On 8/7/19 8:47 AM, Stanislav Fomichev wrote: > > Add new helper bpf_sk_storage_clone which optionally clones sk storage > > and call it from bpf_sk_storage_clone. Reuse the gap in > > bpf_sk_storage_elem to store clone/non-clone flag. > > > > Cc: Martin KaFai

Re: [PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-07 Thread Yonghong Song
On 8/7/19 8:47 AM, Stanislav Fomichev wrote: > Add new helper bpf_sk_storage_clone which optionally clones sk storage > and call it from bpf_sk_storage_clone. Reuse the gap in > bpf_sk_storage_elem to store clone/non-clone flag. > > Cc: Martin KaFai Lau > Signed-off-by: Stanislav Fomichev I t

[PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-07 Thread Stanislav Fomichev
Add new helper bpf_sk_storage_clone which optionally clones sk storage and call it from bpf_sk_storage_clone. Reuse the gap in bpf_sk_storage_elem to store clone/non-clone flag. Cc: Martin KaFai Lau Signed-off-by: Stanislav Fomichev --- include/net/bpf_sk_storage.h | 10 include/uapi/linu