Fundamental Data Types

Class SKStorageDevice

An object representing a storage device. The following are essential parameters for each storage object. For a complete list, see SKDeviceInfo data structure in file StorKitStructures.h.

Parameter Type Description
Device path String Logical storage path provided by OS. Example, on Linux, they are /dev/sda, /dev/sdb, etc.

On Windows, they are \\.\PhysicalDrive0, etc.

Device type SKDeviceType SATA/ATA device, SCSI device, or NVMe device. This parameter indicates which protocol will be used or structure of the device information, or will be used to determine the security protocol of the device
Is Boot device Boolean It is important to know if the type of device is a boot device. Precaution must be taken for boot devices.
Device model String Model name of the device.
Serial Number String Unique serial number of the device.

Core and vtView Functions

The following table summarizes the key functions of StorKit. These functions are used in every application that utilizes StorKit.

  Functions Description
Common Common functions that are used at the beginning of every operation
Scan Device

SKStorageDeviceUtils::scanDevices

Scan for storage devices. This is the first function that every application will do. This function returns a list of storages that it can detect and communicate with.
Read device identify

SKCCoreDelegate::identifyDevice

This function is to retrieve device identify information, which provides information about what device this is, serial number, supported features and current settings
vtView Normal sequence to collect log is shown below
Setup “vtView logging” conditions. Set values for this structure SKCLogSetting Setup to collect vtView data:

·       Drive(s) to collect

·       How long to collect

·       Collection frequency

·       Log file name

Start logging vtView data

SKCCoreDelegate::startLogging

Start the logging process. The logging will be started and based on the “vtView logging” conditions
Log SMART attributes on demand.

SKCCoreDelegate::addLogLine

This function is to read current SMART attributes and add to the log immediately.

This is useful when we need to capture current values of SMART attributes due to a specific circumstance in the system.

Stop logging vtView data

SKCCoreDelegate::stopLogging

Stop vtView logging. Stop logging is necessary to start the analysis. The current log file is closed.
vtView Analyze data and get life span information
Load log data

SKCCoreDelegate::loadLogData

Load vtView log data into memory and prepare for analysis
Perform analysis and get vtView result

SKCCoreDelegate::getUsageStatistics

Instruct StorKit to perform analysis on vtView log file and return results.
Retrieve power off data retention estimates

SKCCoreDelegate::getPowerOffDataRetentionEstimate

Retrieve estimates on data retention from the current time. It is particularly useful to print label for SSD regarding data retention during power off.

Power off data retention on SSD is limited and based on NAND erase count information.

Release log data. It is necessary to call this function.

SKCCoreDelegate::releaseLogData

This function is the trigger for StorKit to release all memory allocated when it loaded vtView log into memory for the analysis.
Others More useful functions for software or production tool
Read SMART attributes

SKCCoreDelegate::readSmart

Retrieve SMART attributes from the device. This function reads the raw data, then interprets the data for your application to consume.
Save current state

SKCCoreDelegate::saveCurrentState

Save current state of the device: identify device and current settings, current value of SMART attribute.

This function is to save state of the device before a test and after a test or save the state as part of your production flow.

Is Virtium SSD?

SKCCoreDelegate::isVirtiumDevice

StorKit can only calculate vtView results accurately with Virtium’s SSD. This function help distinguish Virtium device from other vendors.
Export identify device information in binary format.

SKCCoreDelegate::exportIdentifyBinary (file)

Export identify device information of an SSD to a file in binary format.

It is useful when we need to compare features and settings of two firmware versions or two SSD. Use this with function SKCCoreDelegate::compareIdentify

SKStorageDeviceUtils::scanDevices

This method scans for storage devices in the system. The input parameter for this method is a reference pointer to a standard library vector, SKStorageDevice list, which will contain storage objects upon the method completes its execution.

This method will scan, communicate, and retrieve information from storage devices. If information is retrieved successfully from a device, that device is added to SKStorageDevice list. Storages can be on USB, SATA, or NVMe bus.

If a storage is not detected, it either be on a bus that StorKit does not support yet, or there is an error with the device itself.

Declaration
     static void SKStorageDeviceUtils::scanDevices(std::vector<SKStorageDevice*> & storageDevices)

