Weekly status report (14th June)

Takuya ASADA syuu at dokukino.com
Mon Jun 20 13:56:26 UTC 2011


I just realized last report is not completed.
Just following one line:

2011/6/14 Takuya ASADA <syuu at dokukino.com>:
> Here's status update from last week:
>
> *Multi-queue NIC emulation support on bpf
> http://p4web.freebsd.org/@@194710?ac=10
>
> I was considering how to implement/test multi-queue tap device, but I
> didn't get good idea to do that.
> But I get alternate idea to emulate multi-queue network device and the
> way to support it on bpf, using "RPS" which is Kazuya GODA's project.
> The benefit of it is

The benefit of it is, we can use any mono-queue NIC for Multiqueue BPF
testing, and we won't need any additional application that tun/tap
needed.

> I re-factored his implementation and renamed it "SOFTRSS".
> On ethernet layer, it calculates flowid on m2cpuid function, then
> selects cpuid. That is the idea of RPS, but I added few more things to
> support multiqueue bpf.
> I added
> m->m_pkthdr.rxqid = *cpuid;
> on m2cpuid function described above, also added
> ifp->if_rxq_num = netisr_get_cpucount();
> on BIOCENAQMASK ioctl in bpf.c.
> It's bit strange to set if_rxq_num in bpf, but until we don't have
> driver independent struct ifnet initialize code probably it's the best
> place to do so.
> Otherwise we have to change all device drivers.
>
> To prevent rewriting all device drivers, and also to determine RSS
> enabled device, I added IFCAP_MULTIQUEUE.
> I added the capability on igb, and added following code on
> BIOCENAQMASK ioctl in bpf:
> #ifdef SOFTRSS
>                        if (!(ifp->if_capenable & IFCAP_MULTIQUEUE)) {
>                                ifp->if_rxq_num = netisr_get_cpucount();
>                                ifp->if_capabilities |= IFCAP_MULTIQUEUE;
>                                ifp->if_capenable |= IFCAP_MULTIQUEUE;
>                        }
> #else
>                        if (!(ifp->if_capenable & IFCAP_MULTIQUEUE)) {
>                                error = EINVAL;
>                                break;
>                        }
> #endif
>
> This means,
> - If the NIC supports RSS, multi-queue bpf just works.
> - If the NIC doesn't supports RSS, and SOFTRSS is enabled, bpf sets
> rxq_num and adds capability on the if, multi-queue bpf works.
> - If the NIC doesn't supports RSS, and SOFTRSS is disabled,
> BIOCENAQMASK fails, multi-queue bpf doesn't work.
>
> I think the code is still dirty, maybe we shouldn't modify struct
> ifnet in bpf, etc.
> Also, I suppose there're few more missing features, ex) TX packet handling.
>
> *replace mtx with rmlock
> Haven't looking into it yet, it stacks somewhere, possibly deadlock occurred.
>


More information about the soc-status mailing list