aboutsummaryrefslogtreecommitdiffstats
path: root/samples/bpf
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@fb.com>2016-03-08 00:57:18 -0500
committerDavid S. Miller <davem@davemloft.net>2016-03-08 15:28:32 -0500
commit618ec9a7b1fda46f8dd4a630ded983aeb51218f3 (patch)
treeffdc7512a4aa08cd313c2143a509ff3d6678d671 /samples/bpf
parent557c0c6e7df8e14a46bd7560d193fa5bbc00a858 (diff)
samples/bpf: make map creation more verbose
map creation is typically the first one to fail when rlimits are too low, not enough memory, etc Make this failure scenario more verbose Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf')
-rw-r--r--samples/bpf/bpf_load.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
index da86a8e0a95a..816bca5760a0 100644
--- a/samples/bpf/bpf_load.c
+++ b/samples/bpf/bpf_load.c
@@ -158,8 +158,11 @@ static int load_maps(struct bpf_map_def *maps, int len)
158 maps[i].key_size, 158 maps[i].key_size,
159 maps[i].value_size, 159 maps[i].value_size,
160 maps[i].max_entries); 160 maps[i].max_entries);
161 if (map_fd[i] < 0) 161 if (map_fd[i] < 0) {
162 printf("failed to create a map: %d %s\n",
163 errno, strerror(errno));
162 return 1; 164 return 1;
165 }
163 166
164 if (maps[i].type == BPF_MAP_TYPE_PROG_ARRAY) 167 if (maps[i].type == BPF_MAP_TYPE_PROG_ARRAY)
165 prog_array_fd = map_fd[i]; 168 prog_array_fd = map_fd[i];