diff mbox

[WIP,43/43] iser: Move unaligned counter increment

Message ID 1437548143-24893-44-git-send-email-sagig@mellanox.com (mailing list archive)
State RFC
Headers show

Commit Message

Sagi Grimberg July 22, 2015, 6:55 a.m. UTC
We don't always use bounce buffers, still we update
this counter.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/infiniband/ulp/iser/iser_memory.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index 690f840..4d3dc1c 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -487,11 +487,8 @@  static int fall_to_bounce_buf(struct iscsi_iser_task *iser_task,
 			      struct iser_data_buf *mem,
 			      enum iser_data_dir cmd_dir)
 {
-	struct iscsi_conn *iscsi_conn = iser_task->iser_conn->iscsi_conn;
 	struct iser_device *device = iser_task->iser_conn->ib_conn.device;
 
-	iscsi_conn->fmr_unalign_cnt++;
-
 	if (iser_debug_level > 0)
 		iser_data_buf_dump(mem, device->ib_device);
 
@@ -781,6 +778,7 @@  iser_handle_unaligned_buf(struct iscsi_iser_task *task,
 	aligned_len = iser_data_buf_aligned_len(mem, device->ib_device,
 						iser_conn->scsi_sg_tablesize);
 	if (aligned_len != mem->dma_nents) {
+		iser_conn->iscsi_conn->fmr_unalign_cnt++;
 		if (device->dev_attr.device_cap_flags & IB_DEVICE_MAP_ARB_SG)
 			/* Arbitrary sg support, no need to bounce :) */
 			return 0;