Skip to contentSkip to conversation

bpf is broken in net-next

BUG Stephen Hemminger 2 participants 3 messages Oct 1, 2017 – Oct 2, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Recent regression in net-next building bpf.c in samples/bpf now broken.

$ make samples/bpf/

HOSTCC samples/bpf/../../tools/lib/bpf/bpf.o
samples/bpf/../../tools/lib/bpf/bpf.c: In function ‘bpf_create_map_node’:
samples/bpf/../../tools/lib/bpf/bpf.c:76:13: error: ‘union bpf_attr’ has no member named ‘map_name’; did you mean ‘map_type’?

  memcpy(attr.map_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1));
             ^
samples/bpf/../../tools/lib/bpf/bpf.c:76:44: error: ‘BPF_OBJ_NAME_LEN’ undeclared (first use in this function)
  memcpy(attr.map_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1));
                                            ^
samples/bpf/../../tools/lib/bpf/bpf.c:49:27: note: in definition of macro ‘min’
 #define min(x, y) ((x) < (y) ? (x) : (y))
                           ^
samples/bpf/../../tools/lib/bpf/bpf.c:76:44: note: each undeclared identifier is reported only once for each function it appears in
  memcpy(attr.map_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1));
                                            ^
samples/bpf/../../tools/lib/bpf/bpf.c:49:27: note: in definition of macro ‘min’
 #define min(x, y) ((x) < (y) ? (x) : (y))
                           ^
samples/bpf/../../tools/lib/bpf/bpf.c: In function ‘bpf_create_map_in_map_node’:
samples/bpf/../../tools/lib/bpf/bpf.c:116:13: error: ‘union bpf_attr’ has no member named ‘map_name’; did you mean ‘map_type’?
  memcpy(attr.map_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1));
             ^
samples/bpf/../../tools/lib/bpf/bpf.c:116:44: error: ‘BPF_OBJ_NAME_LEN’ undeclared (first use in this function)
  memcpy(attr.map_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1));
                                            ^
samples/bpf/../../tools/lib/bpf/bpf.c:49:27: note: in definition of macro ‘min’
 #define min(x, y) ((x) < (y) ? (x) : (y))
                           ^
samples/bpf/../../tools/lib/bpf/bpf.c: In function ‘bpf_load_program_name’:
samples/bpf/../../tools/lib/bpf/bpf.c:154:13: error: ‘union bpf_attr’ has no member named ‘prog_name’; did you mean ‘prog_type’?
  memcpy(attr.prog_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1));
             ^
samples/bpf/../../tools/lib/bpf/bpf.c:154:45: error: ‘BPF_OBJ_NAME_LEN’ undeclared (first use in this function)
  memcpy(attr.prog_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1));
                                             ^
samples/bpf/../../tools/lib/bpf/bpf.c:49:27: note: in definition of macro ‘min’
 #define min(x, y) ((x) < (y) ? (x) : (y))
                           ^

scripts/Makefile.host:118: recipe for target 'samples/bpf/../../tools/lib/bpf/bpf.o' failed

#1 lore raw
Quoted 5 lines · Stephen Hemminger

Recent regression in net-next building bpf.c in samples/bpf now broken.

$ make samples/bpf/
Quoted 7 lines

HOSTCC samples/bpf/../../tools/lib/bpf/bpf.o
samples/bpf/../../tools/lib/bpf/bpf.c: In function ‘bpf_create_map_node’:
samples/bpf/../../tools/lib/bpf/bpf.c:76:13: error: ‘union bpf_attr’ has no member named ‘map_name’; did you mean ‘map_type’?

  memcpy(attr.map_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1));
             ^

samples/bpf/../../tools/lib/bpf/bpf.c:76:44: error: ‘BPF_OBJ_NAME_LEN’ undeclared (first use in this function)
memcpy(attr.map_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1));

everything works fine for me...
did you do 'make headers_install' ?

#2 lore raw
Quoted 14 lines · On Sun, 1 Oct 2017 18:34:25 -0700 Alexei Starovoitov…
Quoted 5 lines · Stephen Hemminger

Recent regression in net-next building bpf.c in samples/bpf now broken.

$ make samples/bpf/
Quoted 7 lines

HOSTCC samples/bpf/../../tools/lib/bpf/bpf.o
samples/bpf/../../tools/lib/bpf/bpf.c: In function ‘bpf_create_map_node’:
samples/bpf/../../tools/lib/bpf/bpf.c:76:13: error: ‘union bpf_attr’ has no member named ‘map_name’; did you mean ‘map_type’?

  memcpy(attr.map_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1));
             ^

samples/bpf/../../tools/lib/bpf/bpf.c:76:44: error: ‘BPF_OBJ_NAME_LEN’ undeclared (first use in this function)
memcpy(attr.map_name, name, min(name_len, BPF_OBJ_NAME_LEN - 1));

Quoted 3 lines

everything works fine for me...
did you do 'make headers_install' ?

Yes, that was the problem. I had done make mrproper after changing branches.