From owner-freebsd-net@FreeBSD.ORG Wed Oct 17 17:33:07 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 081E0337 for ; Wed, 17 Oct 2012 17:33:07 +0000 (UTC) (envelope-from ming.fu@netsweeper.com) Received: from mail.netsweeper.com (mail.netsweeper.com [216.171.98.87]) by mx1.freebsd.org (Postfix) with ESMTP id C206C8FC08 for ; Wed, 17 Oct 2012 17:33:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netsweeper.com (Postfix) with ESMTP id EEFED1E40E75 for ; Wed, 17 Oct 2012 13:32:54 -0400 (EDT) X-Virus-Scanned: amavisd-new at mail.netsweeper.com Received: from mail.netsweeper.com ([127.0.0.1]) by localhost (mail.netsweeper.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZCdPBCdv4-zz for ; Wed, 17 Oct 2012 13:32:54 -0400 (EDT) Received: from [192.168.4.202] (unknown [216.171.98.93]) by mail.netsweeper.com (Postfix) with ESMTPSA id BD9901E40DD9 for ; Wed, 17 Oct 2012 13:32:54 -0400 (EDT) Message-ID: <507EEBD1.3020703@netsweeper.com> Date: Wed, 17 Oct 2012 13:33:05 -0400 From: Ming Fu User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: Re: netmap NETMAP_SW_RING or NETMAP_HW_RING References: <507EDFCE.3060702@netsweeper.com> In-Reply-To: <507EDFCE.3060702@netsweeper.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 17:33:07 -0000 After a second look at the netmap_open code, I believe the NETMAP_HW_RING is the choice. My next trouble to to receive packets. The program spins off 8 threads, each thread try to bind to one of the queue on an igb card. (queue 0-7). depending on how I call the netmap_open(). if I call netmap_open(&me, id /*| NETMAP_HW_RING */, 1); The program will able to receive packets, but of course each thread receives packet from all 8 queues. If I call netmap_open(&me, id | NETMAP_HW_RING , 1) none of the thread was able to receive packet. come across the following line of code in nm_util.c } else if (ringid & NETMAP_HW_RING) { D("XXX check multiple threads"); What does it suggest? any special requirement for multi-threaded program? Regards, Ming On 10/17/2012 12:41 PM, Ming Fu wrote: > Hi, > > What is the difference between NETMAP_SW_RING and NETMAP_HW_RING. > When using netmap_open() in the example code to create a netmap fdesc, > one of these two need to be ORed to the queue ID, in order to bind > only one RX queue. > > netmap code updated from FreeBSD RELENG_9. > > Regards, > Ming > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"