[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150305.131253.2236103115559186359.davem@davemloft.net>
Date: Thu, 05 Mar 2015 13:12:53 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: kda@...ux-powerpc.org
Cc: msekleta@...hat.com, netdev@...r.kernel.org, ast@...mgrid.com,
jpirko@...hat.com
Subject: Re: [PATCH] filter: introduce SKF_AD_VLAN_PROTO BPF extension
From: Denis Kirjanov <kda@...ux-powerpc.org>
Date: Thu, 5 Mar 2015 11:57:05 +0300
> On 3/4/15, Michal Sekletar <msekleta@...hat.com> wrote:
>> --- a/arch/powerpc/net/bpf_jit_comp.c
>> +++ b/arch/powerpc/net/bpf_jit_comp.c
>> @@ -399,6 +399,11 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32
>> *image,
>> PPC_SRWI(r_A, r_A, 12);
>> }
>> break;
>> + case BPF_ANC | SKF_AD_VLAN_PROTO:
>> + BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_proto) != 2);
>> + PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,
>> + vlan_proto));
> You're going to load a halfword, so lhz has to be used
>
>> + break;
Same bug in the sparc implementation too:
>> @@ -624,6 +624,9 @@ void bpf_jit_compile(struct bpf_prog *fp)
>> emit_and(r_A, r_TMP, r_A);
>> }
>> break;
>> + case BPF_ANC | SKF_AD_VLAN_PROTO:
>> + emit_skb_load32(vlan_proto, r_A);
>> + break;
>> case BPF_LD | BPF_W | BPF_LEN:
>> emit_skb_load32(len, r_A);
>> break;
This needs to use emit_load16().
These JIT changes seem to have been done a little carelessly.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists