[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1347269124.1234.1326.camel@edumazet-glaptop>
Date: Mon, 10 Sep 2012 11:25:24 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Laight <David.Laight@...LAB.COM>
Cc: Andi Kleen <ak@...ux.intel.com>,
George Bakos <gbakos@...inista.org>,
tcpdump-workers@...ts.tcpdump.org,
Jay Schulist <jschlst@...ba.org>, netdev@...r.kernel.org
Subject: RE: [tcpdump-workers] Modular arithmetic
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists