From owner-freebsd-usb@FreeBSD.ORG Wed Jul 4 07:01:34 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FCD616A400; Wed, 4 Jul 2007 07:01:34 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.swip.net [212.247.154.65]) by mx1.freebsd.org (Postfix) with ESMTP id E87BD13C4DB; Wed, 4 Jul 2007 07:01:33 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [194.248.135.20] (account mc467741@c2i.net HELO laptop.lan) by mailfe03.swip.net (CommuniGate Pro SMTP 5.1.10) with ESMTPA id 543776670; Wed, 04 Jul 2007 09:01:31 +0200 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org, freebsd-usb@freebsd.org Date: Wed, 4 Jul 2007 09:01:32 +0200 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707040901.33019.hselasky@c2i.net> Cc: Subject: New USB stack and Zero copy. X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2007 07:01:34 -0000 Hi, I want to get rid of the copying between DMA'able memory and non-DMA'able memory. Currently I allocate N memory-pages for each USB transfer like separate pages. The bus-dma system then assigns all of these pages each their virtual address. What I see is that when I allocate more than PAGE_SIZE bytes using bus-dma, I get physically contiguous memory. I don't need that for the USB stack. The question is: Should we change bus-dma to support so called scatter and gather allocations, where the physical allocation is non-contiguous, and the virtual allocation is contiguous accross all the scattered pages ? Also: How is the easiest way to load memory pages into DMA ? And I want that the loadig works like this, that when the page must be bounced it should not allocate a bounce buffer, hence I already have a bounce buffer. I only need to know which pages I can forward directly to the USB hardware, and the rest I will bounce somewhere else. --HPS