Skip to main content

SEF CLI Targets

The examples provided in this chapter assume an SEF Unit with 192 dies. In order to keep the examples easy to understand, the long versions of the options are used; however, most common options have short versions available. A confirmation prompt appears following many of the available commands, but using the --force flag (present in most examples below) allows the user to bypass this confirmation.

SEF Unit

The sef-unit target is used to list and get information about the installed SEF Units using list and info actions.

The following example uses the list action to list all the SEF Units installed on the machine.

$ sudo sef-cli list sef-unit
SEF Unit Index Vendor FW Version HW Version Channels Banks
SEF Unit 0 1LMSS529 8 24
SEF Unit Count 1
$

Additional information about a specific SEF Unit can be acquired using the info action. The following example prints the information for an SEF Unit installed at index 0.

$ sudo sef-cli info sef-unit --sef-index 0
vendor: /dev/sef0
vendor:
serialNumber: P21L23E00193 1LMSS529
FWVersion: 1LMSS529
HWVersion:
supported Options:
* kPackedSupported
* kSuperBlockSupported
* kAutomaticSupported
* kFastestSupported
* kTypicalSupported
* kLongSupported
* kHeroicSupported
* kStopSupported
* kPSLCSupported
* kDeleteVirtualDeviceSupported
unitNumber: 0
APIVersion: 270
supportedOptions: 2614402
maxQoSDomains: 512
maxRootPointers: 8
maxPlacementIDs: 16
maxOpenSuperBlocks: 0
numReadQueues: 384
numVirtualDevices: 4
numQoSDomains: 0
numBanks: 24
numChannels: 8
numPlanes: 2
pageSize: 16384
numPages: 1792
numBlocks: 3294
totalBandWidth: 0
readTime: 0
programTime: 0
eraseTime: 0
minReadWeight: 32
minWriteWeight: 256
openExpirationPeriod: 0
ADUsize(1):
* data:meta
* 4096:16
$

Virtual Device Target

The virtual-device target is used to create, list, delete, configure, and get information about Virtual Devices.

Create Virtual Devices

The create action is used to create all Virtual Devices within an SEF Unit. This action supports the --force / -f flag to create the Virtual Devices without asking for confirmation. Moreover, the --verbose / -V flag, when provided, prints the configuration to be created.

Virtual Devices can be created using either auto place or die map.

Auto Placement of Virtual Devices

Auto place positions Virtual Devices at the best location given the input configuration. Auto place requires channel-num, bank-num, and repeat-num in lists of space-separated numbers denoting the number of channels and banks for each Virtual Device. The repeat-num option denotes how many times each channel and bank configuration should be repeated. If the proposed configuration does not fill the device, the user will be asked to confirm the proposed configuration; this confirmation is skipped when the --force / -f flag is given. The --virtual-device-id / -v option is used as the starting Virtual Device ID, and the remaining Virtual Device IDs are incremented by one.

The auto configuration algorithm fills the device with Virtual Devices, from largest to smallest. These Virtual Devices are placed across Channels and then Banks.

Prerequisite: Should have an empty SEF Unit. Delete Virtual Devices following directions in Section Deleting Virtual Devices

$ sudo sef-cli create virtual                    \
--sef-index 0 \
--virtual-device-id 2 \
--channel-num "2 2 1 8" \
--bank-num "2 3 1 20" \
--repeat-num "2 3 1 1" \
--verbose \
--force
Die Map:
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
3 3 4 4 5 5 6 6
3 3 4 4 5 5 6 6
3 3 4 4 5 5 7 7
8 0 0 0 0 0 7 7
The Virtual Devices for SEF Unit 0 was successfully created
$

The above example command results in the Virtual Device configuration in Figure 6. The figure only shows the last 32 dies for simplicity. The first 160 dies are configured with a single Virtual Device as a filler to simplify the example.

Figure 6: Virtual Device Configuration Auto Placement

Virtual Device Configuration Auto Placement

Using a Die Map for Virtual Devices

