libxcoder  5.2.0
ni_rsrc_namespace.c File Reference

This utility aims to set the NVMe namespace number for a Quadra NVMe block device. It can operate on physical devices (PCIe physical function) or virtual devices (PCIe virtual function). Before setting namespace number, use SR-IOV to create the PCIe virtual function. Note that only block device name is accepted for this utility. More...

#include "ni_device_api.h"
#include "ni_nvme.h"
#include <sys/stat.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define NI_NAMESPACE_SZ   32
 

Functions

int send_config_ns_command (char *dev, int ns, int sr)
 
int send_config_qos_mode (char *dev, int value)
 
int send_config_qos_op (char *dev, char *devt, int op)
 
int main (int argc, char *argv[])
 

Detailed Description

This utility aims to set the NVMe namespace number for a Quadra NVMe block device. It can operate on physical devices (PCIe physical function) or virtual devices (PCIe virtual function). Before setting namespace number, use SR-IOV to create the PCIe virtual function. Note that only block device name is accepted for this utility.


To effect the name space change, reload the NVMe driver: sudo modprobe -r nvme sudo modprobe nvme sudo nvme list #check the result with nvme list

Definition in file ni_rsrc_namespace.c.

Macro Definition Documentation

◆ NI_NAMESPACE_SZ

#define NI_NAMESPACE_SZ   32

Definition at line 46 of file ni_rsrc_namespace.c.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 155 of file ni_rsrc_namespace.c.

◆ send_config_ns_command()

int send_config_ns_command ( char *  dev,
int  ns,
int  sr 
)

Definition at line 71 of file ni_rsrc_namespace.c.

◆ send_config_qos_mode()

int send_config_qos_mode ( char *  dev,
int  value 
)

Definition at line 95 of file ni_rsrc_namespace.c.

◆ send_config_qos_op()

int send_config_qos_op ( char *  dev,
char *  devt,
int  op 
)

Definition at line 119 of file ni_rsrc_namespace.c.