PNVM - A Python-Based NVMe SSD Test Software

Introduction

Overall

PNVM is a Python extension module. It is provided for users to develop Python scripts testing on NVMe SSDs.

PNVM is based on a proprietary Linux user-space NVMe driver. With PNVM, programmers are able to compose Python scripts calling into versatile methods with the following critical functions:

Thread Safe

The methods are provided in thread-safe ways to operate the devices.

Multiple Devices and Namespaces

PNVM module supports to control multiple NVMe devices and namespaces concurrently.

Multiple Functions

Methods are provided to enable and disable SR-IOV mulple functions.

LBA Metadata

Power-Cycling Recovery

The module supports to re-scan and to re-initialize a device after a power cycling of the device .

Reset Recovery

Reset approaches supported are: PCIe hot reset, controller reset, function level reset, and NVM subsystem reset. Re-scan/re-init functions are provided to recover to access the device after resets on it.

Background Command Logs

The latest 10,000 issued commands to each submission queue are kept.

Reference System and System Requirement

System updates and settings

Before running the scripts, do the following updates.

        
user1@pc:~$ sudo apt-get update
user1@pc:~$ sudo apt-get install libconfig-dev libusb-dev
user1@pc:~$ sudo sysctl -w vm.nr_hugepages=1024
        
    

Quick Start

Preparation

Say that you have one NVMe SSD plugged on your system and the device node is /dev/nvme0. Do the following commands to execute a speed test on it. Note that the compression (.tar) file and directory name depend on the release version.

    
user1@pc:~$ tar -zxvf pnvm.tar.gz
user1@pc:~$ cd pnvm
user1@pc:~/pnvm$ sudo -s
root@pc:/home/user1/pnvm$ sdut --vfio-noiommu nvme0
Success: nvme0
root@pc:/home/user1/pnvm$ cd main
root@pc:/home/user1/pnvm/main$  rspd.py ..
    

sdut is the utility setting up DUTs for PNVM.

Running A Test

    
root@pc:/home/user1/pnvm$ cd main
root@pc:/home/user1/pnvm/main$  idfy.py ..