]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: vhost: Notify TCM about the maximum sg entries supported per command
authorSudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com>
Fri, 22 May 2020 16:51:57 +0000 (16:51 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 May 2020 19:52:08 +0000 (15:52 -0400)
commit35e5fa9bc42dab6f7e57f62ba93c7f453150b29e
tree4437142f6c51f90e76d9fd084f71bcae3f6252b9
parent472df24af39c30e60a2c8d07c7f932ab8d5eecfc
scsi: vhost: Notify TCM about the maximum sg entries supported per command

vhost-scsi pre-allocates the maximum sg entries per command and if a
command requires more than VHOST_SCSI_PREALLOC_SGLS entries, then that
command is failed by it. This patch lets vhost communicate the max sg limit
when it registers vhost_scsi_ops with TCM. With this change, TCM would
report the max sg entries through "Block Limits" VPD page which will be
typically queried by the SCSI initiator during device discovery. By knowing
this limit, the initiator could ensure the maximum transfer length is less
than or equal to what is reported by vhost-scsi.

Link: https://lore.kernel.org/r/1590166317-953-1-git-send-email-sudhakar.panneerselvam@oracle.com
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Sudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/vhost/scsi.c