Fix following swap.cocci warning:
./samples/bpf/xdpsock_user.c:528:22-23:
WARNING opportunity for swap()
Signed-off-by: Yihao Han <redacted>
Erm, did this get applied without anyone actually trying to compile
samples? I'm getting build errors as:
CC /home/build/linux/samples/bpf/xsk_fwd.o
/home/build/linux/samples/bpf/xsk_fwd.c: In function ‘swap_mac_addresses’:
/home/build/linux/samples/bpf/xsk_fwd.c:658:9: warning: implicit declaration of function ‘swap’; did you mean ‘swab’? [-Wimplicit-function-declaration]
658 | swap(*src_addr, *dst_addr);
| ^~~~
| swab
/usr/bin/ld: /home/build/linux/samples/bpf/xsk_fwd.o: in function `thread_func':
xsk_fwd.c:(.text+0x440): undefined reference to `swap'
collect2: error: ld returned 1 exit status
Could we maybe get samples/bpf added to the BPF CI builds? :)
-Toke
On Fri, Dec 10, 2021 at 6:26 AM Toke Høiland-Jørgensen [off-list ref] wrote:
Yihao Han [off-list ref] writes:
quoted
Fix following swap.cocci warning:
./samples/bpf/xdpsock_user.c:528:22-23:
WARNING opportunity for swap()
Signed-off-by: Yihao Han <redacted>
Erm, did this get applied without anyone actually trying to compile
samples? I'm getting build errors as:
Good news: I actually do build samples/bpf nowadays after fixing a
bunch of compilation issues recently.
Bad news: seems like I didn't pay too much attention after building
samples/bpf for this particular patch, sorry about that. I've dropped
this patch, samples/bpf builds for me. We should be good now.
CC /home/build/linux/samples/bpf/xsk_fwd.o
/home/build/linux/samples/bpf/xsk_fwd.c: In function ‘swap_mac_addresses’:
/home/build/linux/samples/bpf/xsk_fwd.c:658:9: warning: implicit declaration of function ‘swap’; did you mean ‘swab’? [-Wimplicit-function-declaration]
658 | swap(*src_addr, *dst_addr);
| ^~~~
| swab
/usr/bin/ld: /home/build/linux/samples/bpf/xsk_fwd.o: in function `thread_func':
xsk_fwd.c:(.text+0x440): undefined reference to `swap'
collect2: error: ld returned 1 exit status
Could we maybe get samples/bpf added to the BPF CI builds? :)
Maybe we could, if someone dedicated their effort towards making this happen.
On Fri, Dec 10, 2021 at 6:26 AM Toke Høiland-Jørgensen [off-list ref] wrote:
quoted
Yihao Han [off-list ref] writes:
quoted
Fix following swap.cocci warning:
./samples/bpf/xdpsock_user.c:528:22-23:
WARNING opportunity for swap()
Signed-off-by: Yihao Han <redacted>
Erm, did this get applied without anyone actually trying to compile
samples? I'm getting build errors as:
Good news: I actually do build samples/bpf nowadays after fixing a
bunch of compilation issues recently.
Awesome!
Bad news: seems like I didn't pay too much attention after building
samples/bpf for this particular patch, sorry about that. I've dropped
this patch, samples/bpf builds for me. We should be good now.
Yup, looks good, thanks!
quoted
CC /home/build/linux/samples/bpf/xsk_fwd.o
/home/build/linux/samples/bpf/xsk_fwd.c: In function ‘swap_mac_addresses’:
/home/build/linux/samples/bpf/xsk_fwd.c:658:9: warning: implicit declaration of function ‘swap’; did you mean ‘swab’? [-Wimplicit-function-declaration]
658 | swap(*src_addr, *dst_addr);
| ^~~~
| swab
/usr/bin/ld: /home/build/linux/samples/bpf/xsk_fwd.o: in function `thread_func':
xsk_fwd.c:(.text+0x440): undefined reference to `swap'
collect2: error: ld returned 1 exit status
Could we maybe get samples/bpf added to the BPF CI builds? :)
Maybe we could, if someone dedicated their effort towards making this
happen.
On Sat, Dec 11, 2021 at 10:07 AM Toke Høiland-Jørgensen [off-list ref] wrote:
Andrii Nakryiko [off-list ref] writes:
quoted
On Fri, Dec 10, 2021 at 6:26 AM Toke Høiland-Jørgensen [off-list ref] wrote:
quoted
Yihao Han [off-list ref] writes:
quoted
Fix following swap.cocci warning:
./samples/bpf/xdpsock_user.c:528:22-23:
WARNING opportunity for swap()
Signed-off-by: Yihao Han <redacted>
Erm, did this get applied without anyone actually trying to compile
samples? I'm getting build errors as:
Good news: I actually do build samples/bpf nowadays after fixing a
bunch of compilation issues recently.
Awesome!
quoted
Bad news: seems like I didn't pay too much attention after building
samples/bpf for this particular patch, sorry about that. I've dropped
this patch, samples/bpf builds for me. We should be good now.
Yup, looks good, thanks!
quoted
quoted
CC /home/build/linux/samples/bpf/xsk_fwd.o
/home/build/linux/samples/bpf/xsk_fwd.c: In function ‘swap_mac_addresses’:
/home/build/linux/samples/bpf/xsk_fwd.c:658:9: warning: implicit declaration of function ‘swap’; did you mean ‘swab’? [-Wimplicit-function-declaration]
658 | swap(*src_addr, *dst_addr);
| ^~~~
| swab
/usr/bin/ld: /home/build/linux/samples/bpf/xsk_fwd.o: in function `thread_func':
xsk_fwd.c:(.text+0x440): undefined reference to `swap'
collect2: error: ld returned 1 exit status
Could we maybe get samples/bpf added to the BPF CI builds? :)
Maybe we could, if someone dedicated their effort towards making this
happen.
I think the right way would be to build samples/bpf from
selftests/bpf's Makefile. At the very least we should not require make
headers_install (I never understood that with samples/bpf, all those
up-to-date UAPI headers are right there in the same repo). Once that
is done, at the very least we'll build tests samples/bpf during CI
runs.
On Sat, Dec 11, 2021 at 10:07 AM Toke Høiland-Jørgensen [off-list ref] wrote:
quoted
Andrii Nakryiko [off-list ref] writes:
quoted
On Fri, Dec 10, 2021 at 6:26 AM Toke Høiland-Jørgensen [off-list ref] wrote:
quoted
Yihao Han [off-list ref] writes:
quoted
Fix following swap.cocci warning:
./samples/bpf/xdpsock_user.c:528:22-23:
WARNING opportunity for swap()
Signed-off-by: Yihao Han <redacted>
Erm, did this get applied without anyone actually trying to compile
samples? I'm getting build errors as:
Good news: I actually do build samples/bpf nowadays after fixing a
bunch of compilation issues recently.
Awesome!
quoted
Bad news: seems like I didn't pay too much attention after building
samples/bpf for this particular patch, sorry about that. I've dropped
this patch, samples/bpf builds for me. We should be good now.
Yup, looks good, thanks!
quoted
quoted
CC /home/build/linux/samples/bpf/xsk_fwd.o
/home/build/linux/samples/bpf/xsk_fwd.c: In function ‘swap_mac_addresses’:
/home/build/linux/samples/bpf/xsk_fwd.c:658:9: warning: implicit declaration of function ‘swap’; did you mean ‘swab’? [-Wimplicit-function-declaration]
658 | swap(*src_addr, *dst_addr);
| ^~~~
| swab
/usr/bin/ld: /home/build/linux/samples/bpf/xsk_fwd.o: in function `thread_func':
xsk_fwd.c:(.text+0x440): undefined reference to `swap'
collect2: error: ld returned 1 exit status
Could we maybe get samples/bpf added to the BPF CI builds? :)
Maybe we could, if someone dedicated their effort towards making this
happen.
I think the right way would be to build samples/bpf from
selftests/bpf's Makefile. At the very least we should not require make
headers_install (I never understood that with samples/bpf, all those
up-to-date UAPI headers are right there in the same repo). Once that
is done, at the very least we'll build tests samples/bpf during CI
runs.
Alright, sounds fair. I'll look into that, but probably before the
holidays :)
-Toke