The die map creation method provides complete control over how each die is assigned to a Virtual Device. To use this method, pass in a space-separated list of Virtual Device IDs using the die-map option. The Virtual Device IDs should be passed in bank by bank, from the lowest channel to the highest channel per bank. The Virtual Device ID of 0 leaves a die unused and unassigned.

Prerequisite: Should have an empty SEF Unit. Delete Virtual Devices following directions in Section Deleting Virtual Devices

$ sudo sef-cli create virtual             \
--sef-index 0 \
--verbose \
--force \
--die-map "2 2 0 0 0 0 9 9 \
2 2 4 4 3 3 9 9 \
2 2 4 4 3 3 9 9 \
2 2 0 0 0 0 9 9 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0"
Die Map:
2 2 0 0 0 0 9 9
2 2 4 4 3 3 9 9
2 2 4 4 3 3 9 9
2 2 0 0 0 0 9 9
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
The Virtual Devices for SEF Unit 0 was successfully created
$

The above example command results in the Virtual Device configuration in Figure 7. The figure only shows the first 32 dies for simplicity; other dies are not configured.

Figure 7: Virtual Device Configuration Die Map

Virtual Device Configuration Die Map

Creation Time Configuration

Additional configurations can be applied while creating a Virtual Device.

Option --super-block is an array of tuples which is used to set the number of dies per Super Block. The default dies per Super Block is the number of dies in the Virtual Device. The supplied value should be divisible by the number of dies in the Virtual Device. Another configuration that can be applied is option --read-weight which is an array of tuples that is used to override the default weights for read operations for each possible read queue.

The example below creates a set of Virtual Devices similar to the previous example but overrides the number of dies per Super Block and default read weights.

Prerequisite: Should have an empty SEF Unit. Delete Virtual Devices following directions in Section Deleting Virtual Devices

$ sudo sef-cli create virtual         \
--sef-index 0 \
--verbose \
--force \
--die-map "2 2 0 0 0 0 9 9 \
2 2 4 4 3 3 9 9 \
2 2 4 4 3 3 9 9 \
2 2 0 0 0 0 9 9 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0" \
--super-block "2:1 9:4" \
--read-weight "2:500 2:800 \
2:1000 3:500"
Warning: The read weight for the Virtual Device 9 was not specified
Warning: The read weight for the Virtual Device 4 was not specified
Die Map:
2 2 0 0 0 0 9 9
2 2 4 4 3 3 9 9
2 2 4 4 3 3 9 9
2 2 0 0 0 0 9 9
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
The Virtual Devices for SEF Unit 0 was successfully created
$

The above example results in the same Virtual layout as Figure 7. However, Super Blocks in Virtual Device 2 will be striped across a single die, and Super Blocks in Virtual Device 9 will be striped across 4 dies. Moreover, the weights for the first three read queues for Virtual Device 2 will be overridden, and the value for the first read queue for Virtual Device 3 is also overridden.

Deleting Virtual Devices

Virtual Devices can only be deleted all at once. The delete action is used to delete the Virtual Devices within an SEF Unit. The Virtual Devices should be empty before they can be deleted. In other words, if a QoS Domain is created on a Virtual Device they should be deleted before deleting all Virtual Devices. Directions for deleting a QoS Domain is found in Section Deleting a QoS Domain.

The following command deletes the Virtual Devices in SEF Unit 0.

Prerequisite: Should have an SEF Unit with created Virtual Devices. Create Virtual Devices following directions in Section Create Virtual Devices

$ sudo sef-cli delete virtual       \
--sef-index 0 \
--force \
--verbose
All Virtual Devices in SEF Unit 0 were successfully deleted
$

Common Actions

Prerequisite: All actions in this section should have an SEF Unit with created Virtual Devices. Create Virtual Devices following directions in Section Create Virtual Devices

The list action lists the Virtual Devices. Moreover, if the --verbose / -V flag is provided, list will print the command to recreate the same Virtual Device configuration.

The following command shows how to list all created Virtual Devices in SEF Unit 0.

