Re: [PATCH for-next 03/10] IB/iser: Don't register memory for all immediatedata writes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 11/16/2015 6:37 PM, Sagi Grimberg wrote:
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -250,7 +250,7 @@ iser_reg_dma(struct iser_device *device, struct
iser_data_buf *mem,
      struct scatterlist *sg = mem->sg;
      reg->sge.lkey = device->pd->local_dma_lkey;
-    reg->rkey = device->mr->rkey;
+    reg->rkey = device->mr ? device->mr->rkey : 0;
      reg->sge.addr = ib_sg_dma_address(device->ib_device, &sg[0]);
      reg->sge.length = ib_sg_dma_len(device->ib_device, &sg[0]);

what's the role of this hunk? why it belongs here? you are testing
device->mr but this is
something global and has nothing to do specially with specific IOs for
which this patch
aims to act

It's because device->mr might not be allocated at all if
always_register=Y, however in this case for all-immediatedata writes
I don't need memory registration and I can use pd->local_dma_lkey.

This hunk prevents a NULL dereference (as I mentioned, device->mr might
not be allocated at all).
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux