Skip to content

Convert FibreChannel bsg code to use bsg-lib

Johannes Thumshirn linux-block linux-s390 linux-scsi linuxppc-dev lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest15 patches 2 repliesIn review
  2. v316 patches 20 repliesSuperseded
  3. v216 patches 26 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v144 patches3 repliesSuperseded

Changes to v1 from the cover letter

* Reduce the number of individual patches (44 -> 16)
* Fix s390 build failure (forgotten to kill fc_bsg_job from zfcp_ext.h)
* Fix build failure on configs without CONFIG_BLK_DEV_BSGLIB
* Make bsg_job_get() call kref_get_unless_zero() and use it in scsi_transport_fc.c

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15scsi: Get rid of struct fc_bsg_bufferdrivers/scsi/lpfc/lpfc_bsg.c drivers/scsi/scsi_transport_fc.c include/scsi/scsi_transport_fc.h+6 -110 replies
2/15scsi: don't use fc_bsg_job::request and fc_bsg_job::reply directlydrivers/s390/scsi/zfcp_fc.c drivers/scsi/bfa/bfad_bsg.c drivers/scsi/ibmvscsi/ibmvfc.c +7 more+398 -2751 reply
3/15scsi: fc: Export fc_bsg_jobdone and use it in FC driversdrivers/s390/scsi/zfcp_fc.c drivers/scsi/bfa/bfad_bsg.c drivers/scsi/ibmvscsi/ibmvfc.c +5 more+119 -630 replies
4/15scsi: fc: provide fc_bsg_to_shost() helperdrivers/s390/scsi/zfcp_fc.c drivers/scsi/bfa/bfad_bsg.c drivers/scsi/ibmvscsi/ibmvfc.c +5 more+59 -540 replies
5/15scsi: fc: provide fc_bsg_to_rport() helperdrivers/s390/scsi/zfcp_fc.c drivers/scsi/ibmvscsi/ibmvfc.c drivers/scsi/libfc/fc_lport.c +4 more+19 -110 replies
6/15scsi: libfc: don't set FC_RQST_STATE_DONE before calling fc_bsg_jobdone()drivers/scsi/libfc/fc_lport.c+0 -20 replies
7/15scsi: fc: implement kref backed reference countingdrivers/scsi/scsi_transport_fc.c include/scsi/scsi_transport_fc.h+12 -321 reply
8/15block: add reference counting for struct bsg_jobblock/bsg-lib.c include/linux/bsg-lib.h+7 -20 replies
8/15block: add reference counting for struct bsg_jobblock/bsg-lib.c include/linux/bsg-lib.h+7 -20 replies
9/15scsi: change FC drivers to use 'struct bsg_job'drivers/s390/scsi/zfcp_ext.h drivers/s390/scsi/zfcp_fc.c drivers/scsi/bfa/bfad_bsg.c +14 more+139 -1640 replies
10/15scsi: fc: Use bsg_destroy_jobblock/bsg-lib.c drivers/scsi/Kconfig drivers/scsi/scsi_transport_fc.c +1 more+10 -240 replies
11/15scsi: fc: use bsg_softirq_doneblock/bsg-lib.c drivers/scsi/scsi_transport_fc.c include/linux/bsg-lib.h+5 -140 replies
12/15scsi: fc: use bsg_job_donedrivers/s390/scsi/zfcp_fc.c drivers/scsi/bfa/bfad_bsg.c drivers/scsi/ibmvscsi/ibmvfc.c +5 more+51 -880 replies
13/15block: add bsg_job_put() and bsg_job_get()block/bsg-lib.c drivers/scsi/scsi_transport_fc.c include/linux/bsg-lib.h+18 -60 replies
14/15scsi: fc: move FC transport's bsg code to bsg-libdrivers/scsi/scsi_transport_fc.c+43 -2420 replies
15/15block: unexport bsg_softirq_done() againblock/bsg-lib.c include/linux/bsg-lib.h+1 -30 replies
15/15block: unexport bsg_softirq_done() againblock/bsg-lib.c include/linux/bsg-lib.h+1 -30 replies

Reviews trailers per patch

All 17 patches have a Reviewed-by or Acked-by.

PatchHannes ReineckeChristoph HellwigTyrel Datwyler
1/15R-b R-b
2/15R-b A-b
3/15R-b R-b A-b
4/15R-b A-b
5/15R-b A-b
6/15R-b
7/15R-b
8/15R-b R-b
8/15R-b R-b
9/15R-b A-b
10/15R-b
11/15R-b
12/15R-b A-b
13/15R-b
14/15R-b
15/15R-b R-b
15/15R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH RESEND v4 00/15] Convert FibreChannel bsg code to use bsg-lib

