Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: Andi Kleen <ak@linux.intel.com>,
	George Bakos <gbakos@alpinista.org>,
	tcpdump-workers@lists.tcpdump.org,
	Jay Schulist <jschlst@samba.org>,
	netdev@vger.kernel.org
Subject: RE: [tcpdump-workers] Modular arithmetic
Date: Mon, 10 Sep 2012 11:25:24 +0200	[thread overview]
Message-ID: <1347269124.1234.1326.camel@edumazet-glaptop> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B6FE4@saturn3.aculab.com>

On Mon, 2012-09-10 at 09:41 +0100, David Laight wrote:
> > On Fri, Sep 07, 2012 at 07:49:10AM +0000, George Bakos wrote:
> > > Gents,
> > > Any fundamental reason why the following (, etc.) shouldn't be
> > > included in net/core/filter.c?
> > >
> > >                 case BPF_S_ALU_MOD_X:
> > >                         if (X == 0)
> > >                                 return 0;
> > >                         A %= X;
> > >                         continue;
> > 
> > Copying netdev.
> > 
> > In principle no reason against it, but you may need to update
> > the various BPF JITs too that Linux now has too.
> 
> What about the other OS - eg all the BSDs?
> I had a vague idea that BPF was supposed to be reasonable portable.

Yes, does it mean BPF is frozen ?

Or is BSD so hard to update these days ?

modulus can be implemented using fallback to div and sub, I am not sure
libpcap should sense kernel support or not.

George, make sure libpcap optimizer correctly replaces MOD X  by AND (X
- 1) if X is a power of two.

  reply	other threads:[~2012-09-10  9:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120905213941.03c85968@arrowsmith>
     [not found] ` <C71A36A8-08D2-4D3D-AF2B-EF89FEECE1A6@alum.mit.edu>
     [not found]   ` <20120906073615.693d14e0@arrowsmith>
     [not found]     ` <46AB14E3-73F4-41FA-8086-F1D663AF4549@alum.mit.edu>
     [not found]       ` <20120907074910.2df46817@arrowsmith>
2012-09-08  3:03         ` [tcpdump-workers] Modular arithmetic Andi Kleen
2012-09-08  8:03           ` [PATCH net-next] filter: add MOD operation Eric Dumazet
2012-09-08 20:31             ` George Bakos
2012-09-10 19:45             ` David Miller
2012-09-10 20:48               ` [PATCH net-next] x86 bpf_jit: support " Eric Dumazet
2012-09-10 21:09                 ` David Miller
2012-09-10  8:41           ` [tcpdump-workers] Modular arithmetic David Laight
2012-09-10  9:25             ` Eric Dumazet [this message]
2012-09-10 10:41               ` David Laight
2012-09-10 11:49                 ` [tcpdump-workers] " Daniel Borkmann
2012-09-10 17:50                 ` Guy Harris
2014-05-18 18:26                   ` Guy Harris
2012-09-10 14:49             ` [tcpdump-workers] " Andi Kleen

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=1347269124.1234.1326.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=ak@linux.intel.com \
    --cc=gbakos@alpinista.org \
    --cc=jschlst@samba.org \
    --cc=netdev@vger.kernel.org \
    --cc=tcpdump-workers@lists.tcpdump.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