[openib-general] [PATCH 1/5] IB/iser: fix a check of SG alignment for RDMA

Erez Zilber erezz at voltaire.com
Mon Sep 11 02:19:17 PDT 2006


dma mapping may include a "compaction" of the sg associated with scsi command.
Hence, the size of the maximal prefix of the SG which is aligned for rdma must be
compared against the length of the dma mapped sg (mem->dma_nents) and not against
the size of it before it was mapped (mem->size).

Signed-off-by: Erez Zilber <erezz at voltaire.com>

---

 drivers/infiniband/ulp/iser/iser_memory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

5301a4bb4f73250a93bc0c103839ae527f6b4110
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index 31950a5..53af956 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -378,7 +378,7 @@ int iser_reg_rdma_mem(struct iscsi_iser_
 	regd_buf = &iser_ctask->rdma_regd[cmd_dir];
 
 	aligned_len = iser_data_buf_aligned_len(mem);
-	if (aligned_len != mem->size) {
+	if (aligned_len != mem->dma_nents) {
 		iser_err("rdma alignment violation %d/%d aligned\n",
 			 aligned_len, mem->size);
 		iser_data_buf_dump(mem);
-- 
1.2.6






More information about the general mailing list