Re: [PATCH bpf-next 1/5] bpf: Implement task local storage

2020-11-03 Thread KP Singh
[,,,] > > + * > > + * void *bpf_task_storage_get(struct bpf_map *map, void *task, void > > *value, u64 flags) > After peeking patch 2, I think the pointer type should be > "struct task_struct *task" instead of "void *task". > > Same for bpf_task_storage_delete(). Done. Thanks!

Re: [PATCH bpf-next 1/5] bpf: Implement task local storage

2020-11-03 Thread KP Singh
On Fri, Oct 30, 2020 at 11:53 AM KP Singh wrote: > > Thanks for taking a look! > > On Wed, Oct 28, 2020 at 2:13 AM Martin KaFai Lau wrote: > > > > On Tue, Oct 27, 2020 at 06:03:13PM +0100, KP Singh wrote: > > [ ... ] > > > > > diff --git a/kernel/bpf/bpf_task_storage.c

Re: [PATCH bpf-next 1/5] bpf: Implement task local storage

2020-10-30 Thread Song Liu
On Fri, Oct 30, 2020 at 4:07 AM KP Singh wrote: > > " > > On Fri, Oct 30, 2020 at 12:28 AM Song Liu wrote: > > > > On Wed, Oct 28, 2020 at 9:17 AM KP Singh wrote: > > > > > > From: KP Singh > > > > > > Similar to bpf_local_storage for sockets and inodes add local storage > > > for task_struct.

Re: [PATCH bpf-next 1/5] bpf: Implement task local storage

2020-10-30 Thread KP Singh
" On Fri, Oct 30, 2020 at 12:28 AM Song Liu wrote: > > On Wed, Oct 28, 2020 at 9:17 AM KP Singh wrote: > > > > From: KP Singh > > > > Similar to bpf_local_storage for sockets and inodes add local storage > > for task_struct. > > > > The life-cycle of storage is managed with the life-cycle of

Re: [PATCH bpf-next 1/5] bpf: Implement task local storage

2020-10-30 Thread KP Singh
On Fri, Oct 30, 2020 at 12:12 AM Andrii Nakryiko wrote: > > On Wed, Oct 28, 2020 at 9:17 AM KP Singh wrote: > > > > From: KP Singh > > > > Similar to bpf_local_storage for sockets and inodes add local storage > > for task_struct. > > > > The life-cycle of storage is managed with the life-cycle

Re: [PATCH bpf-next 1/5] bpf: Implement task local storage

2020-10-30 Thread KP Singh
Thanks for taking a look! On Wed, Oct 28, 2020 at 2:13 AM Martin KaFai Lau wrote: > > On Tue, Oct 27, 2020 at 06:03:13PM +0100, KP Singh wrote: > [ ... ] > > > diff --git a/kernel/bpf/bpf_task_storage.c b/kernel/bpf/bpf_task_storage.c > > new file mode 100644 > > index ..774140c458cc

Re: [PATCH bpf-next 1/5] bpf: Implement task local storage

2020-10-29 Thread Song Liu
On Wed, Oct 28, 2020 at 9:17 AM KP Singh wrote: > > From: KP Singh > > Similar to bpf_local_storage for sockets and inodes add local storage > for task_struct. > > The life-cycle of storage is managed with the life-cycle of the > task_struct. i.e. the storage is destroyed along with the owning

Re: [PATCH bpf-next 1/5] bpf: Implement task local storage

2020-10-29 Thread Andrii Nakryiko
On Wed, Oct 28, 2020 at 9:17 AM KP Singh wrote: > > From: KP Singh > > Similar to bpf_local_storage for sockets and inodes add local storage > for task_struct. > > The life-cycle of storage is managed with the life-cycle of the > task_struct. i.e. the storage is destroyed along with the owning

Re: [PATCH bpf-next 1/5] bpf: Implement task local storage

2020-10-28 Thread Martin KaFai Lau
On Tue, Oct 27, 2020 at 06:03:13PM +0100, KP Singh wrote: [ ... ] > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h > index e6ceac3f7d62..bb443c4f3637 100644 > --- a/include/uapi/linux/bpf.h > +++ b/include/uapi/linux/bpf.h > @@ -157,6 +157,7 @@ enum bpf_map_type { >

Re: [PATCH bpf-next 1/5] bpf: Implement task local storage

2020-10-28 Thread Martin KaFai Lau
On Tue, Oct 27, 2020 at 06:03:13PM +0100, KP Singh wrote: [ ... ] > diff --git a/kernel/bpf/bpf_task_storage.c b/kernel/bpf/bpf_task_storage.c > new file mode 100644 > index ..774140c458cc > --- /dev/null > +++ b/kernel/bpf/bpf_task_storage.c > @@ -0,0 +1,327 @@ > +//

[PATCH bpf-next 1/5] bpf: Implement task local storage

2020-10-27 Thread KP Singh
From: KP Singh Similar to bpf_local_storage for sockets and inodes add local storage for task_struct. The life-cycle of storage is managed with the life-cycle of the task_struct. i.e. the storage is destroyed along with the owning task with a callback to the bpf_task_storage_free from the