Parameters
     [out] A vector of SKStorageDevice that contains a list of attached and detected storage devices in the system

Returns
     N/A

Class SKCCoreDelegateFactory

This Factory class is used with the CoreDelegate class. It is a convenient and safe way to create, release, and manage CoreDelegate objects during runtime.

 

SKCCoreDelegateFactory::create

Method to create a CoreDelegate object and attach it to a storage device. This method creates the “right” CoreDelegate object for the type of the drive. For example, if a drive interface is SATA, a CoreDelegate object of type SATA will be created for this drive.

Declaration
     static SKCCoreDelegate* SKCCoreDelegateFactory::create (SKStorageDevice* storageDevice, bool freeStorageDevice = true)

Parameters
     [in] storageDevice  Pointer to a storage device object. See example usage.
[in] freeStorageDevice set to true if you would like the CoreDelegateFactory to manage this object deletion for you. The default value is true.

Set to false to manage deletion of the device object yourself. If you attach more than one StorKit delegates to a device object, set this to false.

Return
     SKCCoreDelegate object

Class SKCCoreDelegate

This object provides functions related vtView features. Key functions are listed below:

Identify Device: Retrieve information about the device, supported features, and its state (features are supported and enabled).

A typical sequence is:

  1. Scan for list of devices
  2. Set up logging parameters: frequency of logging, period for compute and send result, select drive(s) to analyze
  3. Start the logging
  4. Stop the logging
  5. Use vtView API to load data and analyze

SKCCoreDelegate::identifyDevice

Method to retrieve Identify Device information from a drive. Identify Device provides information about device information, feature settings and current state. StorKit delegate provides functions to retrieve essential information without the need to parse raw data and understanding the format of the data. Refer to SKDeviceInfo for latest information fields and their description.

Declaration
     SKDeviceInfo* SKCCoreDelegate::identifyDevice () const

Parameters
     N/A

Return
     An object contains the identify information – SKDeviceInfo

SKCCoreDelegate::readSmart

Method to retrieve SMART data from a drive.

Declaration
     SKCSmartInfo SKCCoreDelegate::readSmart () const

Parameters
     N/A

Return
     SKCSmartInfo object that contains the SMART information.

SKCCoreDelegate::saveCurrentStage

Method to save current device stage in a human readable format to a file on the system. The use cases for this method are:

  1. In your test environment, save device state before testing and after testing
  2. In your production environment, save device condition before shipping product to customers

Declaration
     bool SKCCoreDelegate::saveCurrentStage ()

Parameters
     N/A

Return
     True if succeeded, otherwise false

SKCCoreDelegate::startLogging

Method to initiate a start to log vtView data.

Declaration
     static SKCReturnCode SKCCoreDelegate::startLogging (const SKCLogSetting &setting)

Parameters
     [in] setting Logging setting for the session such as log file name, duration, frequency, list of device to log.

Return
     The return code that indicates the operation is success or not.

SKCCoreDelegate::stopLogging

Method to stop logging vtView data. This method is used when we want to make the data ready for analysis.

Declaration
     static SKCReturnCode SKCCoreDelegate::stopLogging()

Parameters
     N/A

Return
     The return code to indicate the function is succeed or not. If failed, the code indicates the failure reason.

SKCCoreDelegate::loadLogData

Method to specify the vtView data on which to perform the analysis. vtView data is saved in file(s). Each file represents a duration of data.

Declaration
     static bool SKCCoreDelegate::loadLogData(const std::string &filename)

Parameters
     [in] filename A log data file is used to calculate statistics

Return
     True if succeeded, otherwise false

SKCCoreDelegate::getUsageStatistics

Method performs the analysis on vtView data and returns vtView result.

Declaration
     static SKCReturnCode SKCCoreDelegate::getUsageStatistics(const SKCGetUsageSetting &setting, SKCUsageStatistics &lifeInfo)

Parameters
     [in] setting A setting to calculate usage statistics data such as device serial number, start record, number of records
[out] lifeInfo A statistics data calculated from the loaded log data

Return
     The return code to indicate the function is succeed or not.

Security Functions

The below table shows a summary of functions in the Security Delegate.

  Functions Description
