From: Daniel Borkmann <dan...@iogearbox.net> Date: Wed, 26 Apr 2017 10:14:42 +0200
> On 04/26/2017 05:42 AM, Alexei Starovoitov wrote: >> That sucks for sparc, of course. I don't have good suggestions for >> workaround other than marking tcphdr as packed :( >> From code efficiency point of view it still will be faster than >> LD_ABS insn. > > Plus, ld_abs would also only work on skbs right now, and would > need JIT support for XDP. But it's also cumbersome to use with > f.e. IPv6, etc, so should not be encouraged, imo. > > One other option for !HAVE_EFFICIENT_UNALIGNED_ACCESS archs could > be to provide a bpf_skb_load_bytes() helper equivalent for XDP, > where you eventually do the memcpy() inside. We could see to inline > the helper itself to optimize it slightly. We have to do something that works transparently and always, regardless of whether HAVE_EFFICIENT_UNALIGNED_ACCESS is in play or not. And no, marking objects with __packed is not the answer. What's happening right now is completely unacceptable.