$ sudo sef-cli list virtual-device        \
--sef-index 0 \
--verbose
Example output
Virtual Device ID Flash Cap Flash Avail SB Cap SB Dies
Virtual Device 2 356679680 356565000 114688 8
Virtual Device 3 181608448 181551112 57344 4
Virtual Device 4 182411264 182353928 57344 4
Virtual Device 9 350715904 350601224 114688 8
Virtual Device Count 4
Recreate Command:
sef-cli create virtual-device -s 0 --die-map "2 2 0 0 0 0 9 9 2 2 4 4 3 3 9 9 2
2 4 4 3 3 9 9 2 2 0 0 0 0 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"
$

The draw action prints the current configuration of the Virtual Devices within the SEF Unit. draw is useful when trying to picture the current location of the created Virtual Devices.

The following command draws current configuration of Virtual Devices in SEF Unit 0.

$ sudo sef-cli draw virtual-device              \
--sef-index 0
Die Map:
2 2 0 0 0 0 9 9
2 2 4 4 3 3 9 9
2 2 4 4 3 3 9 9
2 2 0 0 0 0 9 9
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
$

The info action prints detailed information about the Virtual Device.

The following command prints Virtual Device information for Virtual Device 2 at SEF Unit 0

$ sudo sef-cli info virtual-device                   \
--sef-index 0 \
--virtual-device-id 2 \
--verbose
VirtualDeviceId: 2
flashCapacity: 356679680
flashAvailable: 356565000
pSLCFlashCapacity: 286720
pSLCFlashAvailable: 172040
superBlockCapacity: 114688
pSLCSuperBlockCapacity: 28672
maxOpenSuperBlocks: 4294967295
numPSLCSuperBLocks: 10
suspendConfig-
* maxTimePerSuspend: 0
* minTimeUntilSuspend: 0
* maxSuspendInterval: 0
superBlockDies: 8
aduOffsetBitWidth: 24
superBlockIdBitWidth: 24
Read Queues Weights (1):
* Read Weight 32
QoS Domains: None
Dies (8):
* Die 0
* Die 1
* Die 8
* Die 9
* Die 16
* Die 17
* Die 24
* Die 25
eraseCount: 0
numUnallocatedSuperBlocks: 3110
numSuperBlocks: 0
numUnallocatedPSLCSuperBlocks: 10
numPSLCSuperBlocks: 0
averagePEcount: 0
maxPEcount: 0
patrolCycleTime: 26416
$

Configuring a Virtual Device

The Virtual Device engine provides set-pslc and set-suspend-config actions to further configure a Virtual Device.

The set-pslc action is used to set the number of pSLC Super Blocks for the Virtual Device. The following command sets the pSLC Super Blocks for Virtual Device 1.

Prerequisite: Should have an SEF Unit with created Virtual Devices. Create Virtual Devices following directions in Section Create Virtual Devices

$ sudo sef-cli set-pslc virtual-device                 \
--sef-index 0 \
--virtual-device-id 2 \
--num-pslc-super-block 50 \
--force --verbose
The number of pSLC Super Blocks for Virtual Devices 2 was successfully
set
$

The set-suspend-config action is used to set the configuration for the suspend functionality of the Virtual Device. Not all options are required when setting the suspend configuration.

Prerequisite: Should have an SEF Unit with created Virtual Devices. Create Virtual Devices following directions in Section Create Virtual Devices

$ sudo sef-cli set-suspend-config virtual-device                        \
--sef-index 0 \
--virtual-device-id 2 \
--suspend-max-time-per 100 \
--suspend-min-time-until 100 \
--suspend-max-interval 100 \
--force \
--verbose
$

QoS Domain Target

The qos-domain target is used to list, create, delete, backup, restore, modify, and get information about QoS Domains.

Creating a QoS Domain

The create action of the qos-domain target is used to create a QoS Domain. This action supports the --force / -f flag, for creating the QoS Domain without asking for confirmation.