Common Common functions that are used at the beginning of every operation
Scan Device

SKStorageDeviceUtils::scanDevices

Scan for storage devices. This is the first function that every application will do. This function returns a list of storages that it can detect and communicate with.
Read device identify

SKCCoreDelegate::identifyDevice

This function is to retrieve device identify information, which provides information about what device this is, serial number, supported features and current settings
Standard Standard ATA security function
Is security feature set supported?

SKSSecurityDelegate::isSecurityFeatureSetSupported

Determine if security feature set is supported.

If security feature set is supported, continue with security operation.

If security feature is not supported, it means set password, sanitize and secured erase are not supported.

Is security enabled?

SKSSecurityDelegate::isSecurityEnabled

If security feature set is supported and enabled, sanitize and secured erase are supported and ready.

If security feature set is supported and not enabled, enable security by setting master or user password.

Is security frozen?

SKSSecurityDelegate::isSecurityFrozen

System OS enables security frozen sometimes to protect data on SSD from external attack. This function returns current value of the security state (frozen or not frozen).

If the state is frozen, follow ATA procedure in ATA specification to unfreeze the drive before security feature can be executed.

Is security locked?

SKSSecurityDelegate::isSecurityLocked

Sanitize Sanitize feature set
Is sanitize feature supported?

SKSSecurityDelegate::isSanitizeSetSupported

Determine if sanitize feature is supported?
Is sanitize by block erase supported?

SKSSecurityDelegate::isSanitizeBlockEraseSupported

Determine if sanitize by block erase is supported. Security must also be enabled and unfrozen to sanitize to work.
Sanitize by block erase

SKSSecurityDelegate::sanitizeBlockErase

Instruct SSD to start sanitizing process by issuing physical erase of NAND blocks.
Is sanitize by crypto scramble supported?

SKSSecurityDelegate::isSanitizeCryptoScrambleSupported

Determine if sanitize by crypto scramble is supported. Security must also be enabled and unfrozen to sanitize to work.
Sanitize by crypto scramble

SKSSecurityDelegate::sanitizeCryptoScramble

Instruct SSD to start sanitizing process by changing crypto scramble key. Data will be scrambled but physical NAND are not erased.
Is sanitize by overwrite supported?

SKSSecurityDelegate::isSanitizeOverwriteSupported

Determine if sanitize by overwrite is supported.
Secure Erase Secure Erase functions
Initiate secure erase the device

SKSSecurityDelegate::secureErase

Initiate secure erase process on the device. Application can specify erase mode when invoke this function to perform secure erase.
TCG OPAL TCG OPAL functions
Is TCG OPAL supported?

SKSSecurityDelegate::isOpal20Supported

Determine if the device supports TCG OPAL security feature.
Is TCG OPAL feature initialized?

SKSSecurityDelegate::isOpalDeviceInitialized

To use TCG OPAL feature, it must be initialized. This function will check if it is initialized.
Setup TCG OPAL

SKSSecurityDelegate::initialSetup

Setup SID password for TCG OPAL.
Is PSID revert supported?

SKSSecurityDelegate::isPSIDRevertSupported

Determine if PSID revert is supported.
Initiate PSID revert.

SKSSecurityDelegate::psidRevert

Initiate PSID revert for the device.
Military Erase Will be released upon request

Class SKSSecurityDelegateFactory

A factory class is used to create a SKSSecurityDelegate objects.

Class SKSSecurityDelegate

This object provides functions related to security.

SKSSecurityDelegate::sanitizeBlockErase
SKSSecurityDelegate::sanitizeCryptoScramble
SKSSecurityDelegate::sanitizeOverwrite

Methods to initiate security commands to the SSD to sanitize the storage device with one of the following modes: Block Erase, Cryptographic Scramble, or Overwrite.

  • Block Erase will erase all physical NAND blocks.
  • Cryptographic Scramble will change the cryptographic key on the SSD. (This will cause the data to be scrambled. The physical NAND is not erased.)
  • Overwrite: This method initiates the sanitize method of overwrite the entire SSD with patterns.

Note: Not all drives support all three modes. Check for the supported modes and whether the modes are enabled before issue call to sanitize for that mode.

