Re: [PATCH 06/24] virtio_scsi: use reserved commands for TMF

2019-05-30 Thread Hannes Reinecke

On 5/30/19 2:35 PM, John Garry wrote:

On 29/05/2019 14:28, Hannes Reinecke wrote:


 static int virtscsi_map_queues(struct Scsi_Host *shost)
@@ -827,6 +830,8 @@ static int virtscsi_probe(struct virtio_device *vdev)
 shost->max_channel = 0;
 shost->max_cmd_len = VIRTIO_SCSI_CDB_SIZE;
 shost->nr_hw_queues = num_queues;
+    shost->can_queue -= VIRTIO_SCSI_RESERVED_CMDS;


shost->can_queue is already referenced after it is set earlier in 
virtscsi_probe(), so I wonder if this is ok to later revise it? See:


shost->cmd_per_lun = min_t(u32, cmd_per_lun, shost->can_queue);


Yeah, I think it is correct.
But I'll be checking.

Cheers,

Hannes


Re: [PATCH 06/24] virtio_scsi: use reserved commands for TMF

2019-05-30 Thread John Garry

On 29/05/2019 14:28, Hannes Reinecke wrote:


 static int virtscsi_map_queues(struct Scsi_Host *shost)
@@ -827,6 +830,8 @@ static int virtscsi_probe(struct virtio_device *vdev)
shost->max_channel = 0;
shost->max_cmd_len = VIRTIO_SCSI_CDB_SIZE;
shost->nr_hw_queues = num_queues;
+   shost->can_queue -= VIRTIO_SCSI_RESERVED_CMDS;


shost->can_queue is already referenced after it is set earlier in 
virtscsi_probe(), so I wonder if this is ok to later revise it? See:


shost->cmd_per_lun = min_t(u32, cmd_per_lun, shost->can_queue);

thanks,
John


+   shost->nr_reserved_cmds = VIRTIO_SCSI_RESERVED_CMDS;

 #ifdef CONFIG_BLK_DEV_INTEGRITY
if (virtio_has_feature(vdev, VIRTIO_SCSI_F_T10_PI)) {
@@ -928,45 +933,12 @@ static struct virtio_driver virtio_scsi_driver = {