When creating a QoS Domain, the QoS Domain ID, a unique identifier of the QoS Domain, is returned by the SEF Unit. This can make scripting difficult, given that the returned ID is non- deterministic. A QoS Domain’s label is a 128-bit unique signature used to identify the QoS Domain. These labels can be used to find and perform operations on QoS Domains. The label is stored on the last two root pointers of the QoS Domain. The --label / -l option is used to label a QoS Domain. The QoS Domain can be relabeled using the label action.

Prerequisite: Should have an SEF Unit with created empty Virtual Devices. Create Virtual Devices following directions in Section Create Virtual Devices

$ sudo sef-cli create qos                                         \
--sef-index 0 \
--virtual-device-id 1 \
--label "61300673829223 888776657572036" \
--flash-capacity 1024000 \
--defect-strategy "kPacked" \
--verbose \
--force
Warning: The value of the erase weight 0 is below the recommended number of 256
Warning: The value of the program weight 0 is below the recommended number of 256
The QoS Domain 1 was successfully created
$

The example above creates a QoS Domain with label of 61300673829223 888776657572036 on the SEF Unit 0 and Virtual Device ID of 1 with a size of 1024000 ADUs. In other words, the created QoS Domain has a size of 4,194,304 MB, assuming the default ADU size of 4096 bytes. If the Virtual Device does not have enough space available, the QoS Domain is not created, and an error is returned. This action assumes many default options, such as those pertaining to WFQ queues.

Creation Time Configuration

Additional configurations can be applied while creating a QoS Domain.

The option --read-queue is used to set the default read queue that should be used for read operations. The options --program-weight and --erase-weight are used to set the default program and erase weights.

The example below creates a similar QoS Domain to the previous example but overrides the assigned queues and the default values for program and erase weights.

Should have an SEF Unit with created empty Virtual Devices. Create Virtual Devices following directions in Section Create Virtual Devices

$ sudo sef-cli create qos                                             \
--sef-index 0 \
--virtual-device-id 2 \
--label "61300673829223 888776657572036" \
--flash-capacity 1024000 \
--read-queue 1 \
--program-weight 500 \
--erase-weight 500 \
--defect-strategy "kPacked" \
--verbose \
--force
The QoS Domain 1 was successfully created
$

Deleting a QoS Domain

QoS Domains can be deleted one at a time. The delete action is used to delete a specific QoS Domain.

The following command deletes the QoS Domain with specified label.

Prerequisite: Should have a Virtual Device with created a QoS Domain. Create QoS Domain following directions in Section Creating a QoS Domain

$ sudo sef-cli delete qos-domain                                 \
--sef-index 0 \
--label "61300673829223 888776657572036" \
--force \
--verbose
The QoS Domain was successfully deleted
$

Common Actions

Prerequisite: All actions in this section should have a Virtual Device with created a QoS Domain. Create QoS Domain following directions in Section Creating a QoS Domain

The list action lists the QoS Domains defined in an SEF Unit. Moreover, if the --verbose or -V flag is provided, list will print the command to recreate the same QoS Domain configuration.

The following command lists all the created QoS Domains in SEF Unit 0.

$ sudosef-cli list qos-domain             \
--sef-index 0 \
--verbose
QoS Domain ID VD ID Capacity Label
QoS Domain 1 2 1024000
[61300673829223,888776657572036]
QoS Domain Count 1
Recreate Command:
sef-cli create qos-domain -s 0 -v 2 --flash-capacity 1024000
--max-open-super-blocks 2 --defect-strategy "kPacked"
$

The info action prints detailed information about the QoS Domain.

The following command prints QoS Domain Information for QoS Domain with specified label in SEF Unit 0

