Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-03-04 Thread Andrii Nakryiko
On Mon, Mar 4, 2019 at 7:59 AM Daniel Borkmann wrote: > > On 03/04/2019 07:03 AM, Andrii Nakryiko wrote: > > On Thu, Feb 28, 2019 at 3:31 PM Daniel Borkmann > > wrote: > [...] > >> @@ -6664,8 +6669,10 @@ static int replace_map_fd_with_map_ptr(struct > >> bpf_verifier_env *env) > >>

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-03-04 Thread Daniel Borkmann
On 03/04/2019 07:03 AM, Andrii Nakryiko wrote: > On Thu, Feb 28, 2019 at 3:31 PM Daniel Borkmann wrote: [...] >> @@ -6664,8 +6669,10 @@ static int replace_map_fd_with_map_ptr(struct >> bpf_verifier_env *env) >> } >> >> if (insn[0].code == (BPF_LD | BPF_IMM | BPF_DW

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-03-03 Thread Andrii Nakryiko
On Thu, Feb 28, 2019 at 3:31 PM Daniel Borkmann wrote: > > This generic extension to BPF maps allows for directly loading an > address residing inside a BPF map value as a single BPF ldimm64 > instruction. > > The idea is similar to what BPF_PSEUDO_MAP_FD does today, which > is a special src_reg f

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-03-01 Thread Yonghong Song
On 3/1/19 11:51 AM, Daniel Borkmann wrote: > On 03/01/2019 06:18 PM, Yonghong Song wrote: >> On 2/28/19 3:18 PM, Daniel Borkmann wrote: >>> This generic extension to BPF maps allows for directly loading an >>> address residing inside a BPF map value as a single BPF ldimm64 >>> instruction. >>> >>

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-03-01 Thread Jakub Kicinski
On Fri, 1 Mar 2019 11:35:17 -0800, Andrii Nakryiko wrote: > > > Do you think that would work? Using array is a bit limiting, because > > > it doesn't allow to do partial reads/updates, while BPF_MAP_TYPE_HEAP > > > would be single big value that allows partial reading/updating. > > > > If I under

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-03-01 Thread Daniel Borkmann
On 03/01/2019 06:18 PM, Yonghong Song wrote: > On 2/28/19 3:18 PM, Daniel Borkmann wrote: >> This generic extension to BPF maps allows for directly loading an >> address residing inside a BPF map value as a single BPF ldimm64 >> instruction. >> >> The idea is similar to what BPF_PSEUDO_MAP_FD does

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-03-01 Thread Andrii Nakryiko
On Fri, Mar 1, 2019 at 1:49 AM Daniel Borkmann wrote: > > On 03/01/2019 06:46 AM, Andrii Nakryiko wrote: > > On Thu, Feb 28, 2019 at 3:31 PM Daniel Borkmann > > wrote: > >> > >> This generic extension to BPF maps allows for directly loading an > >> address residing inside a BPF map value as a si

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-03-01 Thread Jakub Kicinski
On Fri, 1 Mar 2019 10:49:46 +0100, Daniel Borkmann wrote: > Overall, BPF_PSEUDO_MAP_VALUE felt slightly more suitable to me. FWIW +1 I think different type is way cleaner here.

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-03-01 Thread Jann Horn
On Fri, Mar 1, 2019 at 12:19 AM Daniel Borkmann wrote: > This generic extension to BPF maps allows for directly loading an > address residing inside a BPF map value as a single BPF ldimm64 > instruction. [...] > @@ -6698,16 +6705,44 @@ static int replace_map_fd_with_map_ptr(struct > bpf_verifier_

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-03-01 Thread Yonghong Song
On 2/28/19 3:18 PM, Daniel Borkmann wrote: > This generic extension to BPF maps allows for directly loading an > address residing inside a BPF map value as a single BPF ldimm64 > instruction. > > The idea is similar to what BPF_PSEUDO_MAP_FD does today, which > is a special src_reg flag for ldim

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-03-01 Thread Daniel Borkmann
On 03/01/2019 06:46 AM, Andrii Nakryiko wrote: > On Thu, Feb 28, 2019 at 3:31 PM Daniel Borkmann wrote: >> >> This generic extension to BPF maps allows for directly loading an >> address residing inside a BPF map value as a single BPF ldimm64 >> instruction. > > This is great! I'm going to review

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-02-28 Thread Andrii Nakryiko
On Thu, Feb 28, 2019 at 3:31 PM Daniel Borkmann wrote: > > This generic extension to BPF maps allows for directly loading an > address residing inside a BPF map value as a single BPF ldimm64 > instruction. This is great! I'm going to review code more thoroughly tomorrow, but I also have few quest

Re: [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-02-28 Thread kbuild test robot
Hi Daniel, I love your patch! Perhaps something to improve: [auto build test WARNING on bpf-next/master] url: https://github.com/0day-ci/linux/commits/Daniel-Borkmann/BPF-support-for-global-data/20190301-112203 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master c

[PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access

2019-02-28 Thread Daniel Borkmann
This generic extension to BPF maps allows for directly loading an address residing inside a BPF map value as a single BPF ldimm64 instruction. The idea is similar to what BPF_PSEUDO_MAP_FD does today, which is a special src_reg flag for ldimm64 instruction that indicates that inside the first part