Skip to content

Commit

Permalink
feat: Add forceNVME flag
Browse files Browse the repository at this point in the history
NVMe devices are detected through the `nvme` prefix, which can be
unreliable and require explicit specification. This PR adds forceNVME
flag to force NVMe protocol to communicate with the backend device.

Signed-off-by: Ameer Hamza <[email protected]>
  • Loading branch information
ixhamza authored and vonericsen committed Feb 14, 2024
1 parent 5d8101a commit 3d1763a
Show file tree
Hide file tree
Showing 32 changed files with 287 additions and 17 deletions.
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_Basics.8
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_Configure.8
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_Erase.8
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_Firmware.8
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_Format.8
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_GenericTests.8
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_Info.8
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_Logs.8
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_NVMe.8
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Include the output of \fB\-\-version\fR information in the email.
.IP
Display the Seagate End User License Agreement (EULA).
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-\-modelMatch\fR [model Number]
.IP
Use this option to run on all drives matching the provided
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_PassthroughTest.8
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_PowerControl.8
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_Reservations.8
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_SMART.8
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_Security.8
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 6 additions & 0 deletions docs/man/man8/openSeaChest_ZBD.8
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ Using this option will force the current drive to
be treated as a SCSI drive. Only SCSI commands will
be used to talk to the drive.
.HP
\fB\-\-forceNVME\fR
.IP
Using this option will force the current drive to
be treated as a NVME drive. Only NVME commands will
be used to talk to the drive.
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Show utility options and example usage (this output you see now)
Expand Down
6 changes: 5 additions & 1 deletion include/openseachest_util_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,27 +170,31 @@ extern "C"

#define FORCE_SCSI_FLAG forceSCSI
#define FORCE_ATA_FLAG forceATA
#define FORCE_NVME_FLAG forceNVME
#define FORCE_ATA_PIO_FLAG forcePIOATA
#define FORCE_ATA_DMA_FLAG forceATADMA
#define FORCE_ATA_UDMA_FLAG forceATAUDMA
#define FORCE_DRIVE_TYPE_VARS\
getOptBool FORCE_SCSI_FLAG = goFalse;\
getOptBool FORCE_ATA_FLAG = goFalse;\
getOptBool FORCE_NVME_FLAG = goFalse;\
getOptBool FORCE_ATA_PIO_FLAG = goFalse;\
getOptBool FORCE_ATA_DMA_FLAG = goFalse;\
getOptBool FORCE_ATA_UDMA_FLAG = goFalse;
#define FORCE_SCSI_LONG_OPT_STRING "forceSCSI"
#define FORCE_SCSI_LONG_OPT { FORCE_SCSI_LONG_OPT_STRING, no_argument, &FORCE_SCSI_FLAG, goTrue }
#define FORCE_ATA_LONG_OPT_STRING "forceATA"
#define FORCE_ATA_LONG_OPT { FORCE_ATA_LONG_OPT_STRING, no_argument, &FORCE_ATA_FLAG, goTrue }
#define FORCE_NVME_LONG_OPT_STRING "forceNVME"
#define FORCE_NVME_LONG_OPT { FORCE_NVME_LONG_OPT_STRING, no_argument, &FORCE_NVME_FLAG, goTrue }
#define FORCE_ATA_PIO_LONG_OPT_STRING "forceATAPIO"
#define FORCE_ATA_PIO_LONG_OPT { FORCE_ATA_PIO_LONG_OPT_STRING, no_argument, &FORCE_ATA_PIO_FLAG, goTrue }
#define FORCE_ATA_DMA_LONG_OPT_STRING "forceATADMA"
#define FORCE_ATA_DMA_LONG_OPT { FORCE_ATA_DMA_LONG_OPT_STRING, no_argument, &FORCE_ATA_DMA_FLAG, goTrue }
#define FORCE_ATA_UDMA_LONG_OPT_STRING "forceATAUDMA"
#define FORCE_ATA_UDMA_LONG_OPT { FORCE_ATA_UDMA_LONG_OPT_STRING, no_argument, &FORCE_ATA_UDMA_FLAG, goTrue }
#define FORCE_DRIVE_TYPE_LONG_OPTS \
FORCE_SCSI_LONG_OPT, FORCE_ATA_LONG_OPT, FORCE_ATA_PIO_LONG_OPT, FORCE_ATA_DMA_LONG_OPT, FORCE_ATA_UDMA_LONG_OPT
FORCE_SCSI_LONG_OPT, FORCE_ATA_LONG_OPT, FORCE_NVME_LONG_OPT, FORCE_ATA_PIO_LONG_OPT, FORCE_ATA_DMA_LONG_OPT, FORCE_ATA_UDMA_LONG_OPT

#define USE_MAX_LBA useMaxLBA
#define USE_CHILD_MAX_LBA useChildMaxLBA
Expand Down
13 changes: 12 additions & 1 deletion utils/C/openSeaChest/openSeaChest_Basics.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
////////////////////////
const char *util_name = "openSeaChest_Basics";

const char *buildVersion = "3.5.4";
const char *buildVersion = "3.6.0";

////////////////////////////
// functions to declare //
Expand Down Expand Up @@ -818,6 +818,8 @@ int main(int argc, char *argv[])
}

if ((FORCE_SCSI_FLAG && FORCE_ATA_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG && FORCE_ATA_UDMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_UDMA_FLAG)
Expand Down Expand Up @@ -1096,6 +1098,15 @@ int main(int argc, char *argv[])
deviceList[deviceIter].drive_info.drive_type = ATA_DRIVE;
}

