From: Johannes Berg <johannes@sipsolutions.net>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v2 1/2] bpf: remove struct bpf_prog_type_list
Date: Mon, 10 Apr 2017 07:42:23 +0200 [thread overview]
Message-ID: <1491802943.2455.1.camel@sipsolutions.net> (raw)
In-Reply-To: <20170410022357.GB17150@ast-mbp.thefacebook.com> (sfid-20170410_042404_005156_918EEB46)
> > If you just don't want to list things multiple times how about:
> >
> > linux/bpf_verifiers.h:
> > BPF_VERIFIER(BPF_PROG_TYPE_SOCKET_FILTER, sk_filter_prog_ops)
> > BPF_VERIFIER(BPF_PROG_TYPE_SCHED_CLS, tc_cls_prog_ops)
> > ...
> >
> > Then in bpf.h:
> >
> > #define BPF_VERIFIER(TYPE_VAL, SYM) extern const struct
> > bpf_verifier_ops SYM;
> > #include <linux/bpf_verifiers.h"
> >
> > and in kernel/bpf/syscall.c:
> >
> > #define BPF_VERIFIER(TYPE_VAL, SYM) [TYPE_VAL] = &SYM,
> > #include <linux/bpf_verifiers.h"
> >
> > or something like that.
>
> That is great suggestion! I like it.
It'd doable, but then I need to play with the include guards, like
having "#define __BPF_REINCLUDE" or something like that before
reincluding it, I guess? Unless that file can simply not be included
anywhere?
Maybe I'll play with it - though perhaps it should be named bpf_types.h
or something like that so we don't have to have two files.
johannes
prev parent reply other threads:[~2017-04-10 5:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-07 19:00 [PATCH v2 1/2] bpf: remove struct bpf_prog_type_list Johannes Berg
2017-04-07 19:00 ` [PATCH v2 2/2] bpf: remove struct bpf_map_type_list Johannes Berg
2017-04-07 19:03 ` [PATCH v2 1/2] bpf: remove struct bpf_prog_type_list Johannes Berg
2017-04-10 1:22 ` David Miller
2017-04-10 2:23 ` Alexei Starovoitov
2017-04-10 5:42 ` Johannes Berg [this message]
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=1491802943.2455.1.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=alexei.starovoitov@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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).