Commit e6bf5f48 authored by Jason Gunthorpe's avatar Jason Gunthorpe Committed by Doug Ledford

IB/srp: Use pd->local_dma_lkey

Replace all leys with  pd->local_dma_lkey. This driver does not support
iWarp, so this is safe.

The insecure use of ib_get_dma_mr is thus isolated to an rkey, and will
have to be fixed separately.
Signed-off-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: default avatarSagi Grimberg <sagig@mellanox.com>
Reviewed-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 34efc7df
...@@ -3154,7 +3154,7 @@ static ssize_t srp_create_target(struct device *dev, ...@@ -3154,7 +3154,7 @@ static ssize_t srp_create_target(struct device *dev,
target->io_class = SRP_REV16A_IB_IO_CLASS; target->io_class = SRP_REV16A_IB_IO_CLASS;
target->scsi_host = target_host; target->scsi_host = target_host;
target->srp_host = host; target->srp_host = host;
target->lkey = host->srp_dev->mr->lkey; target->lkey = host->srp_dev->pd->local_dma_lkey;
target->rkey = host->srp_dev->mr->rkey; target->rkey = host->srp_dev->mr->rkey;
target->cmd_sg_cnt = cmd_sg_entries; target->cmd_sg_cnt = cmd_sg_entries;
target->sg_tablesize = indirect_sg_entries ? : cmd_sg_entries; target->sg_tablesize = indirect_sg_entries ? : cmd_sg_entries;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment