From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Miller <davem@davemloft.net>
Cc: kaffeemonster@googlemail.com, eric.dumazet@gmail.com,
matt@ozlabs.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [REGRESSION][PATCH V4 3/3] bpf jit: Let the powerpc jit handle negative offsets
Date: Mon, 30 Apr 2012 13:40:46 +1000 [thread overview]
Message-ID: <1335757246.20866.31.camel@pasglop> (raw)
In-Reply-To: <1335753820.20866.27.camel@pasglop>
On Mon, 2012-04-30 at 12:43 +1000, Benjamin Herrenschmidt wrote:
> Ok, he hasn't so I'll dig a bit.
>
> No obvious wrongness (but I'm not very familiar with bpf), though I do
> have a comment: sk_negative_common() and bpf_slow_path_common() should
> be made one and single macro which takes the fallback function as an
> argument.
>
> I'll mess around & try to test using Jan test case & will come back
> with an updated patch.
Wow, hit that nasty along the way: The test program will not work
on big endian machines because of a nasty difference between
the kernel struct sock_fprog and libpcap struct bpf_program:
Kernel expects:
struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
unsigned short len; /* Number of filter blocks */
struct sock_filter __user *filter;
};
libpcap provides:
struct bpf_program {
u_int bf_len;
struct bpf_insn *bf_insns;
};
Note the unsigned short vs. unsigned int there ? This totally
breaks it here.
Is it expected that one can pass a struct bpf_program directly
to the kernel or should it be "converted" by the library in which
case it's just a bug in Jan's test program ?
Cheers,
Ben.
next prev parent reply other threads:[~2012-04-30 3:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-30 15:00 [REGRESSION][PATCH V4 0/3] bpf jit drops the ball on negative memory references Jan Seiffert
2012-03-30 15:08 ` [REGRESSION][PATCH V4 1/3] bpf jit: Make the filter.c::__load_pointer helper non-static for the jits Jan Seiffert
2012-03-30 18:56 ` Eric Dumazet
2012-04-02 9:18 ` David Laight
2012-04-02 13:02 ` Jan Seiffert
2012-04-03 22:02 ` David Miller
2012-03-30 15:35 ` [REGRESSION][PATCH V4 3/3] bpf jit: Let the powerpc jit handle negative offsets Jan Seiffert
2012-04-03 22:03 ` David Miller
2012-04-03 22:11 ` Benjamin Herrenschmidt
2012-04-30 2:43 ` Benjamin Herrenschmidt
2012-04-30 3:40 ` Benjamin Herrenschmidt [this message]
2012-04-30 3:43 ` Jan Seiffert
2012-04-30 4:11 ` Benjamin Herrenschmidt
2012-04-30 4:27 ` Jan Seiffert
2012-04-30 4:29 ` Benjamin Herrenschmidt
2012-04-30 4:43 ` Jan Seiffert
2012-04-30 5:26 ` Benjamin Herrenschmidt
2012-04-30 17:41 ` David Miller
2012-04-30 21:55 ` Benjamin Herrenschmidt
2012-04-30 21:57 ` Benjamin Herrenschmidt
2012-04-30 5:02 ` [REGRESSION][PATCH V5 " Jan Seiffert
2012-04-30 17:41 ` David Miller
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=1335757246.20866.31.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=kaffeemonster@googlemail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=matt@ozlabs.org \
--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;
as well as URLs for NNTP newsgroup(s).