aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp/ib_srp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/ulp/srp/ib_srp.c')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 8691fc83f70b..4b62105ed1e8 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -768,7 +768,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
768 struct srp_direct_buf *buf = (void *) cmd->add_data; 768 struct srp_direct_buf *buf = (void *) cmd->add_data;
769 769
770 buf->va = cpu_to_be64(ib_sg_dma_address(ibdev, scat)); 770 buf->va = cpu_to_be64(ib_sg_dma_address(ibdev, scat));
771 buf->key = cpu_to_be32(dev->mr->rkey); 771 buf->key = cpu_to_be32(target->rkey);
772 buf->len = cpu_to_be32(ib_sg_dma_len(ibdev, scat)); 772 buf->len = cpu_to_be32(ib_sg_dma_len(ibdev, scat));
773 } else if (srp_map_fmr(target, scat, count, req, 773 } else if (srp_map_fmr(target, scat, count, req,
774 (void *) cmd->add_data)) { 774 (void *) cmd->add_data)) {
@@ -793,7 +793,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
793 buf->desc_list[i].va = 793 buf->desc_list[i].va =
794 cpu_to_be64(ib_sg_dma_address(ibdev, sg)); 794 cpu_to_be64(ib_sg_dma_address(ibdev, sg));
795 buf->desc_list[i].key = 795 buf->desc_list[i].key =
796 cpu_to_be32(dev->mr->rkey); 796 cpu_to_be32(target->rkey);
797 buf->desc_list[i].len = cpu_to_be32(dma_len); 797 buf->desc_list[i].len = cpu_to_be32(dma_len);
798 datalen += dma_len; 798 datalen += dma_len;
799 } 799 }
@@ -806,7 +806,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
806 buf->table_desc.va = 806 buf->table_desc.va =
807 cpu_to_be64(req->cmd->dma + sizeof *cmd + sizeof *buf); 807 cpu_to_be64(req->cmd->dma + sizeof *cmd + sizeof *buf);
808 buf->table_desc.key = 808 buf->table_desc.key =
809 cpu_to_be32(target->srp_host->srp_dev->mr->rkey); 809 cpu_to_be32(target->rkey);
810 buf->table_desc.len = 810 buf->table_desc.len =
811 cpu_to_be32(count * sizeof (struct srp_direct_buf)); 811 cpu_to_be32(count * sizeof (struct srp_direct_buf));
812 812
@@ -883,7 +883,7 @@ static int srp_post_send(struct srp_target_port *target,
883 883
884 list.addr = iu->dma; 884 list.addr = iu->dma;
885 list.length = len; 885 list.length = len;
886 list.lkey = target->srp_host->srp_dev->mr->lkey; 886 list.lkey = target->lkey;
887 887
888 wr.next = NULL; 888 wr.next = NULL;
889 wr.wr_id = (uintptr_t) iu; 889 wr.wr_id = (uintptr_t) iu;
@@ -902,7 +902,7 @@ static int srp_post_recv(struct srp_target_port *target, struct srp_iu *iu)
902 902
903 list.addr = iu->dma; 903 list.addr = iu->dma;
904 list.length = iu->size; 904 list.length = iu->size;
905 list.lkey = target->srp_host->srp_dev->mr->lkey; 905 list.lkey = target->lkey;
906 906
907 wr.next = NULL; 907 wr.next = NULL;
908 wr.wr_id = (uintptr_t) iu; 908 wr.wr_id = (uintptr_t) iu;
@@ -1955,6 +1955,8 @@ static ssize_t srp_create_target(struct device *dev,
1955 target->io_class = SRP_REV16A_IB_IO_CLASS; 1955 target->io_class = SRP_REV16A_IB_IO_CLASS;
1956 target->scsi_host = target_host; 1956 target->scsi_host = target_host;
1957 target->srp_host = host; 1957 target->srp_host = host;
1958 target->lkey = host->srp_dev->mr->lkey;
1959 target->rkey = host->srp_dev->mr->rkey;
1958 1960
1959 spin_lock_init(&target->lock); 1961 spin_lock_init(&target->lock);
1960 INIT_LIST_HEAD(&target->free_tx); 1962 INIT_LIST_HEAD(&target->free_tx);