* [RFD][PATCH] Add JMEMCMP to Berkeley Packet Filters
@ 2011-02-10 12:14 Ian Molton
2011-02-10 12:57 ` Ian Molton
2011-02-12 2:14 ` Paul Mackerras
0 siblings, 2 replies; 5+ messages in thread
From: Ian Molton @ 2011-02-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: rdunlap, isdn, paulus, arnd, davem, herbert, ebiederm
Hi folks,
This patch implements an extension for BPF to allow filter programs to use a
data section, along with a MEMCMP instruction.
There are a few issues noted in the patch itself, which can easily be
addressed, and I would like to check wether sk_run_filter is ever expected to
be called from a context that cannot sleep (I dont think it is).
I think the patch should probably be split into a patch to add data sections
and one adding the JMEMCMP instruction, but that can be done after some review!
-Ian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFD][PATCH] Add JMEMCMP to Berkeley Packet Filters
2011-02-10 12:14 [RFD][PATCH] Add JMEMCMP to Berkeley Packet Filters Ian Molton
@ 2011-02-10 12:57 ` Ian Molton
2011-02-12 2:14 ` Paul Mackerras
1 sibling, 0 replies; 5+ messages in thread
From: Ian Molton @ 2011-02-10 12:57 UTC (permalink / raw)
To: netdev
Shit, sorry about the noise. git-send-email bit me :)
-Ian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFD][PATCH] Add JMEMCMP to Berkeley Packet Filters
2011-02-10 12:14 [RFD][PATCH] Add JMEMCMP to Berkeley Packet Filters Ian Molton
2011-02-10 12:57 ` Ian Molton
@ 2011-02-12 2:14 ` Paul Mackerras
2011-02-12 12:47 ` Ian Molton
1 sibling, 1 reply; 5+ messages in thread
From: Paul Mackerras @ 2011-02-12 2:14 UTC (permalink / raw)
To: Ian Molton; +Cc: netdev, rdunlap, isdn, arnd, davem, herbert, ebiederm
On Thu, Feb 10, 2011 at 12:14:46PM +0000, Ian Molton wrote:
> This patch implements an extension for BPF to allow filter programs to use a
> data section, along with a MEMCMP instruction.
>
> There are a few issues noted in the patch itself, which can easily be
> addressed, and I would like to check wether sk_run_filter is ever expected to
> be called from a context that cannot sleep (I dont think it is).
The ppp driver (ppp_generic.c) calls sk_run_filter inside a region
protected by spin_lock_bh, so we can't sleep there. Having sk_run_filter
potentially sleep would make it useless for ppp.
Paul.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFD][PATCH] Add JMEMCMP to Berkeley Packet Filters
2011-02-12 2:14 ` Paul Mackerras
@ 2011-02-12 12:47 ` Ian Molton
0 siblings, 0 replies; 5+ messages in thread
From: Ian Molton @ 2011-02-12 12:47 UTC (permalink / raw)
To: Paul Mackerras; +Cc: netdev, rdunlap, isdn, arnd, davem, herbert, ebiederm
On 12/02/11 02:14, Paul Mackerras wrote:
> On Thu, Feb 10, 2011 at 12:14:46PM +0000, Ian Molton wrote:
>
>> This patch implements an extension for BPF to allow filter programs to use a
>> data section, along with a MEMCMP instruction.
>>
>> There are a few issues noted in the patch itself, which can easily be
>> addressed, and I would like to check wether sk_run_filter is ever expected to
>> be called from a context that cannot sleep (I dont think it is).
>
> The ppp driver (ppp_generic.c) calls sk_run_filter inside a region
> protected by spin_lock_bh, so we can't sleep there. Having sk_run_filter
> potentially sleep would make it useless for ppp.
Thanks for the review.
I'll fix it not to sleep :)
Do I take it from the lack of people comlpaining that the concept of
adding this type of instruction itself is not a problem ?
Thanks!
-Ian
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFD][PATCH] Add JMEMCMP to Berkeley Packet Filters
@ 2011-02-10 12:31 Ian Molton
0 siblings, 0 replies; 5+ messages in thread
From: Ian Molton @ 2011-02-10 12:31 UTC (permalink / raw)
To: netdev
Cc: rdunlap, isdn, paulus, arnd, davem, herbert, ebiederm, alban.crequy
Documentation/networking/filter.txt | 9 ++
drivers/isdn/i4l/isdn_ppp.c | 2
drivers/net/ppp_generic.c | 2
include/asm-generic/socket.h | 2
include/linux/filter.h | 17 ++++-
include/linux/ptp_classify.h | 2
net/core/filter.c | 115 ++++++++++++++++++++++++++++++++++--
net/core/sock.c | 14 ++++
net/core/timestamping.c | 4 -
net/packet/af_packet.c | 3
This patch adds support for adding a data section to BPF. It is intended to be
used by the JMEMCMP instruction also added in this patch.
There are some issues, mostly noted int he commit message, and I'd like to
check that sk_run_filter() does not get called from a context that cannot sleep
(I dont think so).
Comments welcome!
-Ian
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-02-12 12:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-10 12:14 [RFD][PATCH] Add JMEMCMP to Berkeley Packet Filters Ian Molton
2011-02-10 12:57 ` Ian Molton
2011-02-12 2:14 ` Paul Mackerras
2011-02-12 12:47 ` Ian Molton
2011-02-10 12:31 Ian Molton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.