Mark Johnson wrote: 
> Paul Durrant wrote:
> > Paul Guo - SUN ERI - Beijing China wrote:
> >> I tried to bind an buffer with len of 62268 to a dma handle, but
> >> unfortunately failed.
> >> ddi_dma_addr_bind_handle returns value: DDI_DMA_TOOBIG. The solaris is
> >> snv_93 x86.
> >>
> >> status = ddi_dma_addr_bind_handle(tcb->tx_dma_handle,
> >> NULL,(caddr_t)mp->b_rptr, len,
> >> DDI_DMA_WRITE | DDI_DMA_STREAMING, DDI_DMA_DONTWAIT, 0, &dma_cookie,
> >> &ncookies);
> >>
> >> tx_dma_handle is allocated using the following attr.
> >> 90 DMA_ATTR_V0, /* version number */
> >> 91 0x0000000000000000ull, /* low address */
> >> 92 0xFFFFFFFFFFFFFFFFull, /* high address */
> >> 93 0x00000000FFFFFFFFull, /* dma counter max */
> >> 94 1, /* alignment */
> >> 95 0x00000FFF, /* burst sizes */
> >> 96 0x00000001, /* minimum transfer size */
> >> 97 0x00000000FFFFFFFFull, /* maximum transfer size */
> >> 98 0xFFFFFFFFFFFFFFFFull, /* maximum segment size */
> >> 99 16, /* scatter/gather list length */
> >> 100 0x00000001, /* granularity */
> >> 101 DDI_DMA_FLAGERR /* DMA flags */
> >>
> >>
> > 
> > The console warning comes from:
> > 
> > 
http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/i86pc/io/rootn
ex.c#2521
> > 
> > 
> > Where was your memory allocated from? 62268 / 4096 is > 15 (~15.2). As I 
> > calculate it; at worst, this means it may take 17 cookies to map it, not 
> > 16. I imagine you hit this worst case and thus you got the wanring 
> > because you're unable to accept partial mappings.
> 
> No, 62268 bytes should take 16 cookies worse case...

No, 61440 bytes needs 15 cookies, best case.

And 62268 bytes needs 16 cookies, best case.  In case the 62268 byte
buffer isn't page aligned we need 17 cookies.


_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to