From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Denis Kirjanov <kda@linux-powerpc.org>
Cc: netdev@vger.kernel.org,
Markos Chandras <markos.chandras@imgtec.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Daniel Borkmann <dborkman@redhat.com>
Subject: Re: [PATCH] net: export pkt_type_offset() helper
Date: Tue, 2 Sep 2014 15:59:27 -0700 [thread overview]
Message-ID: <20140902225926.GA14635@its-macbook-pro.plumgrid.com> (raw)
In-Reply-To: <1409688238-3152-1-git-send-email-kda@linux-powerpc.org>
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@linux-powerpc.org>
> Cc: Markos Chandras <markos.chandras@imgtec.com>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Daniel Borkmann <dborkman@redhat.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?
> 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
next prev parent reply other threads:[~2014-09-02 22:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 20:03 [PATCH] net: export pkt_type_offset() helper Denis Kirjanov
2014-09-02 22:59 ` Alexei Starovoitov [this message]
2014-09-03 6:19 ` Daniel Borkmann
2014-09-03 8:53 ` Denis Kirjanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140902225926.GA14635@its-macbook-pro.plumgrid.com \
--to=alexei.starovoitov@gmail.com \
--cc=dborkman@redhat.com \
--cc=kda@linux-powerpc.org \
--cc=markos.chandras@imgtec.com \
--cc=netdev@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).