Skip to contentSkip to conversation

scsi_debug: Make CRC_T10DIF support optional

PATCH Superseded Bart Van Assche 2 participants 5 messages Feb 29, 2024 – Mar 1, 2024 SCSI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi_debug: Make CRC_T10DIF support optional

Not all scsi_debug users need data integrity support. Hence modify the scsi_debug driver such that it becomes possible to build this driver without data integrity support.

---
 drivers/scsi/Kconfig                          |   2 +-
 drivers/scsi/Makefile                         |   2 +
 drivers/scsi/scsi_debug-dif.h                 |  65 +++++
 drivers/scsi/scsi_debug_dif.c                 | 224 +++++++++++++++
 .../scsi/{scsi_debug.c => scsi_debug_main.c}  | 257 ++----------------
 5 files changed, 308 insertions(+), 242 deletions(-)
 create mode 100644 drivers/scsi/scsi_debug-dif.h
 create mode 100644 drivers/scsi/scsi_debug_dif.c
 rename drivers/scsi/{scsi_debug.c => scsi_debug_main.c} (97%)
drivers/scsi/Kconfig +1 -1
index 3328052c8715..b7c92d7af73d 100644
@@ -1227,7 +1227,7 @@ config SCSI_WD719X
 config SCSI_DEBUG
 	tristate "SCSI debugging host and device simulator"
 	depends on SCSI
-	select CRC_T10DIF
+	select CRC_T10DIF if SCSI_DEBUG = y
 	help
 	  This pseudo driver simulates one or more hosts (SCSI initiators),
 	  each with one or more targets, each with one or more logical units.
drivers/scsi/Makefile +2 -0
index 1313ddf2fd1a..6287d9d65f04 100644
@@ -156,6 +156,8 @@ obj-$(CONFIG_SCSI_HISI_SAS) += hisi_sas/
 
 # This goes last, so that "real" scsi devices probe earlier
 obj-$(CONFIG_SCSI_DEBUG)	+= scsi_debug.o
+scsi_debug-y			+= scsi_debug_main.o
+scsi_debug-$(CONFIG_CRC_T10DIF) += scsi_debug_dif.o
 scsi_mod-y			+= scsi.o hosts.o scsi_ioctl.o \
 				   scsicam.o scsi_error.o scsi_lib.o
 scsi_mod-$(CONFIG_SCSI_CONSTANTS) += constants.o
drivers/scsi/scsi_debug-dif.h new file +65 -0

65 lines not on this page · raw message

drivers/scsi/scsi_debug_dif.c new file +224 -0

224 lines not on this page · raw message

drivers/scsi/scsi_debug_main.c renamed from drivers/scsi/scsi_debug.c +16 -241

359 lines not on this page · raw message

#1 lore raw
Quoted 6 lines · Bart Van Assche

Not all scsi_debug users need data integrity support. Hence modify the scsi_debug driver such that it becomes possible to build this driver without data integrity support.

Quoted 7 lines
---
  drivers/scsi/Kconfig                          |   2 +-
  drivers/scsi/Makefile                         |   2 +
  drivers/scsi/scsi_debug-dif.h                 |  65 +++++
  drivers/scsi/scsi_debug_dif.c                 | 224 +++++++++++++++
  .../scsi/{scsi_debug.c => scsi_debug_main.c}  | 257 ++----------------
  5 files changed, 308 insertions(+), 242 deletions(-)

That's a pretty light commit message for so many modifications.

Thanks,
John

#2 lore raw
Quoted 15 lines · John Garry
Quoted 6 lines · Bart Van Assche

Not all scsi_debug users need data integrity support. Hence modify the scsi_debug driver such that it becomes possible to build this driver without data integrity support.

Quoted 7 lines

---
  drivers/scsi/Kconfig                          |   2 +- drivers/scsi/Makefile                         |   2 + drivers/scsi/scsi_debug-dif.h                 |  65 +++++ drivers/scsi/scsi_debug_dif.c                 | 224 +++++++++++++++ .../scsi/{scsi_debug.c => scsi_debug_main.c}  | 257 ++----------------

  5 files changed, 308 insertions(+), 242 deletions(-)
Quoted 1 line

That's a pretty light commit message for so many modifications.

Hi John,

Thanks for having taken a look. The patch description is short because this patch doesn't do much: it splits the scsi_debug source code in two files and modifies the Kconfig and Makefile. No functional changes are present in this patch.

Thanks,

Bart.

#3 lore raw
Quoted 18 lines · Bart Van Assche
Quoted 14 lines
Quoted 6 lines

Not all scsi_debug users need data integrity support. Hence modify the scsi_debug driver such that it becomes possible to build this driver without data integrity support.

Quoted 7 lines

---
  drivers/scsi/Kconfig                          |   2 +- drivers/scsi/Makefile                         |   2 + drivers/scsi/scsi_debug-dif.h                 |  65 +++++ drivers/scsi/scsi_debug_dif.c                 | 224 +++++++++++++++ .../scsi/{scsi_debug.c => scsi_debug_main.c}  | 257 ++----------------

  5 files changed, 308 insertions(+), 242 deletions(-)
Quoted 1 line

That's a pretty light commit message for so many modifications.

Hi John,

Quoted 7 lines

Thanks for having taken a look. The patch description is short because this patch doesn't do much: it

splits the scsi_debug source code in two
files and modifies the Kconfig and Makefile. No functional changes are present in this patch.

I think that this info is useful.

About this:

drivers/scsi/Kconfig config SCSI_WD719X · line 1230

Quoted 5 lines · Bart Van Assche

config SCSI_DEBUG
tristate "SCSI debugging host and device simulator" depends on SCSI

drivers/scsi/Kconfig +1 -1
-	select CRC_T10DIF
+	select CRC_T10DIF if SCSI_DEBUG = y

So this means that we select CRC_T10DIF if SCSI_DEBUG is only built-in, right?

Thanks,
John

#4 lore raw
Quoted 8 lines · John Garry
Quoted 5 lines · Bart Van Assche

   config SCSI_DEBUG
       tristate "SCSI debugging host and device simulator" depends on SCSI
-    select CRC_T10DIF
+    select CRC_T10DIF if SCSI_DEBUG = y

So this means that we select CRC_T10DIF if SCSI_DEBUG is only built-in, right?

Yes, that's correct. Without "select CRC_T10DIF if SCSI_DEBUG = y" the build fails if CRC_T10DIF=m and SCSI_DEBUG=y.

Thanks,

Bart.