lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHj3AVmY1cL6r78LjEs-fwYzz+dvy5BJCCcAedcMd4KsYt0nCQ@mail.gmail.com>
Date:	Wed, 3 Sep 2014 12:53:48 +0400
From:	Denis Kirjanov <kirjanov@...il.com>
To:	Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:	Denis Kirjanov <kda@...ux-powerpc.org>, netdev@...r.kernel.org,
	Markos Chandras <markos.chandras@...tec.com>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Daniel Borkmann <dborkman@...hat.com>
Subject: Re: [PATCH] net: export pkt_type_offset() helper

On 9/3/14, Alexei Starovoitov <alexei.starovoitov@...il.com> wrote:
> On Wed, Sep 03, 2014 at 12:03:58AM +0400, Denis Kirjanov wrote:
>> Currently we have 2 pkt_type_offset functions doing
>> the same thing and spread across the architecture files.
>> Let's use the generic helper routine.
>
> that would be good cleanup.
> Please tag your subject as '[PATCH net-next]...'
>
>> Signed-off-by: Denis Kirjanov <kda@...ux-powerpc.org>
>> Cc: Markos Chandras <markos.chandras@...tec.com>
>> Cc: Martin Schwidefsky <schwidefsky@...ibm.com>
>> Cc: Daniel Borkmann <dborkman@...hat.com>
>> ---
>>  arch/mips/net/bpf_jit.c      | 21 ---------------------
>>  arch/s390/net/bpf_jit_comp.c | 38 ++++----------------------------------
>>  include/linux/filter.h       |  7 +++++++
>>  net/core/filter.c            |  7 +------
>>  4 files changed, 12 insertions(+), 61 deletions(-)
>>
>> diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
>> -#define PKT_TYPE_MAX 0xe0
>> -static int pkt_type_offset;
> ...
>> -}
>> -device_initcall(bpf_pkt_type_offset_init);
>
> may be make sense to optimize common case via initcall() as well
> instead of dropping it for s390?

Yeah, it's a better option.
>
>> diff --git a/include/linux/filter.h b/include/linux/filter.h
>> index a5227ab..97e0549 100644
>> --- a/include/linux/filter.h
>> +++ b/include/linux/filter.h
>> @@ -424,6 +424,13 @@ static inline void *bpf_load_pointer(const struct
>> sk_buff *skb, int k,
>>  	return bpf_internal_load_pointer_neg_helper(skb, k, size);
>>  }
>>
>> +#ifdef __BIG_ENDIAN_BITFIELD
>> +#define PKT_TYPE_MAX	(7 << 5)
>> +#else
>> +#define PKT_TYPE_MAX    7
>> +#endif
>
> these defines don't need to move. keep them in filter.c

I'll respin. Thanks!
>
> --
> 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
>


-- 
Regards,
Denis
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