linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@plumgrid.com>
To: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: Daniel Borkmann <dborkman@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Ingo Molnar <mingo@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	Jovi Zhangwei <jovi.zhangwei@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Arnaldo Carvalho de Melo <acme@infradead.org>,
	Pekka Enberg <penberg@iki.fi>,
	Arjan van de Ven <arjan@infradead.org>,
	Christoph Hellwig <hch@infradead.org>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Jesse Gross <jesse@nicira.com>
Subject: Re: [PATCH v3 net-next 1/1] bpf32->bpf64 mapper and bpf64 interpreter
Date: Mon, 3 Mar 2014 15:04:28 -0800	[thread overview]
Message-ID: <CAMEtUuxNTB3SKbTeF_JJBMUeWnzfzPphL_cwLXTyxwasEkFe6A@mail.gmail.com> (raw)
In-Reply-To: <20140303100501.GB1108@localhost.localdomain>

On Mon, Mar 3, 2014 at 2:05 AM, Hagen Paul Pfeifer <hagen@jauu.net> wrote:
> * Daniel Borkmann | 2014-03-01 01:30:00 [+0100]:
>
>>>>as in 'struct bpf_insn' the immediate value is 32 bit, so for 64 bit
>>>>comparisons, you'd still need to load to immediate values, right?
>>>
>>>there is no insn that use 64-bit immediate, since 64-bit immediates
>>>are extremely rare. grep x86-64 asm code for movabsq will return very few.
>>>llvm or gcc can easily construct any constant by combination of mov,
>>>shifts and ors.
>>>bpf64 comparisons are all 64-bit right now. So far I didn't see a need to do
>>>32-bit comparison, since old bpf is all unsigned, mapping 32->64 of
>>>Jxx is painless.
>>
>>Hm, fair enough, I was just thinking for comparisons of IPv6 addresses
>>when we do socket filtering. On the other hand, old and new insns are
>>both 64 bit wide and can be used though the same api then.
>
> What about the long term idea to support JITed nftables? A 128 bit immediate
> is required - maybe the biggest requirement for nftable support.

I'm still planning to bring benefits of ebpf-JIT to nft.
There are different ways to approach it. I'm not ready to debate
details, since I
don't have a working code for nft+bpf yet and code speaks better than words.
But I'm confident that ebpf instruction set will not need 128-bit extensions.
If something unforeseen is needed, we can always add it.

Right now I'm testing ebpf+seccomp.
As a micro benchmark I took a test from libseccomp and added dummy
syscall loop. There is a nice speedup. will post a patch soon.

Thanks
Alexei

      reply	other threads:[~2014-03-03 23:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27  2:38 [PATCH v3 net-next 0/1] bpf32->bpf64 mapper and bpf64 interpreter Alexei Starovoitov
2014-02-27  2:38 ` [PATCH v3 net-next 1/1] " Alexei Starovoitov
2014-02-28 12:45   ` Daniel Borkmann
2014-02-28 20:53     ` Alexei Starovoitov
2014-03-01  0:10       ` Alexei Starovoitov
2014-03-01  0:30       ` Daniel Borkmann
2014-03-03 10:05         ` Hagen Paul Pfeifer
2014-03-03 23:04           ` Alexei Starovoitov [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=CAMEtUuxNTB3SKbTeF_JJBMUeWnzfzPphL_cwLXTyxwasEkFe6A@mail.gmail.com \
    --to=ast@plumgrid.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hagen@jauu.net \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=jesse@nicira.com \
    --cc=jovi.zhangwei@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=penberg@iki.fi \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tom.zanussi@linux.intel.com \
    --cc=torvalds@linux-foundation.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).