From owner-freebsd-net@FreeBSD.ORG Thu Feb 24 10:28:42 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 723871065672 for ; Thu, 24 Feb 2011 10:28:42 +0000 (UTC) (envelope-from fabien.thomas@netasq.com) Received: from work.netasq.com (mars.netasq.com [91.212.116.3]) by mx1.freebsd.org (Postfix) with ESMTP id 3C9908FC18 for ; Thu, 24 Feb 2011 10:28:41 +0000 (UTC) Received: from [10.20.1.1] (unknown [10.2.1.1]) by work.netasq.com (Postfix) with ESMTPSA id 49C3F740021 for ; Thu, 24 Feb 2011 11:11:36 +0100 (CET) From: Fabien Thomas Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Thu, 24 Feb 2011 11:12:58 +0100 Message-Id: <0B0B1ACC-C57B-4F74-85D5-DD2C7F2DAEA5@netasq.com> To: FreeBSD Net Mime-Version: 1.0 (Apple Message framework v1082) X-Mailer: Apple Mail (2.1082) Subject: Polling with multiqueue support X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Feb 2011 10:28:42 -0000 Ryan post on new polling modification remembered me to post a quick note = about polling with multiqueue support i've done some month ago. The code is more intrusive and add a new handler for the queue.=20 The handling of the network is nearly the same as deferred taskqueue in = the drivers. There is now two pass one for the receive and one for transmit (to flush = pending transmit when all receive pass done). The main gain is for packet forwarding with more than one interface. The CPU can be easily reserved for application by binding a specific = number of core to the network. Performance is on par with interrupt on 10Gb or 1Gb interface and = latency can be reduced by using higher HZ. Most of the time using less core achieve higher global efficiency of the = system by freeing CPU cycle and reducing contention. Ex setup: 6 cores CPU, 2 ixgbe with 3 queue, 4 igb with 3 queue with 3 cores for polling: CPU0 will handle ixgbe0 queue 0, ixgbe1 queue 0, igb0 queue0, ... CPU1 will handle ixgbe0 queue 1, ... ... For those interested a test branch can be found here based on 8.x with = ixgbe / igb and em modification: = http://www.gitorious.org/~fabient/freebsd/fabient-sandbox/commits/work/pol= lng_mq_stable_8 Extracted patchset here: http://people.freebsd.org/~fabient/patch-poll_mq-20110202-stable_8 http://people.freebsd.org/~fabient/kern_poll.c-20110202 -> put to = kern/kern_poll.c -- Fabien Thomas