netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Alexei Starovoitov <ast@plumgrid.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Daniel Borkmann <dborkman@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	Kees Cook <keescook@chromium.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH v4 net-next 5/5] net: filter: split 'struct sk_filter' into socket and bpf parts
Date: Thu, 31 Jul 2014 21:40:59 +0200	[thread overview]
Message-ID: <20140731194059.GA8681@salvia> (raw)
In-Reply-To: <1406777656-27755-6-git-send-email-ast@plumgrid.com>

On Wed, Jul 30, 2014 at 08:34:16PM -0700, Alexei Starovoitov wrote:
> clean up names related to socket filtering and bpf in the following way:
> - everything that deals with sockets keeps 'sk_*' prefix
> - everything that is pure BPF is changed to 'bpf_*' prefix
> 
> split 'struct sk_filter' into
> struct sk_filter {
> 	atomic_t        refcnt;
> 	struct rcu_head rcu;
> 	struct bpf_prog *prog;
> };

I think you can use 'struct bpf_prog prog' instead so the entire
sk_filter remains in the same memory blob (as it is before this
patch).

You can add an inline function to retrieve the bpg prog from the
filter:

static inline struct bpf_prog *sk_filter_bpf(struct sk_filter *)

and use it whenever possible to fetch the bpf program. I'm suggesting
this because we can use the zero array size in the socket filtering
abstraction later on, if the function above is used, this just needs
one line in that function to be updated to fetch the program from the
placeholder.

  reply	other threads:[~2014-07-31 19:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31  3:34 [PATCH v4 net-next 0/5] net: filter: split sk_filter into socket and bpf, cleanup names Alexei Starovoitov
2014-07-31  3:34 ` [PATCH v4 net-next 1/5] net: filter: simplify socket charging Alexei Starovoitov
2014-07-31  3:34 ` [PATCH v4 net-next 2/5] net: filter: rename sk_filter_proglen -> bpf_classic_proglen Alexei Starovoitov
2014-07-31  3:34 ` [PATCH v4 net-next 3/5] net: filter: rename sk_chk_filter() -> bpf_check_classic() Alexei Starovoitov
2014-07-31  3:34 ` [PATCH v4 net-next 4/5] net: filter: rename sk_convert_filter() -> bpf_convert_filter() Alexei Starovoitov
2014-07-31  3:34 ` [PATCH v4 net-next 5/5] net: filter: split 'struct sk_filter' into socket and bpf parts Alexei Starovoitov
2014-07-31 19:40   ` Pablo Neira Ayuso [this message]
2014-07-31 21:02     ` Alexei Starovoitov
2014-08-01 16:06       ` Pablo Neira Ayuso
2014-08-01 16:50         ` Alexei Starovoitov
2014-08-01 19:03           ` Pablo Neira Ayuso
2014-08-01 19:12             ` Alexei Starovoitov
2014-08-02 22:10               ` David Miller
2014-08-02 22:09 ` [PATCH v4 net-next 0/5] net: filter: split sk_filter into socket and bpf, cleanup names David Miller

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=20140731194059.GA8681@salvia \
    --to=pablo@netfilter.org \
    --cc=ast@plumgrid.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=willemb@google.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).