Netdev List
 help / color / mirror / Atom feed
From: Shannon Nelson <shannon.nelson@oracle.com>
To: ast@kernel.org, daniel@iogearbox.net
Cc: netdev@vger.kernel.org, shannon.lee.nelson@gmail.com
Subject: [PATCH bpf-next] bpf_load: add map name to load_maps error message
Date: Mon, 29 Oct 2018 14:14:41 -0700	[thread overview]
Message-ID: <1540847681-3273-1-git-send-email-shannon.nelson@oracle.com> (raw)

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 <shannon.nelson@oracle.com>
---
 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];
-- 
2.7.4

             reply	other threads:[~2018-10-30  6:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 21:14 Shannon Nelson [this message]
2018-10-29 22:11 ` [PATCH bpf-next] bpf_load: add map name to load_maps error message John Fastabend
2018-11-07  0:26   ` Song Liu
2018-11-07 21:41     ` Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1540847681-3273-1-git-send-email-shannon.nelson@oracle.com \
    --to=shannon.nelson@oracle.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=shannon.lee.nelson@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox