mbox series

[00/15] Subject: Protection information and block size cleanup

Message ID 20210609033929.3815-1-martin.petersen@oracle.com (mailing list archive)
Headers show
Series Subject: Protection information and block size cleanup | expand

Message

Martin K. Petersen June 9, 2021, 3:39 a.m. UTC
This series cleans up how low-level device drivers go about handling
protection information. The SCSI midlayer provides a set of flags and
helpers but not all drivers currently use them. This series updates
the drivers to use the proper calls to query things like the
protection interval, reference tag seed value, etc.

In addition scsi_debug is enhanced to validate and store protection
information the same way as a regular PI-capable disk drive or
SSD. With these changes scsi_debug is now able to pass the same PI
qualification tests as physical hardware.

And finally: Bart's recent series [1] attempted to clean up some of
the confusion between logical block addresses and block layer sector
addresses. Part of Bart's work is included in this series as well as
some fixes to the remainder of the scsi_get_lba() call sites.
Sometimes it is appropriate use sectors, in other cases logical blocks
are a better choice. For instance when printing something with a
reference tag given that the latter typically contains the lower 32
bits of the LBA.

The changes done in this series are also meant to facilitate removing
the request pointer from struct scsi_cmnd [2]. By removing several
references to struct request in the various drivers that transition
will now be easier.

[1] https://lore.kernel.org/linux-scsi/20210513223757.3938-1-bvanassche@acm.org/
[2] https://lore.kernel.org/linux-scsi/20210524030856.2824-1-bvanassche@acm.org/

--
Martin K. Petersen	Oracle Linux Engineering

Bart Van Assche (2):
  scsi: core: Introduce scsi_get_sector()
  scsi: iser: Use scsi_get_sector() instead of scsi_get_lba()

Martin K. Petersen (13):
  scsi: core: Add scsi_prot_ref_tag() helper
  scsi: lpfc: Use the proper SCSI midlayer interfaces for PI
  scsi: qla2xxx: Use the proper SCSI midlayer interfaces for PI
  scsi: mpt3sas: Use the proper SCSI midlayer interfaces for PI
  scsi: mpi3mr: Use the proper SCSI midlayer interfaces for PI
  scsi: zfcp: Use the proper SCSI midlayer interfaces for PI
  scsi: isci: Use the proper SCSI midlayer interfaces for PI
  scsi: scsi_debug: Remove dump_sector()
  scsi: scsi_debug: Improve RDPROTECT/WRPROTECT handling
  scsi: core: Make scsi_get_lba() return the LBA
  scsi: core: Add helper to return number of logical blocks in a request
  scsi: lpfc: Switch to scsi_get_block_count()
  scsi: ufs: core: Use scsi_get_lba() to get LBA

 drivers/infiniband/ulp/iser/iser_verbs.c |   2 +-
 drivers/s390/scsi/zfcp_fsf.c             |   4 +-
 drivers/scsi/isci/request.c              |   4 +-
 drivers/scsi/lpfc/lpfc_scsi.c            | 116 +++++++++--------------
 drivers/scsi/mpi3mr/mpi3mr_os.c          |  59 ++++--------
 drivers/scsi/mpt3sas/mpt3sas_scsih.c     |  28 ++----
 drivers/scsi/qla2xxx/qla_iocb.c          |  84 +++-------------
 drivers/scsi/scsi_debug.c                | 112 +++++++++++++---------
 drivers/scsi/ufs/ufshcd.c                |   3 +-
 include/scsi/scsi_cmnd.h                 |  25 ++++-
 10 files changed, 182 insertions(+), 255 deletions(-)

Comments

Bart Van Assche July 16, 2021, 9:27 p.m. UTC | #1
On 6/8/21 8:39 PM, Martin K. Petersen wrote:
> This series cleans up how low-level device drivers go about handling
> protection information. The SCSI midlayer provides a set of flags and
> helpers but not all drivers currently use them. This series updates
> the drivers to use the proper calls to query things like the
> protection interval, reference tag seed value, etc.

Hi Martin,

Do you plan to queue or repost this patch series?

Thanks,

Bart.
Martin K. Petersen July 19, 2021, 1:43 a.m. UTC | #2
Bart,

> Do you plan to queue or repost this patch series?

Yes. Still haven't pushed my 5.15 tree because I had several issues with
-rc1, including the configfs bug which broke most of my test setup. I am
rebasing to -rc2.
Bart Van Assche July 21, 2021, 3:53 a.m. UTC | #3
On 7/18/21 6:43 PM, Martin K. Petersen wrote:
> Yes. Still haven't pushed my 5.15 tree because I had several issues with
> -rc1, including the configfs bug which broke most of my test setup.
Hi Martin,

To test my configfs patch I used LIO scripts that I wrote many years
ago. It was only after I received a bug report that I realized that
these scripts only write configfs attributes but do not read any
configfs attribute. The configfs breakage shouldn't have happened but
this explains how read testing got overlooked.

Bart.
Martin K. Petersen July 24, 2021, 2:13 a.m. UTC | #4
On Tue, 8 Jun 2021 23:39:14 -0400, Martin K. Petersen wrote:

> This series cleans up how low-level device drivers go about handling
> protection information. The SCSI midlayer provides a set of flags and
> helpers but not all drivers currently use them. This series updates
> the drivers to use the proper calls to query things like the
> protection interval, reference tag seed value, etc.
> 
> In addition scsi_debug is enhanced to validate and store protection
> information the same way as a regular PI-capable disk drive or
> SSD. With these changes scsi_debug is now able to pass the same PI
> qualification tests as physical hardware.
> 
> [...]

Applied to 5.15/scsi-queue, thanks!

[01/15] scsi: core: Add scsi_prot_ref_tag() helper
        https://git.kernel.org/mkp/scsi/c/7ba46799d346
[03/15] scsi: qla2xxx: Use the proper SCSI midlayer interfaces for PI
        https://git.kernel.org/mkp/scsi/c/e2e9cd68fb3c
[06/15] scsi: zfcp: Use the proper SCSI midlayer interfaces for PI
        https://git.kernel.org/mkp/scsi/c/73e61d5c22bf
[08/15] scsi: scsi_debug: Remove dump_sector()
        https://git.kernel.org/mkp/scsi/c/c78be80d20cd
[09/15] scsi: scsi_debug: Improve RDPROTECT/WRPROTECT handling
        https://git.kernel.org/mkp/scsi/c/f7be677227a5
[10/15] scsi: core: Introduce scsi_get_sector()
        https://git.kernel.org/mkp/scsi/c/f0f214fe8cd3
[11/15] scsi: iser: Use scsi_get_sector() instead of scsi_get_lba()
        https://git.kernel.org/mkp/scsi/c/87662a472a9d
[12/15] scsi: core: Make scsi_get_lba() return the LBA
        https://git.kernel.org/mkp/scsi/c/d2c945f01d23
[15/15] scsi: ufs: core: Use scsi_get_lba() to get LBA
        https://git.kernel.org/mkp/scsi/c/54815088859f