Re: [PATCH v2 bpf-next] selftests/bpf: use __bpf_constant_htons in test_prog.c

2018-12-12 Thread Daniel Borkmann
On 12/12/2018 04:20 AM, Stanislav Fomichev wrote: > For some reason, my older GCC (< 4.8) isn't smart enough to optimize the > !__builtin_constant_p() branch in bpf_htons, I see: > error: implicit declaration of function '__builtin_bswap16' > > Let's use __bpf_constant_htons as suggested by Dani

[PATCH v2 bpf-next] selftests/bpf: use __bpf_constant_htons in test_prog.c

2018-12-11 Thread Stanislav Fomichev
For some reason, my older GCC (< 4.8) isn't smart enough to optimize the !__builtin_constant_p() branch in bpf_htons, I see: error: implicit declaration of function '__builtin_bswap16' Let's use __bpf_constant_htons as suggested by Daniel Borkmann. I tried to use simple htons, but it produces t