From owner-freebsd-hackers@freebsd.org Fri Dec 14 15:35:19 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0C6F1337E0C; Fri, 14 Dec 2018 15:35:19 +0000 (UTC) (envelope-from lidl@pix.net) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254:11::4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.pix.net", Issuer "Pix.Com Technologies LLC CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3DA81FE3; Fri, 14 Dec 2018 15:35:19 +0000 (UTC) (envelope-from lidl@pix.net) Received: from torb.pix.net ([IPv6:2001:470:e254:10:702f:25e8:7b4f:59c6]) (authenticated bits=0) by hydra.pix.net (8.15.2/8.15.2) with ESMTPA id wBEFZ9B2072892; Fri, 14 Dec 2018 10:35:16 -0500 (EST) (envelope-from lidl@pix.net) X-Authentication-Warning: hydra.pix.net: Host [IPv6:2001:470:e254:10:702f:25e8:7b4f:59c6] claimed to be torb.pix.net Subject: Re: How to use the DMA Engine in FreeBSD? To: Warner Losh , Rajesh Kumar Cc: FreeBSD Hackers , freebsd-drivers@freebsd.org References: From: Kurt Lidl Message-ID: <26df913b-a2f8-2709-1cec-d11ad7d113a8@pix.net> Date: Fri, 14 Dec 2018 10:35:09 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2018 15:35:19 -0000 On 12/13/18 10:53 AM, Warner Losh wrote: > On Thu, Dec 13, 2018, 3:04 AM Rajesh Kumar >> Hi, >> >> Is there any good documentation available to understand the existing >> support, API's and how-to use the DMA Engine in FreeBSD? >> > > > Usually you just use pci busmastering and it just works. > > I am trying to write a test driver which will use DMA Engine to do the data >> transfer (rather than plain memcpy which involves cpu). Can anyone point >> to any driver implementation which has similar functions implemented? I >> see references to SYS_RES_DRQ to allocate DMA channels and play around. But >> that seems to be specific to ISA. Can it be used for PCI drivers as well? >> > > No. ISA DMA is only for really old hardware without it's own DMA engine. > > Look at the busdma api/man page. For some Intel based server hardware, there is the "ioat" driver, which allows for user code to schedule DMA operations. See ioat(4) for details, including a pointer to the test program. -Kurt