Declaration
     SKSSecurityReturnCode SKSSecurityDelegate::sanitizeBlockErase()
SKSSecurityReturnCode SKSSecurityDelegate::sanitizeCryptoScramble()
SKSSecurityReturnCode SKSSecurityDelegate::sanitizeOverwrite()

Parameters
     N/A

Returns
     The return code to indicate the function is succeeded or not succeeded. The table below lists return codes and possible remedies in case of error.

Return code for Security Delegate

Return Code Description
SKSSucceeded Command is successful
SKSErrorCommandFailed Cannot send the command to the drive. Device may have been removed or failed. Rescan for devices and send command again
SKSErrorNotAuthorized Require to un-lock device to get the authorization.
SKSErrorFeatureNotSupported The device does not support sanitize or secure erase feature
SKSErrorInvalidPassword Password is invalid
SKSErrorIO Command is failed at passthrough layer. Try again.
SKSErrorAbort Device aborts the command due to invalid parameter(s)
 SKSErrorPowerCycleRequired Need to power cycle to complete the feature
SKSErrorDeviceFrozen The device is frozen. Need to unfreeze and try again
SKSErrorSecurityLocked The device is locked. Need to unlock the device

SKSSecurityDelegate::secureErase

Methods to initiate secure erase on a storage device. There are two (2) erase modes: Normal and Enhanced. These modes are passed into the function as a parameter. A password is required for a secure erase. There are two (2) types of passwords: User and Master. Each password type results in a different outcome. Please reference the ATA Specification for information on which to use and when to use a master or user password.

Declaration
SKSSecurityReturnCode SKSSecurityDelegate::secureErase(SKSecureEraseMode mode, const std::string &password, bool isMasterPassword)

Parameters
     [in] mode: an enum to indicate Secure Erase mode (Normal or Enhanced)
[in] password: a string contains user or master password
[in] isMasterPassword: A bool to determine if password type is master, otherwise user

Returns
     The return code to indicate the function is succeeded or not succeeded. The previous table lists return codes and possible remedies in case of error.

SKSSecurityDelegate::psidRevert

Method to trigger PSID Revert on a storage device which supports TCG OPAL 2.0

Declaration
     SKSOpalReturnCode SKSSecurityDelegate::psidRevert(const std::string &psid)

Parameters
     [in] psid a string contains the PSID which is labeled on the device

Returns
     The return code to indicate whether the function is succeeded or not succeeded.

The table below  lists return codes for this function.

Return code for Security Delegate – TCG OPAL

Return Code Description
SKSSucceeded Command is successful
SKSErrorCommandFailed Cannot send the command to the drive
SKSErrorFeatureNotSupported The device does not support the feature
SKSErrorUnableDiscoveryOpalInfo Cannot retrieve the OPAL Info from the device
SKSErrorInvalidPSID The PSID is invalid
SKSErrorUnableReadMSIDPassword Cannot read the MSID password
SKSErrorTakeOwnershipFailed Cannot take ownership on the OPAL device
SKSErrorUnableActiveLockingSP Cannot activate a locking SP on the OPAL device
SKSErrorNotInitialized The OPAL device has not been initialized yet. Perform TCG OPAL setup then try again.

Test Functions

The below table show a summary of functions in the Test Delegate.

  Functions Description
Common Common functions that are used at the beginning of every operation
Scan Device

SKStorageDeviceUtils::scanDevices

Scan for storage devices. This is the first function that every application will do. This function returns a list of storages that it can detect and communicate with.
Read device identify

SKCCoreDelegate::identifyDevice

This function is to retrieve device identify information, which provides information about what device this is, serial number, supported features and current settings
Base Fundamental test functions
Write LBA

SKTTestDelegate::writeLBA

This function writes directly to storage device without the interference of the file system.

It is useful to test and debug storage device or measure response time from storage device.

Note: Only attempt this on blank storage or you know what you are doing with storage test and understanding how file system works.

Read LBA

SKTTestDelegate::readLBA

This function reads directly from storage device without the interference of the file system.
Sequential write test

SKTTestDelegate::sequentialWritePerformanceTest

This function performs a sequential write test on the storage device and return performance data. The performance data is calculated based on the amount data written and duration of the test.
Sequential read test

