From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 12 07:56:51 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BF3A106566C for ; Sat, 12 Feb 2011 07:56:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 082AF8FC12 for ; Sat, 12 Feb 2011 07:56:51 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 8D6C346B09; Sat, 12 Feb 2011 02:56:50 -0500 (EST) Date: Sat, 12 Feb 2011 07:56:50 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Santosh Rao Gururajan In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: ixgbe DMA question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Feb 2011 07:56:51 -0000 On Fri, 11 Feb 2011, Santosh Rao Gururajan wrote: > I have a host machine with 2 ixgbe NICs. I am trying to pass the frames from > one NIC to the other with the lowest possible overhead to the host (high > speed bridge). I am wondering if I can do a rx-ring to tx-ring DMA copy > without creating a mbuf on the host. Is that possible? What are the risks? The only real risk is the simple matter of programming, I think. There's no reason not to it except that it involves modifying device drivers, memory models, etc. If you do what you describe, and you decide you do want to pass some frames up the stack, you can always hook up mbufs and use the external storage free routine to return the memory to the ring. Jeff Roberson has been circulating some patches that eliminate the mbuf<->cluster relationship in its current form, instead preferring variable size mbufs, and I can't help but wonder if with such a patch, that wouldn't be simpler than what you propose, offering many of the same performance benefits while making the device driver changes smaller and still allowing you to direct some packets up the stack if desired. Robert