lkml.org 
[lkml]   [2015]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v3 16/37] bpf tools: Collect eBPF programs from their own sections
On 5/18/15 5:47 AM, Wangnan (F) wrote:
>
>
>>> + prog->insns_cnt = size / sizeof(struct bpf_insn);
>>> + memcpy(prog->insns, data,
>>> + prog->insns_cnt * sizeof(struct bpf_insn));
>> Doesn't the data need to be swapped?
>>
>> Thanks,
>> Namhyung
>>
>
> I'm not very sure, since they are instructions. Byte order of
> instructions and byte order of data
> are not always same. Think about ARM. Therefore another choice is to
> swap them in kernel,
> keep user-kernel interface clean.
>
> Alexei Starovoitov, do you think we should use uniformed instruction
> byte order in both big and little
> endian kernel on user-kernel interface, or let userspace feed swapped
> instructions to kernel if
> endianess is not match?

see my reply to the other patch. endianness is the job of llvm.
Let's fix it there.



\
 
 \ /
  Last update: 2015-05-18 21:21    [W:0.096 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site