if (FORCE_NVME_FLAG)
{
if (VERBOSITY_QUIET < toolVerbosity)
{
printf("\tForcing NVME Drive\n");
}
deviceList[deviceIter].drive_info.drive_type = NVME_DRIVE;
}

if (FORCE_ATA_PIO_FLAG)
{
if (VERBOSITY_QUIET < toolVerbosity)
Expand Down
13 changes: 12 additions & 1 deletion utils/C/openSeaChest/openSeaChest_Configure.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// Global Variables //
////////////////////////
const char *util_name = "openSeaChest_Configure";
const char *buildVersion = "2.6.0";
const char *buildVersion = "2.7.0";

////////////////////////////
// functions to declare //
Expand Down Expand Up @@ -1493,6 +1493,8 @@ int32_t main(int argc, char *argv[])
}

if ((FORCE_SCSI_FLAG && FORCE_ATA_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG && FORCE_ATA_UDMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_UDMA_FLAG)
Expand Down Expand Up @@ -1790,6 +1792,15 @@ int32_t main(int argc, char *argv[])
deviceList[deviceIter].drive_info.drive_type = ATA_DRIVE;
}

if (FORCE_NVME_FLAG)
{
if (VERBOSITY_QUIET < toolVerbosity)
{
printf("\tForcing NVME Drive\n");
}
deviceList[deviceIter].drive_info.drive_type = NVME_DRIVE;
}

if (FORCE_ATA_PIO_FLAG)
{
if (VERBOSITY_QUIET < toolVerbosity)
Expand Down
13 changes: 12 additions & 1 deletion utils/C/openSeaChest/openSeaChest_Erase.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
// Global Variables //
////////////////////////
const char *util_name = "openSeaChest_Erase";
const char *buildVersion = "4.3.6";
const char *buildVersion = "4.4.0";

typedef enum _eSeaChestEraseExitCodes
{
Expand Down Expand Up @@ -1145,6 +1145,8 @@ int32_t main(int argc, char *argv[])
}

if ((FORCE_SCSI_FLAG && FORCE_ATA_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG && FORCE_ATA_UDMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_UDMA_FLAG)
Expand Down Expand Up @@ -1466,6 +1468,15 @@ int32_t main(int argc, char *argv[])
deviceList[deviceIter].drive_info.drive_type = ATA_DRIVE;
}

if (FORCE_NVME_FLAG)
{
if (VERBOSITY_QUIET < toolVerbosity)
{
printf("\tForcing NVME Drive\n");
}
deviceList[deviceIter].drive_info.drive_type = NVME_DRIVE;
}

if (FORCE_ATA_PIO_FLAG)
{
if (VERBOSITY_QUIET < toolVerbosity)
Expand Down
13 changes: 12 additions & 1 deletion utils/C/openSeaChest/openSeaChest_Firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// Global Variables //
////////////////////////
const char *util_name = "openSeaChest_Firmware";
const char *buildVersion = "4.0.0";
const char *buildVersion = "4.1.0";

typedef enum _eSeaChestFirmwareExitCodes
{
Expand Down Expand Up @@ -566,6 +566,8 @@ int32_t main(int argc, char *argv[])
}

if ((FORCE_SCSI_FLAG && FORCE_ATA_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG && FORCE_ATA_UDMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_UDMA_FLAG)
Expand Down Expand Up @@ -850,6 +852,15 @@ int32_t main(int argc, char *argv[])
deviceList[deviceIter].drive_info.drive_type = ATA_DRIVE;
}

if (FORCE_NVME_FLAG)
{
if (VERBOSITY_QUIET < toolVerbosity)
{
printf("\tForcing NVME Drive\n");
}
deviceList[deviceIter].drive_info.drive_type = NVME_DRIVE;
}

if (FORCE_ATA_PIO_FLAG)
{
if (VERBOSITY_QUIET < toolVerbosity)
Expand Down
13 changes: 12 additions & 1 deletion utils/C/openSeaChest/openSeaChest_Format.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// Global Variables //
////////////////////////
const char *util_name = "openSeaChest_Format";
const char *buildVersion = "3.0.4";
const char *buildVersion = "3.1.0";

////////////////////////////
// functions to declare //
Expand Down Expand Up @@ -765,6 +765,8 @@ int32_t main(int argc, char *argv[])
}

if ((FORCE_SCSI_FLAG && FORCE_ATA_FLAG)
|| (FORCE_SCSI_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_FLAG && FORCE_NVME_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG && FORCE_ATA_UDMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_DMA_FLAG)
|| (FORCE_ATA_PIO_FLAG && FORCE_ATA_UDMA_FLAG)
Expand Down Expand Up @@ -1082,6 +1084,15 @@ int32_t main(int argc, char *argv[])
deviceList[deviceIter].drive_info.drive_type = ATA_DRIVE;
}

if (FORCE_NVME_FLAG)
{
if (VERBOSITY_QUIET < toolVerbosity)
{
printf("\tForcing NVME Drive\n");
}
deviceList[deviceIter].drive_info.drive_type = NVME_DRIVE;
}

if (FORCE_ATA_PIO_FLAG)
{
if (VERBOSITY_QUIET < toolVerbosity)
Expand Down
Loading

0 comments on commit 3d1763a

Please sign in to comment.