Re: more test_progs...

2017-04-26 Thread David Miller
From: Alexei Starovoitov Date: Wed, 26 Apr 2017 16:49:35 -0700 > It's only needed for test_pkt_access.c test, > since it's being fancy and doing iph->ihl * 4. It is going to be a common idiom in anything looking at transport headers, no? > Also such tcp->urg_ptr access into packed struct is mor

Re: more test_progs...

2017-04-26 Thread Alexei Starovoitov
On 4/26/17 7:55 AM, David Miller wrote: From: Daniel Borkmann 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 poin

Re: more test_progs...

2017-04-26 Thread David Miller
From: Daniel Borkmann 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

Re: more test_progs...

2017-04-26 Thread Daniel Borkmann
On 04/26/2017 05:42 AM, Alexei Starovoitov wrote: On 4/25/17 9:52 AM, David Miller wrote: 10: (15) if r3 == 0xdd86 goto pc+9 R0=imm2,min_value=2,max_value=2 R1=pkt(id=0,off=0,r=14) R2=pkt_end R3=inv R4=pkt(id=0,off=14,r=14) R5=inv56 R10=fp Hmmm, endianness looks wrong here. "-target bpf" de

Re: more test_progs...

2017-04-25 Thread Alexei Starovoitov
On 4/25/17 9:52 AM, David Miller wrote: 10: (15) if r3 == 0xdd86 goto pc+9 R0=imm2,min_value=2,max_value=2 R1=pkt(id=0,off=0,r=14) R2=pkt_end R3=inv R4=pkt(id=0,off=14,r=14) R5=inv56 R10=fp Hmmm, endianness looks wrong here. "-target bpf" defaults to the endianness of whatever cpu that llvm

Re: more test_progs...

2017-04-25 Thread Daniel Borkmann
On 04/25/2017 06:52 PM, David Miller wrote: [...] Load eth->h_proto 10: (15) if r3 == 0xdd86 goto pc+9 R0=imm2,min_value=2,max_value=2 R1=pkt(id=0,off=0,r=14) R2=pkt_end R3=inv R4=pkt(id=0,off=14,r=14) R5=inv56 R10=fp Hmmm, endianness looks wrong here. "-target bpf" defaults to the endianne

more test_progs...

2017-04-25 Thread David Miller
I'm trying to get test_progs working in net-next on sparc, it can't even load the first BPF program. It's triggering this verifier check: static int check_pkt_ptr_alignment(const struct bpf_reg_state *reg, int off, int size) { if (reg->id && size != 1)