SKTTestDelegate::sequentialReadPerformanceTest

This function performs a sequential read test on the storage device and return performance data. The performance data is calculated based on the amount data read and duration of the test.
Random write test

SKTTestDelegate::randomWritePerformanceTest

This function performs a random write test on the storage device and return performance data. The performance data is calculated based on the amount data written and duration of the test.
Random read test

SKTTestDelegate::randomReadPerformanceTest

This function performs a random read test on the storage device and return performance data. The performance data is calculated based on the amount data read and duration of the test.
Plus More advanced test functions
Sequential write with unique pattern

SKTTestDelegate::sequentialWriteWithUniquePatterns

This function writes unique data pattern for each LBA. The data is written in way that it can be read and verified later without a need to store data in memory for verification.

The writes are sequential.

Random write with unique pattern

SKTTestDelegate::randomWriteWithUniquePatterns

This function writes unique data pattern for each LBA. The data is written in way that it can be read and verified later without a need to store data in memory for verification.

The writes are random.

Verify data integrity

SKTTestDelegate::verifyPreviousSequentialWriteData

SKTTestDelegate::verifyPreviousRandomWriteData

This function works in conjunction with “sequential write with unique pattern” or “random write with unique pattern.”

It reads data from the drive and use the information in the data itself to verify whether the data is OK or corrupted.

 

Class SKTTestDelegateFactory

A factory class is used to create a SKTTestDelegate object.

Class SKTTestDelegate

An object to support for Test Utilities.

Return Codes

Return codes Descriptions
SKTSucceeded No error
SKTErrorCommandFailed Error command failed
SKTErrorCommandCompletionTimeOut Error command completion time out
SKTErrorDeviceTypeUnsupported Error device type unsupported
SKTErrorVerifyData Verify data failed
SKTErrorDeviceFrozen Error device in frozen
SKTErrorSecurityLocked Error security in locked
SKTErrorLBAOutOfRange Error LBA out of range
SKTErrorSectorCountOutOfRange Error – sector count out of range
SKTErrorDeviceInfoNull Error – Device Identify is null
SKTErrorStartingMaxPowerConsumptionTest Error – Failed to start max power consumption test: failed to create thread, no resource, etc.
SKTErrorMaxPowerConsumptionTestAlreadyStarted Error – Test is already started
SKTErrorStopingMaxStartingPowerConsumptionTest Error – Failed to stop the test. Kill the command thread or restart the system
SKTErrorDiagnosticAlreadyStarted Error – Diagnostics is already started
SKTErrorDiagnosticAlreadyStopped Error – Diagnostics is already stopped

SKTTestDelegate::writeLBA

Method to perform direct write to a storage device. User specifies logical block address, number of sectors, and provides a buffer that contains contents.

Declaration
     SKTReturnCode SKSSecurityDelegate::writeLBA (U64 lba, U32 sectorCount, SKAlignedBuffer *buffer)

Parameters
     [in] lba – An U64 variable contains logic block address
[in] sectorCount – An U32 variable contain sector count
[out] A buffer object that contains the data

Returns
     Please see description in Test Delegate Return Code table.

SKTTestDelegate::readLba

method to perform direct read from a storage device. User specifies logical block address, number of sectors, and provides a buffer that contains read contents.

Declaration
     SKTReturnCode SKSSecurityDelegate::readLBA (U64 lba, U32 sectorCount, SKAlignedBuffer *buffer)

Parameters
     [in] lba – An U64 variable contains logic block address
[in] sectorCount – An U32 variable contain sector count
[out] A buffer object that contains the data

Returns
     Please see description in Test Delegate Return Code table.

SKTTestDelegate::sequentialWritePerformanceTest

This function performs a sequential write test on the storage device and return performance data. The performance data is calculated based on the amount data written and duration of the test.

Notes: StorKit Revision 1.0, only supports non the NCQ benchmark. This means to measure the actual response time of the storage.

Declaration
     SKTTestDelegate::sequentialWritePerformanceTest (SKTBenchmarkSpecificSetup & benchSpec, SKTBenchmarkReport & reportInfo)

