From owner-soc-status@FreeBSD.ORG Mon Jun 6 23:12:34 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 BE3C9106566B; Mon, 6 Jun 2011 23:12:34 +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 144938FC1E; Mon, 6 Jun 2011 23:12:33 +0000 (UTC) Received: by wyf23 with SMTP id 23so4385026wyf.13 for ; Mon, 06 Jun 2011 16:12:33 -0700 (PDT) Received: by 10.216.140.219 with SMTP id e69mr3222135wej.45.1307401801181; Mon, 06 Jun 2011 16:10:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.6.196 with HTTP; Mon, 6 Jun 2011 16:09:40 -0700 (PDT) In-Reply-To: References: From: Takuya ASADA Date: Tue, 7 Jun 2011 08:09:40 +0900 Message-ID: To: Kazuya Goda Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: soc-status@freebsd.org, "Robert N. M. Watson" Subject: Re: [status report] RPS/RFS #week2 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: Mon, 06 Jun 2011 23:12:34 -0000 Hi, I think you noticed me last week, RPS kernel performance is slower than normal kernel and it gets higher CPU usage. Was it "net.isr.numthreads < CPU_NUM" case? And, in that time you told me it maybe because hash function is too heavy, was it wrong? 2011/6/7 Kazuya Goda : > Hi, > > The goal of my project is to implement RPS/RFS on FreeBSD. RPS solves > the problem of > mono-queue NIC which can't distribute packets across multiple processors. > > This week status: > > * Implement > RPS act this: > 1. get IP address and TCP port in Ethernet layer > 2. calculate hash from IP address and TCP port > 3. assign hash value to m->pkthdr.flowid > 4. enable M_FLOWID flags in m->m_flags > > I added this process in ether_demux(). I used rss_hash_ip_4tuple() > from //depot/users/rwatson/tcp/... > branch to calculating hash value. I think I'd like to share functions > of calculating hash value with RSS. > > > * Test > - Confirm to select CPU > Enable RPS, pakcets are distributed other CPU on IP layer. At this > time, same flow is distributed > same CPU. So, I printed below values to comfirm. > > -- In netisr_select_cpuid() : m->pkthdr.flowid (flowid) , cpuid > (destination CPU) > -- In ip_input() =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0: m->pkthdr.flowid (flowid), curcpu > (current CPU) > > I confirmed that if flowid is the same, destination CPU is equal to curre= nt CPU. > > - Simplified benchmark test > I used netperf to benchmark test. Server environment is: > > CPU : Xeon E5310@1.6GHz x2(total 8 core) > NIC : e1000 (interface : PCI) > > Below is result running 300 instances of netperf TCP_RR test with 1 > byte req. and resp. > In both cases, net.isr.numthreads is 8. > > -- Result -- > Without RPS : 132 tps > With =C2=A0 =C2=A0 =C2=A0RPS : 230 tps > > > *known problem > In the case of net.isr.numthreads < CPU_NUM, connection is not closed > at high load. > > > * Next week > - Search for a cause "known problem" > - Implement IPv6, UDP support > > > Regards, > > Kazuya Goda >