From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: Re: [PATCH bpf-next] bpf_load: add map name to load_maps error message Date: Mon, 29 Oct 2018 15:11:36 -0700 Message-ID: References: <1540847681-3273-1-git-send-email-shannon.nelson@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, shannon.lee.nelson@gmail.com To: Shannon Nelson , ast@kernel.org, daniel@iogearbox.net Return-path: Received: from mail-it1-f195.google.com ([209.85.166.195]:35718 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728437AbeJ3HCp (ORCPT ); Tue, 30 Oct 2018 03:02:45 -0400 Received: by mail-it1-f195.google.com with SMTP id p64-v6so11465115itp.0 for ; Mon, 29 Oct 2018 15:12:07 -0700 (PDT) In-Reply-To: <1540847681-3273-1-git-send-email-shannon.nelson@oracle.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 10/29/2018 02:14 PM, Shannon Nelson wrote: > To help when debugging bpf/xdp load issues, have the load_map() > error message include the number and name of the map that > failed. > > Signed-off-by: Shannon Nelson > --- > samples/bpf/bpf_load.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c > index 89161c9..5de0357 100644 > --- a/samples/bpf/bpf_load.c > +++ b/samples/bpf/bpf_load.c > @@ -282,8 +282,8 @@ static int load_maps(struct bpf_map_data *maps, int nr_maps, > numa_node); > } > if (map_fd[i] < 0) { > - printf("failed to create a map: %d %s\n", > - errno, strerror(errno)); > + printf("failed to create map %d (%s): %d %s\n", > + i, maps[i].name, errno, strerror(errno)); > return 1; > } > maps[i].fd = map_fd[i]; > LGTM Acked-by: John Fastabend