From owner-freebsd-questions@FreeBSD.ORG Sun Mar 23 17:06:25 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17C661065677 for ; Sun, 23 Mar 2008 17:06:25 +0000 (UTC) (envelope-from yonyossef.lists@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.228]) by mx1.freebsd.org (Postfix) with ESMTP id BA84C8FC20 for ; Sun, 23 Mar 2008 17:06:24 +0000 (UTC) (envelope-from yonyossef.lists@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so2797522wxd.7 for ; Sun, 23 Mar 2008 10:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=P0aNi2XP5DMLNxgfGW7a22TvozAihyIK++4d/wF69sM=; b=LvhTxfUeUaqSeVaPr1Q0mfNc3Y8McLAUCSt3yQ6Hsb+bLJ7v3xY7kqvOPySxjfwYnWosKMcLeIbCExjitdkeGenjORbAHl+RQ5qlATj4ttyByLFH5xS9f592T1OuAt71lDbynxzAzjv/qns3O7FPV/JQCaozK4b5ztzhYonyhvQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=G66e/1X9EzeRRMeGohEbg24t9MhA+xj31NFiQKZwVqjRvDZTFCh2bv3TTSXxeLkMqFizhPrrXN6ir8Bw/7wghaR8xZgrLsUHgDEK2PqF2klRAlCxVRbJFI3nO/sbJcMvCsofG3kCbrmL8FA3TPIcYbl3TxksQscBat47ZFTGU3Q= Received: by 10.151.39.21 with SMTP id r21mr215640ybj.83.1206291983581; Sun, 23 Mar 2008 10:06:23 -0700 (PDT) Received: by 10.151.12.5 with HTTP; Sun, 23 Mar 2008 10:06:23 -0700 (PDT) Message-ID: <20def4870803231006j70a32052oe318fbe5e739ed04@mail.gmail.com> Date: Sun, 23 Mar 2008 19:06:23 +0200 From: "Mr Y" To: "Mark Tinguely" In-Reply-To: <200803201729.m2KHTMd8002539@casselton.net> MIME-Version: 1.0 References: <20def4870803200908q63137451p7bf052337a2cc5e0@mail.gmail.com> <200803201729.m2KHTMd8002539@casselton.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: bus_dmamem_alloc X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2008 17:06:25 -0000 Hi Mark, Actualy I'm not getting any error from bus_dmamem_alloc, that's the strange thing. Yet printing the dma_map pointer shows 0 unless I use bus_dmamap_create after bus_dmamem_alloc. bus_mamap_load doesn't fail in both cases. I'm working on an Ethernet driver for FreeBSD, pinging messages larger than MTU crash the kernel at some point, I'm investigating the dma direction at the moment. --Yony On Thu, Mar 20, 2008 at 7:29 PM, Mark Tinguely wrote: > > so I'm running: > > > > err = > > bus_dmamem_alloc(ring->dma_tag, &ring->buf, > > BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW, &ring->dma_map); > > > > but after calling bus_dmamem_allloc the dma_map variable is still NULL. > is > > this OK? > > Sure, you are allocating with BUS_DMA_NOWAIT. err is probably equal to > ENOMEM. > > If allocation size is larger than a PAGE_SIZE or specific alignment is > require then contigmalloc() is called to satisfy the allocation. > contigmalloc() can fail even when specifying WAITOK. > > --Mark Tinguely. >