netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@plumgrid.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Daniel Borkmann <dborkman@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Kees Cook <keescook@chromium.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	netfilter-devel@vger.kernel.org
Subject: [PATCH v4 net-next 0/5] net: filter: split sk_filter into socket and bpf, cleanup names
Date: Wed, 30 Jul 2014 20:34:11 -0700	[thread overview]
Message-ID: <1406777656-27755-1-git-send-email-ast@plumgrid.com> (raw)

The main goal of the series is to split 'struct sk_filter' into socket and
bpf parts and cleanup names 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;
};
and
struct bpf_prog {
        u32                     jited:1,
                                len:31;
        struct sock_fprog_kern  *orig_prog;
        unsigned int            (*bpf_func)(const struct sk_buff *skb,
                                            const struct bpf_insn *filter);
        union {
                struct sock_filter      insns[0];
                struct bpf_insn         insnsi[0];
                struct work_struct      work;
        };
};
so that 'struct bpf_prog' can be used independent of sockets and cleans up
'unattached' bpf use cases:
isdn, ppp, team, seccomp, ptp, xt_bpf, cls_bpf, test_bpf
which don't need refcnt/rcu fields.

It's a follow up to the rcu cleanup started by Pablo in
commit 34c5bd66e5 ("net: filter: don't release unattached filter through call_rcu()")

Patch 1 - cleans up socket memory charging and makes it possible for functions
  sk(bpf)_migrate_filter(), sk(bpf)_prepare_filter() to be socket independent
Patches 2-4 - trivial renames
Patch 5 - sk_filter split and renames of related sk_*() functions

Alexei Starovoitov (5):
  net: filter: simplify socket charging
  net: filter: rename sk_filter_proglen -> bpf_classic_proglen
  net: filter: rename sk_chk_filter() -> bpf_check_classic()
  net: filter: rename sk_convert_filter() -> bpf_convert_filter()
  net: filter: split 'struct sk_filter' into socket and bpf parts

 Documentation/networking/filter.txt      |   12 +-
 arch/arm/net/bpf_jit_32.c                |    8 +-
 arch/mips/net/bpf_jit.c                  |    8 +-
 arch/powerpc/net/bpf_jit_comp.c          |    8 +-
 arch/s390/net/bpf_jit_comp.c             |    4 +-
 arch/sparc/net/bpf_jit_comp.c            |    4 +-
 arch/x86/net/bpf_jit_comp.c              |   14 +--
 drivers/isdn/i4l/isdn_ppp.c              |   26 ++---
 drivers/net/ppp/ppp_generic.c            |   28 ++---
 drivers/net/team/team_mode_loadbalance.c |   14 +--
 include/linux/filter.h                   |   51 +++++----
 include/linux/isdn_ppp.h                 |    4 +-
 include/uapi/linux/netfilter/xt_bpf.h    |    4 +-
 kernel/bpf/core.c                        |   34 +++---
 kernel/seccomp.c                         |   18 +--
 lib/test_bpf.c                           |   24 ++--
 net/core/filter.c                        |  183 +++++++++++++++---------------
 net/core/ptp_classifier.c                |    6 +-
 net/core/sock.c                          |    9 +-
 net/core/sock_diag.c                     |    4 +-
 net/netfilter/xt_bpf.c                   |    6 +-
 net/sched/cls_bpf.c                      |   12 +-
 22 files changed, 243 insertions(+), 238 deletions(-)

-- 
1.7.9.5

             reply	other threads:[~2014-07-31  3:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31  3:34 Alexei Starovoitov [this message]
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
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=1406777656-27755-1-git-send-email-ast@plumgrid.com \
    --to=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=pablo@netfilter.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).