netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hagen Paul Pfeifer <hagen@jauu.net>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>, <rui314@gmail.com>,
	<netdev@vger.kernel.org>
Subject: Re: [PATCH] net: filter: Convert the BPF VM to threaded code
Date: Tue, 09 Aug 2011 10:29:00 +0200	[thread overview]
Message-ID: <7f02f2970d225cddfad74ee660f39d1d@localhost> (raw)
In-Reply-To: <1312866027.2531.42.camel@edumazet-laptop>


On Tue, 09 Aug 2011 07:00:27 +0200, Eric Dumazet wrote:



> I tried this idea since its already an enum and all enum values are

> handled in the switch, but all gcc versions I used still generate the

> useless compare and branch (always predicted by modern CPU, so harmless

> anyway ?)



Don't think so, the list is rather long - the CPU may not have any

indication. But strange that your gcc generate a conditional sequence of

cmp and conditional jump instruction instead of a jump table! Look at

commit 01f2f3f6ef4d076c, this is what I got after I refactored to an

_dense_ enum list.

 

> (But this would need to use a larger kernel_sock_filter with not an u16

> code, but the target address).



Not sure if the benefit is worth to try it. Can we avoid any cacheline

misses? I don't think so.





> +		switch ((enum bpf_inst)fentry->code) {



That should not differ! Eric, sure that this do the trick?





Hagen

  reply	other threads:[~2011-08-09  8:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29  8:10 [PATCH] net: filter: Convert the BPF VM to threaded code Rui Ueyama
2011-07-29  9:30 ` Eric Dumazet
2011-07-30  5:09   ` Rui Ueyama
2011-07-30  6:04     ` Eric Dumazet
2011-07-30  6:20       ` Eric Dumazet
2011-07-30  9:55     ` Francois Romieu
2011-08-01 18:16 ` Hagen Paul Pfeifer
2011-08-01 18:37   ` Eric Dumazet
2011-08-02  0:57     ` David Miller
2011-08-09  5:00       ` Eric Dumazet
2011-08-09  8:29         ` Hagen Paul Pfeifer [this message]
2011-08-09  8:36           ` Eric Dumazet
2011-08-09  8:53             ` Hagen Paul Pfeifer

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=7f02f2970d225cddfad74ee660f39d1d@localhost \
    --to=hagen@jauu.net \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rui314@gmail.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).