Add read only module param to count alignment violations.
In case of unaligned pages iSER allocates memory and copies
the data to the new memory.

Signed-off-by: Eli Dorfman <[EMAIL PROTECTED]>
---
 drivers/infiniband/ulp/iser/iscsi_iser.c  |    3 +++
 drivers/infiniband/ulp/iser/iscsi_iser.h  |    1 +
 drivers/infiniband/ulp/iser/iser_memory.c |    1 +
 3 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c
b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 451e601..5181a1e 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -77,6 +77,9 @@
 static unsigned int iscsi_max_lun = 512;
 module_param_named(max_lun, iscsi_max_lun, uint, S_IRUGO);

+unsigned int iser_unaligned_cnt = 0;
+module_param_named(unaligned_cnt, iser_unaligned_cnt, uint, S_IRUGO);
+
 int iser_debug_level = 0;
 module_param_named(debug_level, iser_debug_level, int,
S_IRUGO|S_IWUSR|S_IWGRP);
 MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0
(default:disabled)");
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h
b/drivers/infiniband/ulp/iser/iscsi_iser.h
index a8c1b30..4a39a38 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -294,6 +294,7 @@ struct iser_global {

 extern struct iser_global ig;
 extern int iser_debug_level;
+extern unsigned int iser_unaligned_cnt;

 /* allocate connection resources needed for rdma functionality */
 int iser_conn_set_full_featured_mode(struct iscsi_conn *conn);
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c
b/drivers/infiniband/ulp/iser/iser_memory.c
index ee58199..0f0fcb3 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -437,6 +437,7 @@ int iser_reg_rdma_mem(struct iscsi_iser_cmd_task
*iser_ctask,

        aligned_len = iser_data_buf_aligned_len(mem, ibdev);
        if (aligned_len != mem->dma_nents) {
+               iser_unaligned_cnt++;
                iser_warn("rdma alignment violation %d/%d aligned\n",
                         aligned_len, mem->size);
                iser_data_buf_dump(mem, ibdev);
-- 
1.5.5

This patch was made against 2.6.26 branch.
Since it includes minor changes please try to push it to 2.6.26.
Otherwise this can go to 2.6.27.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

Reply via email to