From owner-freebsd-net@FreeBSD.ORG Tue Jul 24 20:25:53 2012 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 ED414106566B for ; Tue, 24 Jul 2012 20:25:52 +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 BCDCB8FC08 for ; Tue, 24 Jul 2012 20:25:52 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.netsweeper.com (Postfix) with ESMTP id BAC1AC2002A for ; Tue, 24 Jul 2012 16:19:33 -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 9sfhzUf0E7sg for ; Tue, 24 Jul 2012 16:19:33 -0400 (EDT) Received: from [192.168.4.199] (unknown [216.171.98.93]) by mail.netsweeper.com (Postfix) with ESMTPSA id 2FC6BC20029 for ; Tue, 24 Jul 2012 16:19:33 -0400 (EDT) Message-ID: <500F034F.6040809@netsweeper.com> Date: Tue, 24 Jul 2012 16:19:27 -0400 From: Ming Fu User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: netmap bridge.c sample code assumes the same number of tx/rx queue. 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: Tue, 24 Jul 2012 20:25:53 -0000 Hi Everybody, I just want to share some work I was doing last few days trying to make use the bridge code of netmap. My netmap device has 4 receive and 1 transmit queue. I found that a ping -s 5100 10.10.10.10 through the bridge will lost fragment of the ping when the transmit queue reaches its wrapping point (the last slot). The problem was traced to the code in tools/tools/netmap/bridge.c. It assumes the same number of receive and transmit queues from the netmap device, which does not work for me. The number of queues is stored in struct my_ring when the netmap device is opened, but only the number of receive queue is saved. Subsequent code uses the number of receive queues to check of bond of transmit queues. When the transmit queue is less than the receive queue, the bridge program will start to loose packet when the queue wraps happens at the last transmit queue. Regards, Ming