Re: [PATCH bpf] bpf: fix bpffs non-array map seq_show issue

2018-08-09 Thread Daniel Borkmann
On 08/09/2018 07:54 PM, Yonghong Song wrote: > On 8/9/18 10:02 AM, Daniel Borkmann wrote: >> On 08/09/2018 06:55 PM, Yonghong Song wrote: >>> On 8/9/18 8:59 AM, Daniel Borkmann wrote: On 08/09/2018 05:15 PM, Yonghong Song wrote: > On 8/9/18 7:24 AM, Daniel Borkmann wrote: >> On 08/09/2

Re: [PATCH bpf] bpf: fix bpffs non-array map seq_show issue

2018-08-09 Thread Yonghong Song
On 8/9/18 10:02 AM, Daniel Borkmann wrote: On 08/09/2018 06:55 PM, Yonghong Song wrote: On 8/9/18 8:59 AM, Daniel Borkmann wrote: On 08/09/2018 05:15 PM, Yonghong Song wrote: On 8/9/18 7:24 AM, Daniel Borkmann wrote: On 08/09/2018 05:55 AM, Yonghong Song wrote: On 8/8/18 7:25 PM, Alexei S

Re: [PATCH bpf] bpf: fix bpffs non-array map seq_show issue

2018-08-09 Thread Daniel Borkmann
On 08/09/2018 06:55 PM, Yonghong Song wrote: > On 8/9/18 8:59 AM, Daniel Borkmann wrote: >> On 08/09/2018 05:15 PM, Yonghong Song wrote: >>> On 8/9/18 7:24 AM, Daniel Borkmann wrote: On 08/09/2018 05:55 AM, Yonghong Song wrote: > On 8/8/18 7:25 PM, Alexei Starovoitov wrote: >> On Wed,

Re: [PATCH bpf] bpf: fix bpffs non-array map seq_show issue

2018-08-09 Thread Yonghong Song
On 8/9/18 8:59 AM, Daniel Borkmann wrote: On 08/09/2018 05:15 PM, Yonghong Song wrote: On 8/9/18 7:24 AM, Daniel Borkmann wrote: On 08/09/2018 05:55 AM, Yonghong Song wrote: On 8/8/18 7:25 PM, Alexei Starovoitov wrote: On Wed, Aug 08, 2018 at 06:25:19PM -0700, Yonghong Song wrote: In func

Re: [PATCH bpf] bpf: fix bpffs non-array map seq_show issue

2018-08-09 Thread Daniel Borkmann
On 08/09/2018 05:15 PM, Yonghong Song wrote: > On 8/9/18 7:24 AM, Daniel Borkmann wrote: >> On 08/09/2018 05:55 AM, Yonghong Song wrote: >>> On 8/8/18 7:25 PM, Alexei Starovoitov wrote: On Wed, Aug 08, 2018 at 06:25:19PM -0700, Yonghong Song wrote: > In function map_seq_next() of kernel/bp

Re: [PATCH bpf] bpf: fix bpffs non-array map seq_show issue

2018-08-09 Thread Yonghong Song
On 8/9/18 7:24 AM, Daniel Borkmann wrote: On 08/09/2018 05:55 AM, Yonghong Song wrote: On 8/8/18 7:25 PM, Alexei Starovoitov wrote: On Wed, Aug 08, 2018 at 06:25:19PM -0700, Yonghong Song wrote: In function map_seq_next() of kernel/bpf/inode.c, the first key will be the "0" regardless of th

Re: [PATCH bpf] bpf: fix bpffs non-array map seq_show issue

2018-08-09 Thread Daniel Borkmann
On 08/09/2018 05:55 AM, Yonghong Song wrote: > On 8/8/18 7:25 PM, Alexei Starovoitov wrote: >> On Wed, Aug 08, 2018 at 06:25:19PM -0700, Yonghong Song wrote: >>> In function map_seq_next() of kernel/bpf/inode.c, >>> the first key will be the "0" regardless of the map type. >>> This works for array.

Re: [PATCH bpf] bpf: fix bpffs non-array map seq_show issue

2018-08-08 Thread Yonghong Song
On 8/8/18 7:25 PM, Alexei Starovoitov wrote: On Wed, Aug 08, 2018 at 06:25:19PM -0700, Yonghong Song wrote: In function map_seq_next() of kernel/bpf/inode.c, the first key will be the "0" regardless of the map type. This works for array. But for hash type, if it happens key "0" is in the map,

Re: [PATCH bpf] bpf: fix bpffs non-array map seq_show issue

2018-08-08 Thread Alexei Starovoitov
On Wed, Aug 08, 2018 at 06:25:19PM -0700, Yonghong Song wrote: > In function map_seq_next() of kernel/bpf/inode.c, > the first key will be the "0" regardless of the map type. > This works for array. But for hash type, if it happens > key "0" is in the map, the bpffs map show will miss > some items

[PATCH bpf] bpf: fix bpffs non-array map seq_show issue

2018-08-08 Thread Yonghong Song
In function map_seq_next() of kernel/bpf/inode.c, the first key will be the "0" regardless of the map type. This works for array. But for hash type, if it happens key "0" is in the map, the bpffs map show will miss some items if the key "0" is not the first element of the first bucket. This patch