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/rootnex.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... Something that can fit exactly into 15 cookies, can take 16 because of the buffer offset can give you partial pages in the front and back. But 15+ should always fit into 16 cookies. >> 60+ kB is not a large buffer, and sgl 16 is not small, I do not know >> why ddi_dma_addr_bind_handle still fails with DDI_DMA_TOOBIG? Anyone knows >> why? DDI_DMA_TOOBIG is returned because you tried to bind a buffer which was too big for the sgllen (and didn't support partial mappings) (it's also returned on 32-bit kernels if you specify a buffer size of 0xFFFFFFFF). Most likely your not really using the dma handle you think you are or your not really binding 62268 bytes. If you can get the machine at a kmdb breakpoint in the rootnex when it is about to return the failure, I can tell you what happened. e.g. : alpha[1]#; echo "rootnex_bind_slowpath::dis ! grep cmn_err" | mdb -k rootnex_bind_slowpath+0x384: call +0x41695e7 <cmn_err> then set a breakpoint there. MRJ _______________________________________________ driver-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/driver-discuss
