Re: some kernel hacking tasks

Sepherosa Ziehau <[email protected]>
Newsgroups gmane.os.dragonfly-bsd.kernel
Message-ID <CAMOc5cyffgHevh5_Mi59W2LwLp5EtKQFE4P4Pw2fbpMW+ety-w@mail.gmail.com>
On Tue, Oct 2, 2012 at 5:57 AM, Antonio Huete Jimenez
<[email protected]> 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 <[email protected]>:
>> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.