This series converts the current bsg usage in the FibreChannel drivers over to use bsg-lib. SAS will follow once FC is in a good enough shape.

I did take some inspiration from a similar patchset from Mike Christie dating back to 2011 but it's not a 1:1 copy. Patch 15/16 is heavily based on his series and attribution is given to him in the commit message.

It is currently regression tested on FCoE and lpfc using the 'fcns', 'fcrls' and 'fcping' (see my FC_BSG_RPT_ELS patch for fcping) utilities and zfcp_show/zfcp_ping on s390x.

The idea for this change arose when discussing racy sysfs handling the FC bsg code with Christoph and is a next step in moving all bsg clients to bsg-lib to eventually clean up the in kernel bsg API.

Changes to v1:
* Reduce the number of individual patches (44 -> 16)
* Fix s390 build failure (forgotten to kill fc_bsg_job from zfcp_ext.h)
* Fix build failure on configs without CONFIG_BLK_DEV_BSGLIB
* Make bsg_job_get() call kref_get_unless_zero() and use it in scsi_transport_fc.c

Changes to v2:
* Add Hannes' Reviewd-by tags
* Address Hannes' comment about kref handling in 8/16
* Move CONFIG_BLK_DEV_BSGLIB dependency to patch 12/16 as per 0day results

Changes to v3:
* Rebase on mkp/4.10/scsi-queue (and fixup the new lpfc bsg function)
* Move checks for request and reply len before accessing them (hopefully fixes zfcp)
* Added Tyrel's Acked-bys
* Added Christoph's Reviewed-bys
* Squashed bsg_job_done patches as requested by Christoph
* Fixed the hopefully last bisection breaking point
* Fixed kernel panic on s390 with patch 2/15
* Fixed kernel panic on s390 with patch 5/15
* Fixed zfcp_show output on s390 with patch 4/15

Johannes Thumshirn (15):
scsi: Get rid of struct fc_bsg_buffer
scsi: don't use fc_bsg_job::request and fc_bsg_job::reply directly
scsi: fc: Export fc_bsg_jobdone and use it in FC drivers
scsi: fc: provide fc_bsg_to_shost() helper
scsi: fc: provide fc_bsg_to_rport() helper
scsi: libfc: don't set FC_RQST_STATE_DONE before calling
fc_bsg_jobdone()
scsi: fc: implement kref backed reference counting
block: add reference counting for struct bsg_job
scsi: change FC drivers to use 'struct bsg_job'
scsi: fc: Use bsg_destroy_job
scsi: fc: use bsg_softirq_done
scsi: fc: use bsg_job_done
block: add bsg_job_put() and bsg_job_get()
scsi: fc: move FC transport's bsg code to bsg-lib
block: unexport bsg_softirq_done() again

 block/bsg-lib.c                  |  23 +-
 drivers/s390/scsi/zfcp_ext.h     |   4 +-
 drivers/s390/scsi/zfcp_fc.c      |  36 ++--
 drivers/scsi/Kconfig             |   1 +
 drivers/scsi/bfa/bfad_bsg.c      |  62 +++---
 drivers/scsi/bfa/bfad_im.h       |   4 +-
 drivers/scsi/ibmvscsi/ibmvfc.c   |  40 ++--
 drivers/scsi/libfc/fc_lport.c    |  47 ++--
 drivers/scsi/lpfc/lpfc_bsg.c     | 387 +++++++++++++++++++--------------
 drivers/scsi/lpfc/lpfc_crtn.h    |   4 +-
 drivers/scsi/qla2xxx/qla_bsg.c   | 449 ++++++++++++++++++++++-----------------
 drivers/scsi/qla2xxx/qla_def.h   |   2 +-
 drivers/scsi/qla2xxx/qla_gbl.h   |   4 +-
 drivers/scsi/qla2xxx/qla_iocb.c  |  13 +-
 drivers/scsi/qla2xxx/qla_isr.c   |  52 +++--
 drivers/scsi/qla2xxx/qla_mr.c    |  15 +-
 drivers/scsi/scsi_transport_fc.c | 433 +++++++------------------------------
 include/linux/bsg-lib.h          |   4 +
 include/scsi/libfc.h             |   2 +-
 include/scsi/scsi_transport_fc.h |  62 ++----
 20 files changed, 770 insertions(+), 874 deletions(-)
Signature · 1 line
1.8.5.6