All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: David Miller <davem@davemloft.net>
Cc: ast@fb.com, holzheu@linux.vnet.ibm.com,
	naveen.n.rao@linux.vnet.ibm.com, jakub.kicinski@netronome.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next 1/9] bpf: add BPF_J{LT,LE,SLT,SLE} instructions
Date: Wed, 09 Aug 2017 22:32:34 +0200	[thread overview]
Message-ID: <598B7162.90509@iogearbox.net> (raw)
In-Reply-To: <20170809.110128.709552645127117641.davem@davemloft.net>

On 08/09/2017 08:01 PM, David Miller wrote:
> From: Daniel Borkmann <daniel@iogearbox.net>
> Date: Wed, 09 Aug 2017 19:00:58 +0200
>
>> On 08/09/2017 06:55 PM, David Miller wrote:
>>> From: Daniel Borkmann <daniel@iogearbox.net>
>>> Date: Wed,  9 Aug 2017 12:23:53 +0200
>>>
>>>>     [1] https://github.com/borkmann/llvm/tree/bpf-insns
>>>
>>> How is this "backwards compatible"?
>>>
>>> If someone takes a new LLVM and tries to load those programs
>>> into an older kernel they will be rejected.
>>>
>>> There appears to be no effort to make things work cleanly in
>>> that situation at all.
>>
>> No, that was just the patch I used for LLVM to enable the
>> insns, so not the final one that will be submitted there
>> officially where we have a switch to enable/disable this
>> functionality.
>
> So how does this switch work and how are people expected to use this
> switch?  What is the default value and is it ever expected to change
> in the future?
>
> Yeah this seems hella awesome to get cilium programs smaller and
> faster in a restricted environment where you control the running
> kernel and everything.

For the case of cilium, we are not in control of the kernel, by
the way, we run a few probes that are small BPF insns snippets
that test the kernel for presence of certain features (e.g. helper,
verifier, maps) and enable/disable them accordingly later in the
code generation. On the user space side, we're indeed a bit more
flexible and have no such restriction.

Plan is for LLVM as one of the frontends that generate byte code
(ply, for example, can probe the kernel directly for its code
generation) to have i) a target specific option to offer a
possibility to explicitly enable the extension by the user (as we
have with -m target specific extensions today for various cpu
insns), and ii) have the kernel check for presence of the extensions
and enable it transparently when the user selects more aggressive
options such as -march=native in a bpf target context, so we can
select the underlying features transparently. I should have made
that more clear earlier, sorry about that.

Thanks,
Daniel

  reply	other threads:[~2017-08-09 20:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09 10:23 [PATCH net-next 0/9] Add BPF_J{LT,LE,SLT,SLE} instructions Daniel Borkmann
2017-08-09 10:23 ` [PATCH net-next 1/9] bpf: add " Daniel Borkmann
2017-08-09 16:55   ` David Miller
2017-08-09 17:00     ` Daniel Borkmann
2017-08-09 17:03       ` Daniel Borkmann
2017-08-09 18:01       ` David Miller
2017-08-09 20:32         ` Daniel Borkmann [this message]
2017-08-09 21:26           ` David Miller
2017-08-09 21:29             ` Daniel Borkmann
2017-08-09 10:23 ` [PATCH net-next 2/9] bpf, x86: implement jiting of BPF_J{LT,LE,SLT,SLE} Daniel Borkmann
2017-08-09 10:23 ` [PATCH net-next 3/9] bpf, arm64: " Daniel Borkmann
2017-08-09 10:23 ` [PATCH net-next 4/9] bpf, sparc64: " Daniel Borkmann
2017-08-09 10:23 ` [PATCH net-next 5/9] bpf, s390x: " Daniel Borkmann
2017-08-09 10:23 ` [PATCH net-next 6/9] bpf, ppc64: " Daniel Borkmann
2017-08-09 10:23 ` [PATCH net-next 7/9] bpf, nfp: implement jiting of BPF_J{LT,LE} Daniel Borkmann
2017-08-09 10:24 ` [PATCH net-next 8/9] bpf: enable BPF_J{LT,LE,SLT,SLE} opcodes in verifier Daniel Borkmann
2017-08-09 10:24 ` [PATCH net-next 9/9] bpf: add test cases for new BPF_J{LT,LE,SLT,SLE} instructions Daniel Borkmann

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=598B7162.90509@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@fb.com \
    --cc=davem@davemloft.net \
    --cc=holzheu@linux.vnet.ibm.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.