Christoph Hellwig wrote:
+ if ((dma_addr & (PAGE_SIZE - 1)) || + ((dma_addr + dma_len) & (PAGE_SIZE - 1)) || + ((i == (sg_cnt - 1)) && !unaligned)) { + srp_fmr->io_addr = dma_addr & PAGE_MASK; + ++unaligned; + } + + if (unaligned <= 1) { + cur_len += dma_len; + for (base_addr = dma_addr; + (dma_addr & PAGE_MASK) <= + ((base_addr + dma_len - 1) & PAGE_MASK); + dma_addr += PAGE_SIZE) + dma_pages[page_cnt++] = dma_addr & PAGE_MASK; + } + + if ((unaligned > 1) || (i == (sg_cnt - 1))) {this is definitly completely broken. dma_addr_ts are opaqueue handles, some platforms use high bits in them for iommu flags.
Yes, I'm busted with such platforms. Could anyone recommend a generic way to do this? or is there such a generic way?
Thanks _______________________________________________ openib-general mailing list [email protected] http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
