public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: Zi Shen Lim <zlim.lnx@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Alexei Starovoitov <ast@plumgrid.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: filter: move load_pointer() into filter.h
Date: Thu, 03 Jul 2014 10:10:24 +0200	[thread overview]
Message-ID: <53B50FF0.7080901@redhat.com> (raw)
In-Reply-To: <1404373932-10929-1-git-send-email-zlim.lnx@gmail.com>

Hi Zi,

On 07/03/2014 09:52 AM, Zi Shen Lim wrote:
> load_pointer() is already a static inline function.
> Let's move it into filter.h so BPF JIT implementations can reuse this
> function.
>
> Signed-off-by: Zi Shen Lim <zlim.lnx@gmail.com>
> ---
> This patch is based on discussion with Alexei in the context of
> reusing load_pointer for upcoming arm64 BPF JIT compiler. [1]
>
> Compile tested on x86_64 and arm64.
>
> [1] https://lkml.org/lkml/2014/7/3/14
>
>   include/linux/filter.h | 13 +++++++++++++
>   net/core/filter.c      |  9 ---------
>   2 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/include/linux/filter.h b/include/linux/filter.h
> index a7e3c48..2288e31 100644
> --- a/include/linux/filter.h
> +++ b/include/linux/filter.h
> @@ -6,6 +6,7 @@
>
>   #include <linux/atomic.h>
>   #include <linux/compat.h>
> +#include <linux/skbuff.h>
>   #include <linux/workqueue.h>
>   #include <uapi/linux/filter.h>
>
> @@ -406,6 +407,18 @@ static inline u16 bpf_anc_helper(const struct sock_filter *ftest)
>   	}
>   }
>
> +void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb,
> +					   int k, unsigned int size);
> +
> +static inline void *load_pointer(const struct sk_buff *skb, int k,
> +				 unsigned int size, void *buffer)
> +{

Fine by me, but since you're exporting this into a header,
please give this a more specific name, such as bpf_load_pointer(),
for example.

Thanks,

Daniel

  reply	other threads:[~2014-07-03  8:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03  7:52 [PATCH net-next] net: filter: move load_pointer() into filter.h Zi Shen Lim
2014-07-03  8:10 ` Daniel Borkmann [this message]
2014-07-03 14:53   ` Z Lim

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=53B50FF0.7080901@redhat.com \
    --to=dborkman@redhat.com \
    --cc=ast@plumgrid.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=zlim.lnx@gmail.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