some kernel hacking tasks

Sepherosa Ziehau sepherosa at gmail.com
Tue Oct 2 03:22:28 PDT 2012


On Tue, Oct 2, 2012 at 5:57 AM, Antonio Huete Jimenez
<ahuete.devel at gmail.com> wrote:
> Hi Sephe,
>
> Here's a patch for bpf:
> http://island.quantumachine.net/~antonioh/archive/patches/bpf_token01.diff
> Not sure if I'm missing something.

I have looked at the patch.  I think there are still something missing:
- bpf code actually assumes that mplock is held on the device node
interfaces, so you probably need to protect them w/ the bpf token.
- bpfattach/bpfdetach should probably be protected by bpf token
- Macros like BPF_TAP() and ETHER_BPF_MTAP() probably will need the
check-hold_token-recheck sequence, e.g.:
if (ifp->if_bpf) {
    bpf_gettoken();
    if (ifp->if_bpf)
        bpf_tap(...);
    bpf_reltoken();
}

Best Regards,
sephe

>
> I've tested it with netperf in one ssh session and tcpdump in another
> (thanks sjg)
>
> Cheers,
> Antonio Huete
>
> 2012/9/29 Sepherosa Ziehau <sepherosa at gmail.com>:
>> Hi all,
>>
>> I have several kernel hacking tasks; any helping hands are welcome.
>> - Replace bpf's mplock w/ its own token
>> - Support busdma(9) in some network drivers, the most commonly
>> used/available ones:
>> o  dc(4)
>> o  fxp(4)
>> o  vr(4)
>> There are actually more drivers that do not support busdma(9):
>> find /usr/src/sys/dev/netif -type f -name "*.c" -exec grep -l
>> "contigmalloc" "{}" ";"
>>
>> I could help to review, test and commit the patch.
>>
>> Best Regards,
>> sephe
>>
>> --
>> Tomorrow Will Never Die



-- 
Tomorrow Will Never Die



More information about the Kernel mailing list