Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: dborkman@redhat.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 0/8] Add complementary BPF conditional jump instructions
Date: Mon, 31 Dec 2012 19:29:02 -0800	[thread overview]
Message-ID: <1357010942.21409.8948.camel@edumazet-glaptop> (raw)
In-Reply-To: <20121231.143715.1238174487756359071.davem@davemloft.net>

On Mon, 2012-12-31 at 14:37 -0800, David Miller wrote:

> Whilst I agree that adding NE jumps adds great value and closes a
> serious gap, the rest can be synthesized by simply swapping the
> arguments and using a comparison that does already exist.
> 
> Why isn't that sufficient?

I am afraid none of these patches is needed at all.

Swapping the jt/jf is plainly enough for the user land compiler.

libcap seems to do it already

# tcpdump -i lo 'len!=0 && ip6' -d
(000) ld       #pktlen
(001) jeq      #0x0             jt 5	jf 2
(002) ldh      [12]
(003) jeq      #0x86dd          jt 4	jf 5
(004) ret      #96
(005) ret      #0
# tcpdump -i lo 'len==0 && ip6' -d
(000) ld       #pktlen
(001) jeq      #0x0             jt 2	jf 5
(002) ldh      [12]
(003) jeq      #0x86dd          jt 4	jf 5
(004) ret      #96
(005) ret      #0

  reply	other threads:[~2013-01-01  3:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-31 13:59 [PATCH net-next 0/8] Add complementary BPF conditional jump instructions Daniel Borkmann
2012-12-31 13:59 ` [PATCH net-next 1/8] net: bpf: add lt,le jump operations to bpf machine Daniel Borkmann
2012-12-31 13:59 ` [PATCH net-next 2/8] x86: bpf_jit_comp: add JMP instructions for BPF JIT Daniel Borkmann
2012-12-31 13:59 ` [PATCH net-next 3/8] sparc: " Daniel Borkmann
2012-12-31 13:59 ` [PATCH net-next 4/8] PPC: " Daniel Borkmann
2012-12-31 13:59 ` [PATCH net-next 5/8] net: bpf: add neq jump operations to bpf machine Daniel Borkmann
2013-01-01  3:25   ` Eric Dumazet
2012-12-31 13:59 ` [PATCH net-next 7/8] sparc: bpf_jit_comp: add JMP_NEQ instructions for BPF JIT Daniel Borkmann
2012-12-31 13:59 ` [PATCH net-next 8/8] PPC: " Daniel Borkmann
2012-12-31 17:00 ` [PATCH net-next 6/8] x86: " Daniel Borkmann
2012-12-31 22:37 ` [PATCH net-next 0/8] Add complementary BPF conditional jump instructions David Miller
2013-01-01  3:29   ` Eric Dumazet [this message]
2013-01-01  5:18     ` David Miller
2013-01-02 10:47       ` 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=1357010942.21409.8948.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox