Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: IB/srp: set virt_boundary_mask in the scsi host

This ensures all proper DMA layer handling is taken care of by the SCSI
midlayer.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Acked-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Christoph Hellwig and committed by
Martin K. Petersen
8c175d31 09a4460b

+3 -15
+3 -15
drivers/infiniband/ulp/srp/ib_srp.c
··· 3044 3044 return 0; 3045 3045 } 3046 3046 3047 - static int srp_slave_alloc(struct scsi_device *sdev) 3048 - { 3049 - struct Scsi_Host *shost = sdev->host; 3050 - struct srp_target_port *target = host_to_target(shost); 3051 - struct srp_device *srp_dev = target->srp_host->srp_dev; 3052 - struct ib_device *ibdev = srp_dev->dev; 3053 - 3054 - if (!(ibdev->attrs.device_cap_flags & IB_DEVICE_SG_GAPS_REG)) 3055 - blk_queue_virt_boundary(sdev->request_queue, 3056 - ~srp_dev->mr_page_mask); 3057 - 3058 - return 0; 3059 - } 3060 - 3061 3047 static int srp_slave_configure(struct scsi_device *sdev) 3062 3048 { 3063 3049 struct Scsi_Host *shost = sdev->host; ··· 3246 3260 .name = "InfiniBand SRP initiator", 3247 3261 .proc_name = DRV_NAME, 3248 3262 .target_alloc = srp_target_alloc, 3249 - .slave_alloc = srp_slave_alloc, 3250 3263 .slave_configure = srp_slave_configure, 3251 3264 .info = srp_target_info, 3252 3265 .queuecommand = srp_queuecommand, ··· 3779 3794 target_host->max_lun = -1LL; 3780 3795 target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb; 3781 3796 target_host->max_segment_size = ib_dma_max_seg_size(ibdev); 3797 + 3798 + if (!(ibdev->attrs.device_cap_flags & IB_DEVICE_SG_GAPS_REG)) 3799 + target_host->virt_boundary_mask = ~srp_dev->mr_page_mask; 3782 3800 3783 3801 target = host_to_target(target_host); 3784 3802