Extending DMM – Measuring Seek time in DMM
One extremely powerful feature of the STB Suite Disk Manufacturing Module (DMM) is the “External Program” test step. This step test makes DMM a completely extendable test platform – any test function that you need that isn’t already built in can be added quickly and easily.
In this article we will use the example of adding a test to DMM which will measure the Track-to-track, Third-Stroke, and Full-Stroke SEEK times of SCSI/FC, or SAS drives, and will record these three SEEK times back to the DMM individual drive log files.
Implementing the test
We will write this test using the STB Suite Developers Toolbox (DTB) api. We will write this example using Visual Studio 6, C++. It could just as easily be written using VB or .Net.
The ANSI T10 committee has retired or obsoleted the SEEK command and so we will need to find another way to accomplish our goal. If you were only testing drives which you know have the old SEEK command implemented it would be a simpler program to use that CDB.
In our case we will use single-block READ(10) commands, using the Force Unit Access (FUA) bit to insure actual media access instead of everything being done out of cache. To calculate a baseline we will initially execute 1,000 single-block READ(10) commands w/o FUA, all from block 0 – to calculate the time taken in transferring data. Later we will subtract this overhead time from our SEEK times to obtain a more accurate measurement.
Once we have this baseline we will then execute 1,000 single-block READ(10) w/ FUA set – alternating between block 0 and a block number estimated to be around one track away from zero. Then, 1,000 of the same, between block zero and an LBA one-third of the way into the drive, then 1,000 of the same between block zero and the high block number of the drive.
We experimented with trying to read the drive geometry MODE PAGE and actually calculate what is one track, one-third of the drive, and the end of the drive – all of that effort did not make any practical difference in the test results. For the obsessive among our readers feel free to implement this – you could even go so far as to let the drive interpret your calculated LBA’s out into physical C/H/S addresses if you so desire…with DTB you can go as far as you’d like.
We have previously documented how to have an external program communicate back to the DMM log files – we use those methods to write the resulting measurements of the three SEEK methods back to the log files.
Extending DMM – how to run the test
First, copy the new test executable (“DMMscsiSeekTest.exe”) to the root folder of your C: drive.
Within the DMM Test Setup screen select the “External Program” test step type. Another dialog will pop up asking if there are any additional command-line arguments. This test does not use any so simply click “OK”. Then use the Browse button next to the “Firmware File/External Program Executable” file box to browse to and select the test in the C:\ root folder. Then click “Add this test to test sequence” and run the test on one or more drives.
Running on a typical FC interface drive we see this entry in the log file:
STB DMM Seek Test Results:
Test Run 02/22/10 12:12:30
Single-track Seek Time = 1.49 ms
Third-Stroke Seek Time = 5.52 ms
Full-Stroke Seek Time = 7.70 ms
Extending DMM to accomplish any test scheme is made possible with the External Program test step. In addition to the traditional idea of controlling environmental chambers or power supplies the STB Suite DTB api allows new tests that accomplish device I/O to run and report results back to the DMM logs.
SATA SET FEATURES using DMM
SATA disk drives may have features which can be enabled or disabled. Some examples of SATA drive features are Write Cache enable/disable, Acoustic Management enable/disable with levels, Free-fall control enable/disable, etc. See the table at the end of this article for a current list of SATA FEATURES – as of the ATA-8 specification. Note – your drive may or may not implement all features. Refer to each individual drive’s IDENTIFY information to determine what features are implemented.
Two types of Features
The various Features are referred to by their FEATURE CODE.
There are two types of features which can be set.
The first are features which can simply be enabled or disabled. Write Cache is an example of this type of feature. There is one FEATURE CODE (0x02) to enable write cache, and another FEATURE CODE (0x82) to disable write cache.
The second type are features which can be enabled or disabled and also have levels which can be specified. For instance, the Advanced Power Management (APM) feature can not only be enabled or disabled, but the level of power management can be adjusted from a minimum setting to a maximum setting. In the case of the APM level setting the drive will likely have different performance based on the APM level set.
When a Feature has a level associated with it that level will be specified in the COUNT field of the SET FEATURES command.
The SET FEATURES command
The SET FEATURES command is a SATA, 28-bit, non-data command. The specific Feature to be set is specified in the commands FEATURE field, while the level of the Feature to be set is specified in the COUNT field, if applicable. As we have covered in previous articles and papers, sending a SATA command to a disk drive can be a complicated matter. Fortunately we have taken care of the details for you by writing a special executable program that will be called as a DMM test step.
DMM External Program Test Step
The program “DMMSetFeatures.exe” is used to incorporate SATA SET FEATURE manipulation into your test environment. To use this program simply follow these simple steps:
- Copy the program “DMMSetFeatures.exe” into the root folder of your STB Suite test system.
- In the DMM Test Setup menu tab click on the “External Program” test step
- DMM will pop up a window for you to enter External Program Command Line Parameters. Enter the FEATURE code, and if the feature has an associated level count enter a comma and then the count value. For example – to set the AMM feature to a level of 0xFE you would enter “42,FE” (of course without the quotes) in the Command line parameter field.
- Click OK to close the Command Line Parameter window.
- Click on the Browse button next to the Download File/External Program Executable edit field. Browse to and select the program “DMMSetFeatures.exe”
- Click on the “Add This Test to Test Sequence” button to add the test step to the sequence
- Repeat steps 2-6 if you have more than one Feature you want set
Each drives .log file will show the results (pass or fail) of the SET FEATURE command, along with what the FEATURE and COUNT values were set to.
Here is an example of a log showing one SET FEATURE command which succeeded, and another which failed (we specified an illegal FEATURE code)
The DMMSetFeatures program lets you enter any value into the FEATURE CODE or COUNT field, including illegal or invalid values. Take care to only enter valid values
Also – the program DMMSetFeatures changes one Feature at a time. If you need to change multiple Features during a test session follow the instructions and enter each Feature separately.
Getting the program
If you have current Performa coverage you are entitled to get and use the program. Contact Jeremy Wolfe at firstname.lastname@example.org to request the program
Table of Features
Command Probability Sequencer Application – Part 2
In part one we introduced the CPS Command Probability Sequencer application, showing how to define commands and add them to the command execution list.
In part 2 we will continue the introduction to CPS by showing the two execution modes, and analyze the CPS output using BAM.
Executing the test – sending the commands in Sequential Mode
Referring to the CPS setup we left off with, now turn your attention to the highlighted and commented sections show here:
Note: our command sequence is made up of seven different commands, one of which has a DATA OUT phase, two of which have no data phase, and four of which have DATA IN.
For this section we are going to issue the commands in the list in the order they appear – Sequential Mode.
Clicking the “Start I/O” button will issue the sequence of commands over and over until 1,000 I/O’s have been executed.
Examination of the I/O output via a BAM trace (viewed in Excel) we see our command sequence begin and repeat…
A quick look back at our CPS screen shows our command list…
TEST UNIT READY
READ(10) – 1 block from LBA 65280
READ(10) – 32 blocks from LBA 0
WRITE(10) – 32 blocks to LBA 0
SEEK – to LBA 61440
Asking Excel to tell us the total number of CDB’s gives us the number 1002 – there are always CDB’s issued at the beginning of the test run to confirm that the selected device exists, etc. These discovery commands are READ CAPACITY, INQUIRY.
Thus BAM confirms that our command list was executed in the defined order, and that the number of I/O’s that we defined was the number of I/O’s generated.
Executing the test – sending the commands in Random Mode
Now we will explore the most powerful mode of CPS – Random Mode.
In random mode CPS will generate the requested number of I/O’s – in the case of our example 1,000 – and will automatically insure that each command gets executed the number of times defined by each commands Probability Percentage. Rather than being executed in order as in Sequential Mode the command sequence will now be random. CPS will insure that each command gets issued the correct number of times, based on the Probability Percentage for each command and the Number of I/O’s to Issue number entered.
Looked at this way our command list shows that we defined:
TEST UNIT READY – 10% – should be executed 100 times…
INQUIRY – 10% – should be issued 100 times…
MODE SENSE – 20% – should be issued 200 times…
READ(10) 1 block from LBA 65280 – 20% – should be issued 200 times…
READ(10) 32 blocks from LBA 0 – 10% – should be issued 100 times
WRITE(10) 1 block to LBA 0 – 10% – should be issued 100 times
SEEK – to LBA 61440 – 20% – should be issued 200 times
Let’s execute the test again now, this time in Random mode, and then examine the BAM trace…
Looking at the BAM traces tells us that we actually had:
311 READ(10) commands issued (combination of the two defined READ commands…),
125 WRITE (10) commands issued,
188 SEEK commands issued,
106 TEST UNIT READY commands issued,
178 MODE SENSE (6) commands issued,
111 INQUIRY commands issued,
For a total of 1019 commands.
Pretty close to the 1,000 that we asked for, and the numbers of each command are pretty close to the percentages we specified. CPS does its’ best to meet the requested test parameters, sometimes its’ calculations will generate a few more I/O’s.
Here is a picture of a piece of the trace, showing that the commands are not in any particular order –
CPS is a very powerful test tool. Sequential Mode is perfect for testing scenarios such as command compliance testing. Random mode is perfect for testing how a drive responds to random occurrences of random or illegal commands, or testing which simulates real-world situations.
Do you have questions about how to best use the STB Suite in your business? STB is happy to work with you in an interactive “live” environment to help you get the most out of your Toolbox. The cost? If you are a current Performa customer it is free! The commitment? Training sessions run between 30 and 60 minutes.
Here is a list of some recent customer training sessions that STB has conducted – live, interactive web sessions presented by STB programmers:
- Three stages of disk drive screening
- How to troubleshoot tape drive problems
- RAID issues in disk drive testing
- Multi-drive SATA firmware downloading with the STB Suite
Contact Jeremy Wolfe at (480) 600-9595 today to schedule your own custom training session!