[openib-general][PATCH][SRP] bug fixes & fmr supported,

Vu Pham vuhuong at mellanox.com
Wed Sep 21 22:41:13 PDT 2005


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



More information about the general mailing list