$ sudo sef-cli info qos-domain                      \
--sef-index 0 \
--label "61300673829223 888776657572036" \
--verbose
qosDomainId: 1
qosDomainLabel: [61300673829223, 888776657572036]
virtualDeviceID: 2
numPlacementIDs: 1
maxOpenSuperBlocks: 2
encryption: Enabled
recoveryMode: Automatic
defectStrategy: Packed
api: SuperBlock
flashCapacity: 1024000
flashQuota: 1024000
flashUsage: 0
pSLCFlashCapacity: 0
pSLCFlashQuota: 0
pSLCFlashUsage: 0
ADUSize:
* Data: 4096
* Meta: 0
superBlockCapacity: 114688
pSLCSuperBlockCapacity: 28672
maxOpenSuperBlocks: 2
defectMapSize: 0
deadline: Typical
defaultReadQueue: 0
Weights:
* erase: 256
* program: 256
* rootPointer (0): 0x0
* rootPointer (1): 0x0
* rootPointer (2): 0x0
* rootPointer (3): 0x0
* rootPointer (4): 0x0
* rootPointer (5): 0x0
* rootPointer (6): 0x37c0ace35967
* rootPointer (7): 0x3285670f590c4
$

QoS Domain Label

A QoS Domain can either be labeled when it is created or using the label action. The label action can override a QoS Domain that is already labeled if the --force / -f flag is provided.

Prerequisite: Should have a Virtual Device with created a QoS Domain. Create QoS Domain following directions in Section Creating a QoS Domain

The following command labels a created QoS Domain with QoS Domain Id 1 on SEF Unit 0.

$ sudo sef-cli label QoS-Domain                               \
--sef-index 0 \
--qos-domain-id 1 \
--label "61300673829223 888776657572036" \
--verbose --force
QoS Domain 1 was successfully labeled
$

Resizing a QoS Domain

Prerequisite: All actions in this section should have a Virtual Device with created a QoS Domain. Create QoS Domain following directions in Section Creating a QoS Domain

The resize action is used to modify an existing QoS Domain’s size. The action can resize both QLC and pSLC capacity and quota; however, the operations have to be done using two separate commands.

$ sudo sef-cli resize qos-domain                              \
--sef-index 0 \
--label "61300673829223 888776657572036" \
--flash-capacity 1024000 \
--flash-quota 1024000 \
--force --verbose
QoS Domain 1 was successfully resized
$ sudo sef-cli resize qos-domain \
--sef-index 0 \
--label "61300673829223 888776657572036" \
--pslc-capacity 1024000 \
--pslc-quota 1024000 \
--force --verbose
QoS Domain 1 was successfully resized
$

The --flash-quota option is shared for both resize types and will be used accordingly.

Formatting a QoS Domain

The format action is used to delete all the data stored on the QoS Domain. In other words, the action does not delete the QoS Domain but just the data that is stored, including root pointers and all the metadata.

The --relabel flag will make sure to retain the current label of the QoS Domain.

Prerequisite: Should have a Virtual Device with created a QoS Domain. Create QoS Domain following directions in Section Creating a QoS Domain

$ sudo sef-cli format qos-domain                               \
--sef-index 0 \
--label "61300673829223 888776657572036" \
--relabel \
--force --verbose
QoS Domain 1 was successfully formatted
$

Backing Up and Restoring QoS Domains

SEF-CLI provides actions to back up and restore the data and metadata stored within a QoS Domain. The data is backed up and restored as-is. In other words, the data and structures stored on the QoS Domain are neither updated nor modified while backing up or restoring. For example, if the data has structures that point to each other, the references and addresses are not changed and will break.

The data is stored in separate files. Each file contains the data for a single Super Block.

The --path option points to the directory where the backed up data is stored. The directory is made by the backup process. The command below backs up the data of the QoS Domain in its entirety in the directory.

Prerequisite: Should have a Non-empty QoS Domain. Create QoS Domain following directions in Section Creating a QoS Domain. Populate the QoS Domain using FIO explained in Chapter FIO or Python Sell explained in Section Shell Target

$ sudo sef-cli backup qos                                        \
--sef-index 0 \
--label "61300673829223 888776657572036" \
--path "/tmp/SefBackup"
$

The following command will restore a backed up QoS Domain’s data and metadata from the generated files.

