' bus_dmamap_load_mbuf_sg ( ) ' function usage problem
John-Mark Gurney
gurney_j at resnet.uoregon.edu
Mon Dec 18 13:11:52 PST 2006
tanniru.sankar at wipro.com wrote this message on Mon, Dec 18, 2006 at 20:05 +0530:
> I am facing a problem on FreeBSD 7.0 during mapping using '
> bus_dmamap_load_mbuf_sg ( ) ' function .
> Details are below.
>
> It is AMD 64 bit machine. I have allocated jumbo buffer memory using
> ' m_getcl ' function.
>
> mp = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES);
>
> As it got success here, I am trying to map the buffer as below.
>
> err = bus_dmamap_load_mbuf_sg(dma_tag_rx, map, mp, &seg, &cnt,
> BUS_DMA_NOWAIT);
>
> Here it is getting error for the mbuf size equal to MJUM9BYTES.
> The type of error is ' EFBIG '.
>
> I have create rx jumbo dma tag with attributes as following.
[...]
> MJUM9BYTES, /* Maximum Size */
>
> 1 , /* Number of Segments */
>
> MJUM9BYTES, /* Maximum Segment Size */
This is probably the problem... Most likely the buffer is non-contiguous
in memory, and needs 3 segments to satisfy the mapping... Try increasing
the number of segments and see what happens...
--
John-Mark Gurney Voice: +1 415 225 5579
"All that I will do, has been done, All that I have, has not."
More information about the freebsd-net
mailing list