[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190411133151.260e0556@cakuba.netronome.com>
Date: Thu, 11 Apr 2019 13:31:51 -0700
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Benjamin Poirier <bpoirier@...e.com>
Cc: Daniel Borkmann <daniel@...earbox.net>, netdev@...r.kernel.org,
bpf@...r.kernel.org
Subject: Re: [PATCH bpf-next] bpftool: Exit early when it's not possible to
dump a REUSEPORT_SOCKARRAY map
On Thu, 11 Apr 2019 17:27:00 +0900, Benjamin Poirier wrote:
> avoids outputting a series of
> value:
> No space left on device
>
> The value itself is not wrong but bpf_fd_reuseport_array_lookup_elem() can
> only return it if the map was created with value_size = 8. There's nothing
> bpftool can do about it. Instead of repeating this error for every key in
> the map, print the error once, print an explanatory message and exit.
>
> Signed-off-by: Benjamin Poirier <bpoirier@...e.com>
> @@ -787,7 +787,16 @@ static int do_dump(int argc, char **argv)
> err = 0;
> break;
> }
> - num_elems += dump_map_elem(fd, key, value, &info, btf, btf_wtr);
> + err = dump_map_elem(fd, key, value, &info, btf, btf_wtr);
> + /* bpf_fd_reuseport_array_lookup_elem() can only return a
> + * value if the map's value_size == 8
> + */
> + if (info.type == BPF_MAP_TYPE_REUSEPORT_SOCKARRAY &&
> + info.value_size != 8 && err == -ENOSPC) {
> + p_err("cannot dump REUSEPORT_SOCKARRAY map with value_size != 8");
> + goto exit_free;
Hmm... could it still be useful to walk the map to see the keys, even
if the kernel can't return meaningful values?
> + }
> + num_elems += err;
> prev_key = key;
> }
>
Powered by blists - more mailing lists