Parameters
     [in] benchmark specification – Structure SKTBenchmarkSpecificSetup contains setup
information

struct SKTBenchmarkSpecificSetup

{

U32 blockSize;

U32 count;

};

 

[out] report – Structure SKTBenchmarkReport contains the results.

struct SKTBenchmarkReport

{

double speedInMbPerSec;

double timeResponseUs;

};

 

Returns

Please see description in Test Delegate Return Code table.

SKTTestDelegate::sequentialReadPerformanceTest

This function performs a sequential read test on the storage device and return performance data. The performance data is calculated based on the amount data read and duration of the test

Notes: For StorKit Revision 1.0, it only supports non NCQ benchmark. It means to measure the actual response time of the storage.

Declaration

SKTTestDelegate::sequentialReadPerformanceTest (SKTBenchmarkSpecificSetup & benchSpec, SKTBenchmarkReport & reportInfo )

Parameters

[in] benchmark specification – Structure SKTBenchmarkSpecificSetup contains setup

information

struct SKTBenchmarkSpecificSetup

{

U32 blockSize;

U32 count;

};

 

[out] report – Structure SKTBenchmarkReport contains the results.

struct SKTBenchmarkReport

{

double speedInMbPerSec;

double timeResponseUs;

};

 

Returns

Please see description in Test Delegate Return Code table.

SKTTestDelegate::randomWritePerformanceTest

This function performs a random write test on the storage device and return performance data. The performance data is calculated based on the amount data written and duration of the test.

Notes: For StorKit Revision 1.0, it only supports non NCQ benchmark. It means to measure the actual response time of the storage.

Declaration

SKTTestDelegate::randomWritePerformanceTest (SKTBenchmarkSpecificSetup & benchSpec, SKTBenchmarkReport & reportInfo )

Parameters

[in] benchmark specification – Structure SKTBenchmarkSpecificSetup contains setup

information

struct SKTBenchmarkSpecificSetup

{

U32 blockSize;

U32 count;

};

 

[out] report – Structure SKTBenchmarkReport contains the results.

struct SKTBenchmarkReport

{

double speedInMbPerSec;

double timeResponseUs;

};

 

Returns

Please see description in Test Delegate Return Code table.

SKTTestDelegate::randomReadPerformanceTest

This function performs a random read test on the storage device and return performance data. The performance data is calculated based on the amount data read and duration of the test.

Notes: For StorKit Revision 1.0, it only supports non NCQ benchmark. It means to measure the actual response time of the storage.

Declaration

SKTTestDelegate::randomReadPerformanceTest (SKTBenchmarkSpecificSetup & benchSpec, SKTBenchmarkReport & reportInfo )

 

Parameters

[in] benchmark specification – Structure SKTBenchmarkSpecificSetup contains setup information

struct SKTBenchmarkSpecificSetup

{

U32 blockSize;

U32 count;

};

 

[out] report – Structure SKTBenchmarkReport contains the results.

struct SKTBenchmarkReport

{

double speedInMbPerSec;

double timeResponseUs;

};

 

Returns

Please see description in Test Delegate Return Code table.

SKTTestDelegate::sequentialWriteWithUniquePatterns

This function writes unique data pattern for each LBA. The data is written in way that it can be read and verified later without a need to store data in memory for verification. The writes are sequential. This function is useful in the following situations:

  • Test if data is corrupt in case of sudden power loss
  • to use with data retention test at power off. Write data to the drive and turn power off, read data from the drive later, and verify if the data is intact
  • to verify if data is corrupt due to address trampling, bad garbage collection or bad wear leveling in firmware

 

Notes: For StorKit Revision 1.0, it only supports non NCQ commands.

 

Declaration

SKTReturnCode SKTTestDelegate::sequentialWriteWithUniquePatterns (U64 startLba, U64 endLba, U32 sizeInKB)

 

Parameters

[in] startLba – An U64 variable to specify a starting logical block address.

[in] endLba – An U64 variable to specify a logical block address.

[in] sizeInKB – The block size in kilobyte is the unit of I/O workload. Every read and write is done in multiples of the block size. The size can vary between 1KB and 128KB

 

Returns

Please see description in Test Delegate Return Code table

SKTTestDelegate::verifyPreviousSequentialWriteData

