From owner-soc-status@FreeBSD.ORG Tue Jun 14 00:08:46 2011 Return-Path: Delivered-To: soc-status@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BFD3106564A; Tue, 14 Jun 2011 00:08:46 +0000 (UTC) (envelope-from syuu@dokukino.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 979E98FC0A; Tue, 14 Jun 2011 00:08:44 +0000 (UTC) Received: by wyf23 with SMTP id 23so5432079wyf.13 for ; Mon, 13 Jun 2011 17:08:44 -0700 (PDT) Received: by 10.216.35.76 with SMTP id t54mr73675wea.26.1308010124180; Mon, 13 Jun 2011 17:08:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.29.81 with HTTP; Mon, 13 Jun 2011 17:08:24 -0700 (PDT) From: Takuya ASADA Date: Tue, 14 Jun 2011 09:08:24 +0900 Message-ID: To: soc-status@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: "Robert N. M. Watson" , George Neville-Neil , Kazuya Goda Subject: Weekly status report (14th June) X-BeenThere: soc-status@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Summer of Code Status Reports and Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 00:08:46 -0000 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 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.