Skip to content

Mellanox/NNT-Linux-driver

Repository files navigation

NNT-Linux-driver (NVIDIA® networking tools driver)

This repository is the kernel space part of MFT & MSTFlint packages aimed to provide a stable and well defined interface for NVIDIA® networking devices that are accessed via PCI Memory Mapping or by PCI configuration cycles.
The purpose of this driver is to provide a lightweight interface between kernel and userspace for firmware management and debug tools for NVIDIA® networking devices.
The API is described in section Access from user space.

This repository is maintained by Itay Avraham, please send any comments, suggestions, or questions to the maintainer.

How to compile and load the driver.

Build the driver by using the "make" command and load the driver by using the "insmod" command:

  • Build and load driver for MSTFLint

    make
    insmode insmod nnt_linux_driver.ko
    
  • Build and load driver for MFT

    make
    insmod nnt_linux_driver.ko mft_package=1
    

Requirements

  • Userspace packages versions:
    • MFT version >=4.20.x
    • MSTFlint version >=4.20.x
  • The minimal GCC version should be 4.8.x.

Access from user space

IOCTL system call will be the communication channel between the userspace and the kernel space.
Here is a short explanation regarding the IOCTLS codes:

IOCTL Code Explanation
NNT_INIT Changes the bar number and map the new bar on the fly
NNT_STOP Change configuration registers on the fly
NNT_GET_DEVICE_PARAMETERS Pulls information about the NVIDIA® networking device
NNT_WRITE Writes a block of data to the PCI memory or the configuration space,
Size is expressed as number of unsigned integers
NNT_READ Reads a block of data from the PCI memory or the configuration space,
Size is expressed as number of unsigned integers
NNT_VPD_READ Reads PCI device VPD
NNT_VPD_WRITE Writes PCI device VPD
NNT_GET_DMA_PAGES Pins the user space memory into the kernel space for DMA purpose,
User space application should allocate buffer as number of pages
NNT_RELEASE_DMA_PAGES Unpin the user space memory
NNT_READ_DWORD_FROM_CONFIG_SPACE Reads a dword from the PCI configuation space
NNT_PCI_CONNECTX_WA ConnectX ordering workaround

FAQ:

  • Q: What is the driver major number of the driver?
    • A: The driver's major version is allocated dynamically, no fixed number.
  • Q: Which communication channel is preferred?
    • A: PCI configuration access is slower and less safe than memory access.

About

NNT Linux driver for MFT & MSTFLINT packages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published