This function works in conjunction with “sequential write with unique pattern”. It reads data from the drive and use the information in the data itself to verify whether the data is OK or corrupted. This function is useful in the following situations:

  • to verify if data is corrupt in case of sudden power loss
  • to use with data retention test at power off. Write data to the drive and turn power off, read data from the drive later, and verify if the data is intact
  • to verify if data is corrupt due to address trampling, bad garbage collection or bad wear leveling in firmware

Declaration

SKTReturnCode SKTTestDelegate::verifyPreviousSequentialWriteData (U64 startLba, U64 endLba, U32 blockSizeInKB)

Parameters

[in] startLba – An U64 variable to specify a starting logical block address.

[in] endLba – An U64 variable to specify a logical block address.

[in] blockSizeInKB – The block size in kilobyte is the unit of I/O workload. Every read and write is done in multiples of the block size. The size can vary between 1KB and 128KB

 

Returns

Please see description in Test Delegate Return Code table

SKTTestDelegate::randomWriteWithUniquePatterns

This function writes unique data pattern for each LBA. The data is written in way that it can be read and verified later without a need to store data in memory for verification. The writes are random. This function is useful in the following situations:

  • to verify if data is corrupt in case of sudden power loss
  • to use with data retention test at power off. Write data to the drive and turn power off, read data from the drive later, and verify if the data is intact
  • to verify if data is corrupt due to address trampling, bad garbage collection or bad wear leveling in firmware. This function writes data randomly, therefore, it makes it harder on the SSD.

 

Notes: For StorKit Revision 1.0, it only supports non NCQ commands.

 

Declaration

SKTReturnCode SKTTestDelegate::randomWriteWithUniquePatterns (U64 startLba, U64 endLba, U32 sizeInMB, U32 seed)

 

Parameters

[in] startLba – An U64 variable to specify a starting logical block address.

[in] endLba – An U64 variable to specify a logical block address.

[in] sizeInMB – Size of total random write in MB.

[in] seed – An U32 random seed. Use the same seed to repeat the pattern.

 

Returns

Please see description in Test Delegate Return Code table

SKTTestDelegate::verifyPreviousRandomWriteData

This function works in conjunction with “random write with unique pattern”. It reads data from the drive and use the information in the data itself to verify whether the data is OK or corrupted. This function is useful in the following situations:

  • to verify if data is corrupt in case of sudden power loss
  • to use with data retention test at power off. Write data to the drive and turn power off, read data from the drive later, and verify if the data is intact
  • to verify if data is corrupt due to address trampling, bad garbage collection or bad wear leveling in firmware.

Declaration

SKTReturnCode SKTTestDelegate::verifyPreviousRandomWriteData (U64 startLba, U64 endLba, U32 sizeInMB, U32 seed)

Parameters

[in] startLba – An U64 variable to specify a starting logical block address.

[in] endLba – An U64 variable to specify a logical block address.

[in] sizeInMB – Size of total random write in MB.

[in] seed – An U32 random seed. Use the same seed to repeat the pattern.

Returns

Please see description in Test Delegate Return Code table

SKTTestDelegate:: startMaxPowerConsumptionTest

Start the thread to create max power consumption condition on the SSD. There are two operating modes:

  • In Production mode: sequential write performed until reaching stop condition.
  • In Live mode: sequential read performed until reaching stop condition

The test will run until you invoke function stopMaxPowerConsumptionTest.

This test is used with your system test. For example, you want to trigger maximum power condition and see how long your power circuit can hold up at a specific temperature condition (-40°C or 85°C).

Declaration

SKTReturnCode SKTTestDelegate:: startMaxPowerConsumptionTest (const KTPowerConsumptionMode & mode)

Parameters

[in] mode – SKTPowerConsumptionMode [SKTPProduction,SKTLive]

Returns

Please see description in Test Delegate Return Code table

SKTTestDelegate:: stopMaxPowerConsumptionTest

Stop the thread is created previously by startMaxPowerConsumptionTest function.

Declaration

SKTReturnCode SKTTestDelegate:: stopMaxPowerConsumptionTest ()

Parameters

None

Returns

Please see description in Test Delegate Return Code table.