Prerequisite: Should have a empty QoS Domain. Create QoS Domain following directions in Section Creating a QoS Domain or format an existing domain following directions in Section Formatting a QoS Domain

$ sudo sef-cli restore qos                                       \
--sef-index 0 \
--label "61300673829223 888776657572036" \
--path "/tmp/SefBackup"
$

The above command restores a backed up QoS Domain’s data stored in the sub-directory named /tmp/SefBackup into another QoS Domain.

Use of both the user address allow-list and block-list options allows for customization of what is backed up and restored. The allow-list and block-list options expect a space- separated list of hex flash addresses. The flash addresses can denote a single address or a range of addresses separated by a colon.

Prerequisite: Should have a Non-empty QoS Domain. Create QoS Domain following directions in Section Creating a QoS Domain. Populate the QoS Domain using FIO explained in Chapter FIO or Python Sell explained in Section Shell Target

$ sudo sef-cli backup qos                                           \
--sef-index 0 \
--label "61300673829223 888776657572036" \
--path "/tmp/SefBackup" \
--block-list "AAAA BBBB:CCCC DDDD"
$

The above command skips the flash addresses AAAA and DDDD and the range of addresses from BBBB to CCCC while backing up the QoS Domain. Note: The values AAAA, BBBB, CCCC, and DDDD are used for simplicity and should be replaced with valid hex flash addresses.

FTL Target

The ftl target offers three actions: info, check, and configure. The configure action is used to configure the Reference FTL by setting the over-provisioning percentage. Only an empty QoS Domain can be configured. This action supports the --force / -f flag to configure the reference FTL without asking for confirmation.

The following command configures the reference FTL for QoS Domain 2 with 20% of over-provisioning.

$ sudo sef-cli configure ftl                                    \
--sef-index 0 \
--label "61300673829223 888776657572036" \
--overprovisioning 20 \
--force --verbose
The QoS Domain 1 was successfully configured by SDK
$

The info action can be used to print detailed information about a configured QoS Domain.

$ sudo sef-cli info FTL                                      \
--sef-index 0 \
--label "61300673829223 888776657572036" \
--verbose
aduSize: 4096
numPlacementIDs: 1
superBlockSize: 28672
superPageSize: 16
capacity: 335868
overprovisioning: 20
numDomains: 1
Recreate Command:
sef-cli configure sdk -s 0 -q 1 --overprovisioning 20
$

The health of the reference FTL may be checked using the check action. The check action can only be performed on a configured QoS Domain. If the FTL is found to be faulty, this action may be used to repair the device when given the --should-repair flag. The below command checks the health of the reference FTL. Keep in mind that the reference FTL should not be running while executing the following:

$ sudo sef-cli check FTL                                     \
--sef-index 0 \
--label "61300673829223 888776657572036" \
--verbose
The SEF SDK was not broken and does not need repair
$

Shell Target: Using an SEF Unit Interactively

A unique feature of the SEF-CLI is the interactive Python 3 shell. SEF-CLI expands the Python functionality by defining a custom Python module used to interact with the SEF Unit.

The sefCliHelp function may be used to print the help function within the shell. The following is a simple example of how to interact with the built-in Python 3 shell.

$ sudo sef-cli interactive shell
>>> sefCli has been loaded, use sefCliHelp() to learn about its use cases
>>> use function quit() to exit the interactive mode
[<qos>@<sef>] >>> listSEF() #Lists sef units
[0, 1, 2]
[<qos>@<sef>] >>> selectSEF(0) #Selects sef unit 0 to interact with
[<qos>@ 0] >>> listQoS() #Lists QoS Domains and if they are open
[(3, False)]
[<qos>@ 0] >>> openQoS(3) #Opens QoS Domain to interact with
[ 3@ 0] >>> quit() #Shuts down the shell
$

Moreover, the Python shell can be used to execute a Python script to interact with SEF Units using the execute action. The following command executes a Python 3 script stored in the file script.py.

$ sudo sef-cli execute shell --python-script script.py