Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Mar 2008 19:06:23 +0200
From:      "Mr Y" <yonyossef.lists@gmail.com>
To:        "Mark Tinguely" <tinguely@casselton.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: bus_dmamem_alloc
Message-ID:  <20def4870803231006j70a32052oe318fbe5e739ed04@mail.gmail.com>
In-Reply-To: <200803201729.m2KHTMd8002539@casselton.net>
References:  <20def4870803200908q63137451p7bf052337a2cc5e0@mail.gmail.com> <200803201729.m2KHTMd8002539@casselton.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <tinguely@casselton.net>
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.
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20def4870803231006j70a32052oe318fbe5e739ed04>