3. API Reference
3.1. General Library Definitions
NVSDM general library definitions.
Macros
- NVSDM_CURR_VERSION
Current NVSDM API version.
- NVSDM_CURR_VERSION_MAJOR
API major version.
- NVSDM_CURR_VERSION_MINOR
API minor version.
- NVSDM_CURR_VERSION_PATCH
API patch version.
- NVSDM_GET_MAJOR_NUMBER
Get the API major number.
- NVSDM_GET_MINOR_NUMBER
Get the API minor number.
- NVSDM_GET_PATCH_NUMBER
Get the API patch number.
- NVSDM_VERSION
Generate a version number from major, minor, and patch.
Enumerations
- nvsdmLogLevel
NVSDM Log Levels.
- nvsdmRet_t
NVSDM Return Types.
Functions
- nvsdmRet_t nvsdmFinalize()
Perform cleanup prior to exit.
- char const * nvsdmGetErrorString(nvsdmRet_t ret)
Return a string describing the error code contained in
ret
.- nvsdmRet_t nvsdmGetLogLevel(uint32_t *logLevel)
Retrieve current library logging level.
- nvsdmRet_t nvsdmGetVersion(uint64_t *version)
Retrieve the nvsdm library version number.
- nvsdmRet_t nvsdmInitialize()
Initialize library.
- nvsdmRet_t nvsdmSetLogFile(char const *filePath)
Redirect all log messages to the specified file.
- nvsdmRet_t nvsdmSetLogLevel(uint32_t logLevel)
Set logging level in the library to one of nvsdmLogLevel .
3.1.1. Macros
-
NVSDM_CURR_VERSION
Current NVSDM API version.
-
NVSDM_CURR_VERSION_MAJOR
API major version.
-
NVSDM_CURR_VERSION_MINOR
API minor version.
-
NVSDM_CURR_VERSION_PATCH
API patch version.
-
NVSDM_GET_MAJOR_NUMBER(version)
Get the API major number.
-
NVSDM_GET_MINOR_NUMBER(version)
Get the API minor number.
-
NVSDM_GET_PATCH_NUMBER(version)
Get the API patch number.
-
NVSDM_VERSION(major, minor, patch)
Generate a version number from major, minor, and patch.
3.1.2. Enumerations
-
enum nvsdmLogLevel
NVSDM Log Levels.
Values:
-
enumerator NVSDM_LOG_LEVEL_FATAL
Log fatal errors.
-
enumerator NVSDM_LOG_LEVEL_ERROR
Log all errors.
-
enumerator NVSDM_LOG_LEVEL_WARN
Log all warnings.
-
enumerator NVSDM_LOG_LEVEL_DEBUG
Log all debug messages.
-
enumerator NVSDM_LOG_LEVEL_INFO
Log all info messages.
-
enumerator NVSDM_LOG_LEVEL_NONE
Log none.
-
enumerator NVSDM_LOG_LEVEL_FATAL
-
enum nvsdmRet_t
NVSDM Return Types.
Values:
-
enumerator NVSDM_SUCCESS
The operation was successful.
-
enumerator NVSDM_ERROR_UNINITIALIZED
NVSDM was not first initialized with nvsdmInitialize()
-
enumerator NVSDM_ERROR_NOT_SUPPORTED
The requested operation is not available on target device.
-
enumerator NVSDM_ERROR_INVALID_ARG
A supplied argument is invalid.
-
enumerator NVSDM_ERROR_INSUFFICIENT_SIZE
An input argument is not large enough.
-
enumerator NVSDM_ERROR_VERSION_NOT_SUPPORTED
API version is not supported.
-
enumerator NVSDM_ERROR_MEMORY
Insufficient memory.
-
enumerator NVSDM_ERROR_DEVICE_DISCOVERY_FAILURE
Device discovery failed.
-
enumerator NVSDM_ERROR_LIBRARY_LOAD
Library load failed.
-
enumerator NVSDM_ERROR_FUNCTION_NOT_FOUND
Function not found.
-
enumerator NVSDM_ERROR_INVALID_CTR
Invalid counter.
-
enumerator NVSDM_ERROR_TELEMETRY_READ
Telemetry read failed.
-
enumerator NVSDM_ERROR_DEVICE_NOT_FOUND
Device not found.
-
enumerator NVSDM_ERROR_UMAD_INIT
UMAD init failure.
-
enumerator NVSDM_ERROR_UMAD_LIB_CALL
UMAD library call failed.
-
enumerator NVSDM_ERROR_MAD_LIB_CALL
UMAD library call failed.
-
enumerator NVSDM_ERROR_NLSOCKET_OPEN_FAILED
Error opening netlink socket.
-
enumerator NVSDM_ERROR_NLSOCKET_BIND_FAILED
Error binding netlink socket.
-
enumerator NVSDM_ERROR_NLSOCKET_SEND_FAILED
Error sending data on netlink socket.
-
enumerator NVSDM_ERROR_NLSOCKET_RECV_FAILED
Error receiving data from netlink socket.
-
enumerator NVSDM_ERROR_FILE_OPEN_FAILED
Could not open file.
-
enumerator NVSDM_ERROR_INSUFFICIENT_PERMISSION
Insufficient permissions.
-
enumerator NVSDM_ERROR_FILE_NOT_FOUND
File not found.
-
enumerator NVSDM_ERROR_DOCA_RESUORCE_FAILURE
An error has occured on a DOCA resource.
-
enumerator NVSDM_ERROR_UNKNOWN
Error unknown.
-
enumerator NVSDM_SUCCESS
3.1.3. Functions
-
nvsdmRet_t nvsdmFinalize()
Perform cleanup prior to exit.
- Returns
NVSDM_SUCCESS on success
-
char const *nvsdmGetErrorString(nvsdmRet_t ret)
Return a string describing the error code contained in
ret
.- Parameters
ret – [in] The error code
- Returns
The string describing
ret
, or NULL on error
-
nvsdmRet_t nvsdmGetLogLevel(uint32_t *logLevel)
Retrieve current library logging level.
Use nvsdmSetLogLevel to set the logging level
- Parameters
logLevel – [out] The current library logging level
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
logLevel
is NULL
-
nvsdmRet_t nvsdmGetVersion(uint64_t *version)
Retrieve the nvsdm library version number.
- Parameters
version – [out] Reference to the version number
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
version
is NULL
-
nvsdmRet_t nvsdmInitialize()
Initialize library.
- Returns
NVSDM_SUCCESS on success
-
nvsdmRet_t nvsdmSetLogFile(char const *filePath)
Redirect all log messages to the specified file.
- Parameters
filePath – [in] (Relative or absolute) Path to the desired log file
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
filePath
is NULL- Returns
NVSDM_ERROR_FILE_OPEN_FAILED if the log file could not be opened for any reason
-
nvsdmRet_t nvsdmSetLogLevel(uint32_t logLevel)
Set logging level in the library to one of nvsdmLogLevel.
This controls the types of messages printed out (to stdout) within the library. Set to NVSDM_LOG_LEVEL_FATAL to turn off all but the most important messages (i.e. the ones reporting and/or describing catastrophic failures). Set to NVSDM_LOG_LEVEL_INFO to print out all messages, including informational ones. Defaults to NVSDM_LOG_LEVEL_ERROR.
- Parameters
logLevel – [in] The desired logging level. One of nvsdmLogLevel.
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
logLevel
is not one of enum nvsdmLogLevel
3.2. Device functions
Functions relating to devices.
Enumerations
- nvsdmDevType
NVSDM Device Types.
Functions
- nvsdmRet_t nvsdmDeviceGetDevID(nvsdmDevice_t const device, uint16_t *devID)
Retrieve device ID.
- nvsdmRet_t nvsdmDeviceGetGUID(nvsdmDevice_t const device, uint64_t *guid)
Retrieve the GUID for the given device.
- nvsdmRet_t nvsdmDeviceGetLID(nvsdmDevice_t const device, uint16_t *lid)
Retrieve the LID for the given device.
- nvsdmRet_t nvsdmDeviceGetType(nvsdmDevice_t const device, unsigned int *type)
Retrieve device type.
- nvsdmRet_t nvsdmDeviceGetVendorID(nvsdmDevice_t const device, uint32_t *vendorID)
Retrieve vendor ID of the given device.
- nvsdmRet_t nvsdmGetAllDevices(nvsdmDeviceIter_t *iter)
Retrieve an iterator to the list of devices of every type.
- nvsdmRet_t nvsdmGetAllDevicesOfType(int type, nvsdmDeviceIter_t *iter)
Retrieve an iterator to the list of devices of type
type
.- nvsdmRet_t nvsdmGetDeviceGivenGUID(uint64_t guid, nvsdmDevice_t *dev)
Retrieve the device corresponding to the given GUID.
- nvsdmRet_t nvsdmGetDeviceGivenLID(uint16_t lid, nvsdmDevice_t *dev)
Retrieve the device corresponding to the given LID.
- nvsdmRet_t nvsdmGetNextDevice(nvsdmDeviceIter_t iter, nvsdmDevice_t *device)
Retrieve the next valid device handle in the list being iterated over by
iter
.- nvsdmRet_t nvsdmIterateDevices(nvsdmDeviceIter_t iter, nvsdmRet_t(*callback)(nvsdmDevice_t const, void *), void *cbData)
Iterate over a list of devices, calling
callback
on each.- nvsdmRet_t nvsdmResetDeviceList(nvsdmDeviceIter_t iter)
Reset the iterator to point to the first device in the list.
Typedefs
- nvsdmDeviceIter_t
Opaque handle for device iterators.
- nvsdmDevice_t
Opaque handle for device/node descriptors.
3.2.1. Enumerations
-
enum nvsdmDevType
NVSDM Device Types.
Values:
-
enumerator NVSDM_DEV_TYPE_CA
Channel adapter device.
-
enumerator NVSDM_DEV_TYPE_SWITCH
Switch device.
-
enumerator NVSDM_DEV_TYPE_ROUTER
Routere device.
-
enumerator NVSDM_DEV_TYPE_RNIC
-
enumerator NVSDM_DEV_TYPE_GPU
-
enumerator NVSDM_DEV_TYPE_MAX
-
enumerator NVSDM_DEV_TYPE_NONE
-
enumerator NVSDM_DEV_TYPE_CA
3.2.2. Functions
-
nvsdmRet_t nvsdmDeviceGetDevID(nvsdmDevice_t const device, uint16_t *devID)
Retrieve device ID.
- Parameters
device – [in] The target device
devID – [out] The retrieved device ID
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle, or ifdevID
is NULL
-
nvsdmRet_t nvsdmDeviceGetGUID(nvsdmDevice_t const device, uint64_t *guid)
Retrieve the GUID for the given device.
- Parameters
device – [in] The input device
guid – [out] The GUID for
device
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle, or ifGUID
is NULL
-
nvsdmRet_t nvsdmDeviceGetLID(nvsdmDevice_t const device, uint16_t *lid)
Retrieve the LID for the given device.
- Parameters
device – [in] The input device
lid – [out] The LID for
device
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle, or iflid
is NULL
-
nvsdmRet_t nvsdmDeviceGetType(nvsdmDevice_t const device, unsigned int *type)
Retrieve device type.
- Parameters
device – [in] The target device
type – [out] The retrieved device type, one of nvsdmDevType
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle, or iftype
is NULL
-
nvsdmRet_t nvsdmDeviceGetVendorID(nvsdmDevice_t const device, uint32_t *vendorID)
Retrieve vendor ID of the given device.
- Parameters
device – [in] The target device
vendorID – [out] The retrieved vendor ID
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle, or ifvendorID
is NULL
-
nvsdmRet_t nvsdmGetAllDevices(nvsdmDeviceIter_t *iter)
Retrieve an iterator to the list of devices of every type.
- Parameters
iter – [out] Pointer to an opaque device iterator handle. Use the nvsdmGetNextDevice or nvsdmIterateDevices functions to iterate over the list.
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_UNINITIALIZED if the nvsdm interface was not initialized i.e. nvsdmInitialize was not called prior to calling this function
- Returns
NVSDM_ERROR_INVALID_ARG if
iter
is NULL
-
nvsdmRet_t nvsdmGetAllDevicesOfType(int type, nvsdmDeviceIter_t *iter)
Retrieve an iterator to the list of devices of type
type
.- Parameters
type – [in] Device type, one of nvsdmDevType
iter – [out] Pointer to an opaque device iterator handle. Use the nvsdmGetNextDevice or nvsdmIterateDevices functions to iterate over the list.
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_UNINITIALIZED if the nvsdm interface was not initialized i.e. nvsdmInitialize was not called prior to calling this function
- Returns
NVSDM_ERROR_INVALID_ARG if type is not one of nvsdmDevType, or if
iter
is NULL
-
nvsdmRet_t nvsdmGetDeviceGivenGUID(uint64_t guid, nvsdmDevice_t *dev)
Retrieve the device corresponding to the given GUID.
- Parameters
guid – [in] The device GUID
dev – [out] The device corresponding to the target
guid
; undefined if the return code is NVSDM_ERROR_DEVICE_NOT_FOUND
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_UNINITIALIZED if the nvsdm interface was not initialized i.e. nvsdmInitialize was not called prior to calling this function
- Returns
NVSDM_ERROR_DEVICE_NOT_FOUND if no device with GUID equal to
guid
is present
-
nvsdmRet_t nvsdmGetDeviceGivenLID(uint16_t lid, nvsdmDevice_t *dev)
Retrieve the device corresponding to the given LID.
- Parameters
lid – [in] The device LID
dev – [out] The device corresponding to the target
lid
; undefined if the return code is NVSDM_ERROR_DEVICE_NOT_FOUND
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_UNINITIALIZED if the nvsdm interface was not initialized i.e. nvsdmInitialize was not called prior to calling this function
- Returns
NVSDM_ERROR_DEVICE_NOT_FOUND if no device with LID equal to
lid
is present
-
nvsdmRet_t nvsdmGetNextDevice(nvsdmDeviceIter_t iter, nvsdmDevice_t *device)
Retrieve the next valid device handle in the list being iterated over by
iter
.- Parameters
iter – [in] Iterator to the list being iterated over.
device – [out] Reference to the next valid device handle, or NULL if no such handle exists.
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
iter
ordevice
are NULL
-
nvsdmRet_t nvsdmIterateDevices(nvsdmDeviceIter_t iter, nvsdmRet_t (*callback)(nvsdmDevice_t const, void*), void *cbData)
Iterate over a list of devices, calling
callback
on each.- Parameters
iter – [in] Iterator to the list being iterated over.
callback – [in] Callback function to invoke for each device instance.
cbData – [in] User-supplied data to pass to
callback
- Returns
NVSDM_SUCCESS on success any error return codes from
callback
-
nvsdmRet_t nvsdmResetDeviceList(nvsdmDeviceIter_t iter)
Reset the iterator to point to the first device in the list.
- Parameters
iter – [in] Iterator to the list being reset.
- Returns
NVSDM_SUCCESS on success
3.2.3. Typedefs
-
typedef struct nvsdmDeviceIter *nvsdmDeviceIter_t
Opaque handle for device iterators.
-
typedef struct nvsdmDevice *nvsdmDevice_t
Opaque handle for device/node descriptors.
3.3. Device Health
Query device health.
Macros
- nvsdmDeviceHealthStatus_v1
nvsdmDeviceHealthStatus_t version 1
Enumerations
- nvsdmDeviceHealthType_t
NVSDM Device Health Type.
Functions
- nvsdmRet_t nvsdmDeviceGetHealthStatus(nvsdmDevice_t const device, nvsdmDeviceHealthStatus_t *status)
Get the health status for the given HCA nvsdmDevice if supported.
Structs
- nvsdmDeviceHealthStatus_v1_t
NVSDM Device Health Status.
Typedefs
- nvsdmDeviceHealthStatus_t
Unversioned typedef to latest version of structure.
3.3.1. Macros
-
nvsdmDeviceHealthStatus_v1
nvsdmDeviceHealthStatus_t version 1
3.3.2. Enumerations
3.3.3. Functions
-
nvsdmRet_t nvsdmDeviceGetHealthStatus(nvsdmDevice_t const device, nvsdmDeviceHealthStatus_t *status)
Get the health status for the given HCA nvsdmDevice if supported.
- Parameters
device – [in] The target device
status – [out] The retrieved device health status, one of nvsdmDeviceHealthType_t
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle, or iftype
is NULL- Returns
NVSDM_ERROR_NOT_SUPPORTED if
device
does not support querying health status
3.3.4. Typedefs
-
typedef nvsdmDeviceHealthStatus_v1_t nvsdmDeviceHealthStatus_t
Unversioned typedef to latest version of structure.
3.4. Device Firmware Version
Query Firmware of Device.
Macros
- nvsdmVersionInfo_v1
nvsdmVersionInfo v1
Functions
- nvsdmRet_t nvsdmDeviceGetFirmwareVersion(nvsdmDevice_t const device, nvsdmVersionInfo_t *version)
Retrieve firmware version info for the
device
.
Structs
- nvsdmVersionInfo_v1_t
Generic structure to encode extended i.e.
Typedefs
- nvsdmVersionInfo_t
Unversioned typedef to latest version of structure.
3.4.1. Macros
-
nvsdmVersionInfo_v1
nvsdmVersionInfo v1
3.4.2. Functions
-
nvsdmRet_t nvsdmDeviceGetFirmwareVersion(nvsdmDevice_t const device, nvsdmVersionInfo_t *version)
Retrieve firmware version info for the
device
.Only supported for devices of type NVSDM_DEV_TYPE_SWITCH or NVSDM_DEV_TYPE_CA
- Parameters
device – [in] The target device
version – [out] Contains the firmware version for the given
device
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
version
is NULL- Returns
NVSDM_ERROR_NOT_SUPPORTED if
device
is not a supported device (i.e. is not a switch or CA)- Returns
NVSDM_ERROR_VERSION_NOT_SUPPORTED if
version->version
is not valid
3.4.3. Typedefs
-
typedef nvsdmVersionInfo_v1_t nvsdmVersionInfo_t
Unversioned typedef to latest version of structure.
3.5. PCI Info
Query PCI info for a device.
Macros
- nvsdmPCIInfo_v1
nvsdmPCIInfo_t v1
Functions
- nvsdmRet_t nvsdmDeviceGetPCIInfo(nvsdmDevice_t const device, nvsdmPCIInfo_t *info)
Retrieve PCI info (if available) for the given
device
.
Structs
- nvsdmPCIInfo_v1_t
Structure holding the PCI info of a device.
Typedefs
- nvsdmPCIInfo_t
Unversioned typedef to latest version of structure.
3.5.1. Macros
-
nvsdmPCIInfo_v1
nvsdmPCIInfo_t v1
3.5.2. Functions
-
nvsdmRet_t nvsdmDeviceGetPCIInfo(nvsdmDevice_t const device, nvsdmPCIInfo_t *info)
Retrieve PCI info (if available) for the given
device
.- Parameters
device – [in] Device handle for the target switch
info – [inout] Structure containing the version number(input) and the retrieved PCI info for
device
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle or ifinfo
is NULL- Returns
NVSDM_ERROR_VERSION_NOT_SUPPORTED if
info->version
is not valid- Returns
NVSDM_ERROR_NOT_SUPPORTED if
device
does not support PCI queries
3.5.3. Typedefs
-
typedef nvsdmPCIInfo_v1_t nvsdmPCIInfo_t
Unversioned typedef to latest version of structure.
3.6. Port functions
Functions relating to ports.
Macros
- NVSDM_MANAGEMENT_PORT_NUMBER
Special port number for the management port.
Functions
- nvsdmRet_t nvsdmDeviceGetPorts(nvsdmDevice_t const device, nvsdmPortIter_t *iter)
Retrieve an iterator to the list of ports from the given device.
- nvsdmRet_t nvsdmGetAllPorts(nvsdmPortIter_t *iter)
Retrieve an iterator to the list of ports in the network.
- nvsdmRet_t nvsdmGetNextPort(nvsdmPortIter_t iter, nvsdmPort_t *port)
Retrieve the next valid port handle in the list being iterated over by
iter
.- nvsdmRet_t nvsdmIteratePorts(nvsdmPortIter_t iter, nvsdmRet_t(*callback)(nvsdmPort_t const, void *), void *cbData)
Iterate over a list of ports, calling
callback
on each.- nvsdmRet_t nvsdmPortGetDevice(nvsdmPort_t const port, nvsdmDevice_t *device)
Retrieve the device that port belongs to.
- nvsdmRet_t nvsdmPortGetGID(nvsdmPort_t const port, uint8_t gid[16])
Retrieve the GID for the given port.
- nvsdmRet_t nvsdmPortGetGUID(nvsdmPort_t const port, uint64_t *guid)
Retrieve the GUID for the given port.
- nvsdmRet_t nvsdmPortGetLID(nvsdmPort_t const port, uint16_t *lid)
Retrieve the LID for the given port.
- nvsdmRet_t nvsdmPortGetLocalNum(nvsdmPort_t const port, unsigned int *localNum)
Retrieve local port number for the given port.
- nvsdmRet_t nvsdmPortGetNum(nvsdmPort_t const port, unsigned int *num)
Retrieve the port number from port.
- nvsdmRet_t nvsdmPortGetRemote(nvsdmPort_t const port, nvsdmPort_t *remote)
Return the nvsdm port handle connected to port, or NULL if port is not connected.
- nvsdmRet_t nvsdmResetPortList(nvsdmPortIter_t iter)
Reset the iterator to point to the first port in the list.
Typedefs
- nvsdmPortIter_t
Opaque handle for port iterators.
- nvsdmPort_t
Opaque handle for ports.
3.6.1. Macros
-
NVSDM_MANAGEMENT_PORT_NUMBER
Special port number for the management port.
3.6.2. Functions
-
nvsdmRet_t nvsdmDeviceGetPorts(nvsdmDevice_t const device, nvsdmPortIter_t *iter)
Retrieve an iterator to the list of ports from the given device.
- Parameters
device – [in] The input device
iter – [out] Iterator to the list of ports for
device
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle, or ifiter
is NULL
-
nvsdmRet_t nvsdmGetAllPorts(nvsdmPortIter_t *iter)
Retrieve an iterator to the list of ports in the network.
- Parameters
iter – [out] Pointer to an opaque port iterator handle. Use the nvsdmGetNextPort or nvsdmIteratePorts functions to iterate over the list.
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
iter
is NULL
-
nvsdmRet_t nvsdmGetNextPort(nvsdmPortIter_t iter, nvsdmPort_t *port)
Retrieve the next valid port handle in the list being iterated over by
iter
.- Parameters
iter – [in] Iterator to the list being iterated over.
port – [out] Reference to the next valid port handle, or NULL if no such handle exists.
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
iter
orport
are NULL
-
nvsdmRet_t nvsdmIteratePorts(nvsdmPortIter_t iter, nvsdmRet_t (*callback)(nvsdmPort_t const, void*), void *cbData)
Iterate over a list of ports, calling
callback
on each.- Parameters
iter – [in] Iterator to the list being iterated over.
callback – [in] Callback function to invoke for each port instance.
cbData – [in] User-supplied data to pass to
callback
- Returns
NVSDM_SUCCESS on success any error return codes from
callback
-
nvsdmRet_t nvsdmPortGetDevice(nvsdmPort_t const port, nvsdmDevice_t *device)
Retrieve the device that port belongs to.
- Parameters
port – [in] The input port
device – [out] The device that
port
belongs to
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
port
is not a valid port, or ifdevice
is NULL
-
nvsdmRet_t nvsdmPortGetGID(nvsdmPort_t const port, uint8_t gid[16])
Retrieve the GID for the given port.
- Parameters
port – [in] The input port
gid – [out] The GID for
port
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_UNINITIALIZED if the nvsdm interface was not initialized i.e. nvsdmInitialize was not called prior to calling this function
- Returns
NVSDM_ERROR_INVALID_ARG if
port
is not a valid nvsdm port handle, or ifgid
is NULL
-
nvsdmRet_t nvsdmPortGetGUID(nvsdmPort_t const port, uint64_t *guid)
Retrieve the GUID for the given port.
- Parameters
port – [in] The input port
guid – [out] The GUID for
port
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
port
is not a valid nvsdm port handle, or ifGUID
is NULL
-
nvsdmRet_t nvsdmPortGetLID(nvsdmPort_t const port, uint16_t *lid)
Retrieve the LID for the given port.
- Parameters
port – [in] The input port
lid – [out] The LID for
port
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_UNINITIALIZED if the nvsdm interface was not initialized i.e. nvsdmInitialize was not called prior to calling this function
- Returns
NVSDM_ERROR_INVALID_ARG if
port
is not a valid nvsdm port handle, or iflid
is NULL
-
nvsdmRet_t nvsdmPortGetLocalNum(nvsdmPort_t const port, unsigned int *localNum)
Retrieve local port number for the given port.
- Parameters
port – [in] The port whose local number needs to be retrieved.
localNum – [out] The retrieved local port number
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
port
orlocalNum
are NULL.
-
nvsdmRet_t nvsdmPortGetNum(nvsdmPort_t const port, unsigned int *num)
Retrieve the port number from port.
- Parameters
port – [in] The port whose number needs to be retrieved.
num – [out] The retrieved port number
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
port
ornum
are NULL.
-
nvsdmRet_t nvsdmPortGetRemote(nvsdmPort_t const port, nvsdmPort_t *remote)
Return the nvsdm port handle connected to port, or NULL if port is not connected.
- Parameters
port – [in] The input port
remote – [out] The remote part, or NULL if
port
is not connected.
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
port
is not a valid nvsdm port handle, or ifremote
is NULL
-
nvsdmRet_t nvsdmResetPortList(nvsdmPortIter_t iter)
Reset the iterator to point to the first port in the list.
- Parameters
iter – [in] Iterator to the list being reset.
- Returns
NVSDM_SUCCESS on success
3.6.3. Typedefs
-
typedef struct nvsdmPortIter *nvsdmPortIter_t
Opaque handle for port iterators.
-
typedef struct nvsdmPort *nvsdmPort_t
Opaque handle for ports.
3.7. Port Info
Query port info.
Macros
- nvsdmPortInfo_v1
nvsdmPortInfo_t v1
Enumerations
- nvsdmPortState_t
NVSDM Port States.
Functions
- nvsdmRet_t nvsdmPortGetInfo(nvsdmPort_t const port, nvsdmPortInfo_t *info)
Retrieve miscellaneous info about a port, including the port status and physical status, link speed and link width.
Structs
- nvsdmPortInfo_v1_t
NVSDM Port Info.
Typedefs
- nvsdmPortInfo_t
Unversioned typedef to latest version of structure.
3.7.1. Macros
-
nvsdmPortInfo_v1
nvsdmPortInfo_t v1
3.7.2. Enumerations
-
enum nvsdmPortState_t
NVSDM Port States.
Values:
-
enumerator NVSDM_PORT_STATE_NO_STATE_CHANGE
No state change.
-
enumerator NVSDM_PORT_STATE_DOWN
State down.
-
enumerator NVSDM_PORT_STATE_INITIALIZE
initialized state
-
enumerator NVSDM_PORT_STATE_ARMED
Armed state.
-
enumerator NVSDM_PORT_STATE_ACTIVE
Active state.
-
enumerator NVSDM_PORT_STATE_MAX
-
enumerator NVSDM_PORT_STATE_NONE
-
enumerator NVSDM_PORT_STATE_NO_STATE_CHANGE
3.7.3. Functions
-
nvsdmRet_t nvsdmPortGetInfo(nvsdmPort_t const port, nvsdmPortInfo_t *info)
Retrieve miscellaneous info about a port, including the port status and physical status, link speed and link width.
Refer to nvsdmPortInfo_t for a full list of the information retrieved.
- Parameters
port – [in] The target port
info – [out] The retrieved port info
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
port
is not a valid nvsdm port handle, or ifinfo
is NULL- Returns
NVSDM_ERROR_VERSION_NOT_SUPPORTED if
info->version
is not valid
3.7.4. Typedefs
-
typedef nvsdmPortInfo_v1_t nvsdmPortInfo_t
Unversioned typedef to latest version of structure.
3.8. Display and Print functions
Display/print functions.
Macros
- NVSDM_DESC_ARRAY_SIZE
Description array size.
- NVSDM_DEV_INFO_ARRAY_SIZE
Device info array size.
- NVSDM_INFO_ARRAY_SIZE
Info array size.
- NVSDM_PORT_INFO_ARRAY_SIZE
Port info array size.
Functions
- nvsdmRet_t nvsdmDeviceGetName(nvsdmDevice_t const device, char str[], unsigned int strSize)
Retrieve the name of the device, as corresponding to the IB "desc" field.
- nvsdmRet_t nvsdmDeviceGetShortName(nvsdmDevice_t const device, char str[], unsigned int strSize)
Retrieve a unique shortened name of the target device.
- nvsdmRet_t nvsdmDeviceToString(nvsdmDevice_t const device, char str[], unsigned int strSize)
Get a string description for the given device.
- nvsdmRet_t nvsdmPortToString(nvsdmPort_t const port, char str[], unsigned int strSize)
Get a string description for the given port.
3.8.1. Macros
-
NVSDM_DESC_ARRAY_SIZE
Description array size.
-
NVSDM_DEV_INFO_ARRAY_SIZE
Device info array size.
-
NVSDM_INFO_ARRAY_SIZE
Info array size.
-
NVSDM_PORT_INFO_ARRAY_SIZE
Port info array size.
3.8.2. Functions
-
nvsdmRet_t nvsdmDeviceGetName(nvsdmDevice_t const device, char str[], unsigned int strSize)
Retrieve the name of the device, as corresponding to the IB “desc” field.
- Parameters
device – [in] The input device
str – [out] The name of
device
strSize – [in] The max size of the
name
array
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle, or ifstr
is NULL- Returns
NVSDM_ERROR_INSUFFICIENT_SIZE if
strSize
is less than NVSDM_DESC_ARRAY_SIZE.
-
nvsdmRet_t nvsdmDeviceGetShortName(nvsdmDevice_t const device, char str[], unsigned int strSize)
Retrieve a unique shortened name of the target device.
This shortened name will have the prefix “CA”, “SW” or “RO” (corresponding to the device being one of an HCA, a SWitch or a ROuter, respectively), followed by a monotonically increasing integer. Examples of names include: “CA-01, CA-02, SW-01 and RO-1”. This shortened form of the name is especially useful when printing out a topology matrix, for instance.
- Parameters
device – [in] The input device
str – [out] The unique shortened name of
device
strSize – [in] The max size of the
name
array
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle, or ifstr
is NULL- Returns
NVSDM_ERROR_INSUFFICIENT_SIZE if
strSize
is less than NVSDM_DESC_ARRAY_SIZE.
-
nvsdmRet_t nvsdmDeviceToString(nvsdmDevice_t const device, char str[], unsigned int strSize)
Get a string description for the given device.
Terminated with ‘\0’. The format of the string is as follows: Name = <device_name>, DevID = <device_ID>, VendorID = <vendor_ID>, GUID = <hexadecimal_GUID>
- Parameters
device – [in] The input device
str – [out] The string representation of
device
strSize – [in] The max size of the
str
array
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_UNINITIALIZED if the nvsdm interface was not initialized i.e. nvsdmInitialize was not called prior to calling this function
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle- Returns
NVSDM_ERROR_INSUFFICIENT_SIZE if
strSize
is not large enough to contain the full string description (including the trailing ‘\0’ character). Minimum size required is NVSDM_DEV_INFO_ARRAY_SIZE.
-
nvsdmRet_t nvsdmPortToString(nvsdmPort_t const port, char str[], unsigned int strSize)
Get a string description for the given port.
Terminated with ‘\0’. The format of the string is as follows: portId = <port_id>, LID = <port_LID>, GUID = <hexadecimal_GUID>
- Parameters
port – [in] The input port
str – [out] The string representation of
port
strSize – [in] The max size of the
str
array
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_UNINITIALIZED if the nvsdm interface was not initialized i.e. nvsdmInitialize was not called prior to calling this function
- Returns
NVSDM_ERROR_INVALID_ARG if
port
is not a valid nvsdm port handle- Returns
NVSDM_ERROR_INSUFFICIENT_SIZE if
strSize
is less than NVSDM_PORT_INFO_ARRAY_SIZE.
3.9. Switch Info
Query NVSwitch info.
Macros
- nvsdmSwitchInfo_v1
nvsdmSwitchInfo_t v1
Structs
- nvsdmSwitchInfo_v1_t
NVSDM Switch Info.
Typedefs
- nvsdmSwitchInfo_t
Unversioned typedef to latest version of structure.
3.9.1. Macros
-
nvsdmSwitchInfo_v1
nvsdmSwitchInfo_t v1
3.9.2. Typedefs
-
typedef nvsdmSwitchInfo_v1_t nvsdmSwitchInfo_t
Unversioned typedef to latest version of structure.
3.10. Query Telemetry
Query device telemetry data.
Macros
- nvsdmTelemParam_v1
nvsdmTelemParam_t version 1
Enumerations
- nvsdmConnectXTelemCounter_t
NVSDM ConnectX telemetry IDs.
- nvsdmOperationType_t
Currently ignored.
- nvsdmPlatformTelemCounter_t
NVSDM platform telemetry IDs.
- nvsdmPortTelemCounter_t
NVSDM counter IDs.
- nvsdmTelemType_t
NVSDM telemetry type.
- nvsdmValType_t
NVSDM value types.
Functions
- nvsdmRet_t nvsdmDeviceGetSwitchInfo(nvsdmDevice_t const device, nvsdmSwitchInfo_t *info)
Retrieve information corresponding to the SwitchInfo MAD attribute from the switch referenced by device.
- nvsdmRet_t nvsdmDeviceGetTelemetryValues(nvsdmDevice_t const device, nvsdmTelemParam_t *param)
Retrieve telemetry values from a ConnectX HCA.
- nvsdmRet_t nvsdmPortGetTelemetryValues(nvsdmPort_t const port, nvsdmTelemParam_t *param)
Retrieve telemetry values.
Structs
- nvsdmTelemParam_v1_t
NVSDM telemetry structure.
- nvsdmTelem_v1_t
NVSDM telemetry structure.
Typedefs
- nvsdmTelemParam_t
Unversioned typedef to latest version of structure.
Unions
- nvsdmVal_t
NVSDM value union.
3.10.1. Macros
-
nvsdmTelemParam_v1
nvsdmTelemParam_t version 1
3.10.2. Enumerations
-
enum nvsdmConnectXTelemCounter_t
NVSDM ConnectX telemetry IDs.
Values:
-
enumerator NVSDM_CONNECTX_TELEM_CTR_ACTIVE_PCIE_LINK_WIDTH
-
enumerator NVSDM_CONNECTX_TELEM_CTR_ACTIVE_PCIE_LINK_SPEED
-
enumerator NVSDM_CONNECTX_TELEM_CTR_EXPECT_PCIE_LINK_WIDTH
-
enumerator NVSDM_CONNECTX_TELEM_CTR_EXPECT_PCIE_LINK_SPEED
-
enumerator NVSDM_CONNECTX_TELEM_CTR_CORRECTABLE_ERR_STATUS
-
enumerator NVSDM_CONNECTX_TELEM_CTR_CORRECTABLE_ERR_MASK
-
enumerator NVSDM_CONNECTX_TELEM_CTR_UNCORRECTABLE_ERR_STATUS
-
enumerator NVSDM_CONNECTX_TELEM_CTR_UNCORRECTABLE_ERR_MASK
-
enumerator NVSDM_CONNECTX_TELEM_CTR_UNCORRECTABLE_ERR_SEVERITY
-
enumerator NVSDM_CONNECTX_TELEM_CTR_DEVICE_TEMPERATURE
-
enumerator NVSDM_CONNECTX_TELEM_CTR_PCIE_LINK_INBOUND_BYTES
-
enumerator NVSDM_CONNECTX_TELEM_CTR_PCIE_LINK_OUTBOUND_BYTES
-
enumerator NVSDM_CONNECTX_TELEM_CTR_MAX
-
enumerator NVSDM_CONNECTX_TELEM_CTR_NONE
-
enumerator NVSDM_CONNECTX_TELEM_CTR_ACTIVE_PCIE_LINK_WIDTH
-
enum nvsdmOperationType_t
Currently ignored.
Values:
-
enumerator NVSDM_OPERATION_GET
-
enumerator NVSDM_OPERATION_SET
-
enumerator NVSDM_OPERATION_RESET
-
enumerator NVSDM_OPERATION_NONE
-
enumerator NVSDM_OPERATION_GET
-
enum nvsdmPlatformTelemCounter_t
NVSDM platform telemetry IDs.
Values:
-
enumerator NVSDM_PLATFORM_TELEM_CTR_VOLTAGE
-
enumerator NVSDM_PLATFORM_TELEM_CTR_CURRENT_NOT_SUPPORTED
-
enumerator NVSDM_PLATFORM_TELEM_CTR_POWER
-
enumerator NVSDM_PLATFORM_TELEM_CTR_TEMPERATURE
-
enumerator NVSDM_PLATFORM_TELEM_CTR_MAX
-
enumerator NVSDM_PLATFORM_TELEM_CTR_NONE
-
enumerator NVSDM_PLATFORM_TELEM_CTR_VOLTAGE
-
enum nvsdmPortTelemCounter_t
NVSDM counter IDs.
Values:
-
enumerator NVSDM_PORT_TELEM_CTR_RCV_PKTS
32b counter; see
NVSDM_PORT_TELEM_CTR_EXT_RCV_PKTS
for 64b version
-
enumerator NVSDM_PORT_TELEM_CTR_RCV_DATA
32b counter; see
NVSDM_PORT_TELEM_CTR_EXT_RCV_DATA
for 64b version
-
enumerator NVSDM_PORT_TELEM_CTR_MCAST_RCV_PKTS
-
enumerator NVSDM_PORT_TELEM_CTR_UCAST_RCV_PKTS
-
enumerator NVSDM_PORT_TELEM_CTR_MFRMD_PKTS
-
enumerator NVSDM_PORT_TELEM_CTR_VL15_DROPPED
-
enumerator NVSDM_PORT_TELEM_CTR_RCV_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_XMIT_PKTS
32b counter; see
NVSDM_PORT_TELEM_CTR_EXT_XMIT_PKTS
for 64b version
-
enumerator NVSDM_PORT_TELEM_CTR_XMIT_DATA
32b counter; see
NVSDM_PORT_TELEM_CTR_EXT_XMIT_DATA
for 64b version
-
enumerator NVSDM_PORT_TELEM_CTR_UCAST_XMIT_PKTS
-
enumerator NVSDM_PORT_TELEM_CTR_MCAST_XMIT_PKTS
-
enumerator NVSDM_PORT_TELEM_CTR_XMIT_DISCARD
-
enumerator NVSDM_PORT_TELEM_CTR_NBR_MTU_DISCARDS
-
enumerator NVSDM_PORT_TELEM_CTR_SYM_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_LNK_ERR_REC_CTR
-
enumerator NVSDM_PORT_TELEM_CTR_LNK_DWND_CTR
-
enumerator NVSDM_PORT_TELEM_CTR_RCV_RMT_PHY_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_RCV_SWTCH_REL_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_QP1_DROPPED
-
enumerator NVSDM_PORT_TELEM_CTR_XMIT_WAIT
-
enumerator NVSDM_PORT_TELEM_CTR_PDDR_OP_INFO_LINK_SPEED_ACTIVE
-
enumerator NVSDM_PORT_TELEM_CTR_PDDR_OP_INFO_LINK_WIDTH_ACTIVE
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_SYM_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_SYNC_HDR_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_EDPL_BIP_ERR_LANE_0
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_EDPL_BIP_ERR_LANE_1
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_EDPL_BIP_ERR_LANE_2
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_EDPL_BIP_ERR_LANE_3
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_FC_FEC_COR_BLKS_LANE_0
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_FC_FEC_COR_BLKS_LANE_1
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_FC_FEC_COR_BLKS_LANE_2
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_FC_FEC_COR_BLKS_LANE_3
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_RS_FEC_COR_BLKS
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_RS_FEC_UNCOR_BLKS
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_RS_FEC_NO_ERR_BLKS
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_RS_FEC_COR_SYM_TOTAL
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_FC_FEC_COR_SYM_LANE_0
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_FC_FEC_COR_SYM_LANE_1
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_FC_FEC_COR_SYM_LANE_2
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_FC_FEC_COR_SYM_LANE_3
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X12_SUCCESSFUL_RECOV_EVENTS
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_TIME_SINCE_LAST_CLEAR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_PHY_RECV_BITS
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_PHY_SYM_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_PHY_CORR_BITS
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_RAW_ERR_LANE_0
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_RAW_ERR_LANE_1
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_RAW_ERR_LANE_2
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_RAW_ERR_LANE_3
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_RAW_ERR_LANE_4
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_RAW_ERR_LANE_5
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_RAW_ERR_LANE_6
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_RAW_ERR_LANE_7
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_RAW_BER
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_EFF_BER
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_SYM_BER
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X16_PHY_EFFECTIVE_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_SYM_ERR_CTR_TO_BE_REMOVED
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_LINK_ERR_REC_CTR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_LINK_DWNED_CTR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_PORT_RCV_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_PORT_RCV_REM_PHY_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_RCV_SWTCH_REL_ERR_TO_BE_REMOVED
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_XMIT_DISCARD_TO_BE_REMOVED
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_XMIT_CNSTR_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_RCV_CNSTR_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_LOCAL_LINK_INTEG_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_EXSV_BUFF_OVRUN_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_VL15_DROPPED_TO_BE_REMOVED
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_XMIT_DATA_TO_BE_REMOVED
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_RCV_DATA_TO_BE_REMOVED
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_XMIT_PKTS_TO_BE_REMOVED
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_RCV_PKTS_TO_BE_REMOVED
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X20_XMIT_WAIT_TO_BE_REMOVED
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X22_RCV_CODES
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X22_RCV_CODES_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X22_RCV_UNCORRECTABLE_CODE
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X22_XMIT_CODES
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X22_XMIT_RETRY_CODES
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X22_XMIT_RETRY_EVENTS
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X22_SYNC_EVENTS
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X22_CODES_LOSS
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X22_XMIT_RETRY_EVTS_WTHN_TSEC_MAX
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X22_TIME_SINCE_LAST_CLEAR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_0
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_1
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_2
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_3
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_4
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_5
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_6
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_7
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_8
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_9
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_10
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_11
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_12
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_13
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_14
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_15
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_16
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_17
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_18
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_19
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X23_PHY_RS_HIST_20
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_TIME_SINCE_LAST_CLEAR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_PORT_UCAST_XMIT_PKTS_TO_BE_REMOVED
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_PORT_UCAST_RCV_PKTS_TO_BE_REMOVED
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_SYNC_HDR_ERR_CTR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_PORT_LOC_PHY_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_PORT_MFRMD_PKT_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_PORT_BUFF_OVRUN_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_PORT_DLID_MAP_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_PORT_VL_MAP_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_PORT_LOOP_ERR
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_PORT_INACT_DISC
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X25_PORT_NBOR_MTU_DISC
-
enumerator NVSDM_PORT_TELEM_CTR_GRP_X26_RQ_GENERAL_ERROR
-
enumerator NVSDM_PORT_TELEM_CTR_EXT_XMIT_DATA
64b counter; see
NVSDM_PORT_TELEM_CTR_XMIT_DATA
for 32b version
-
enumerator NVSDM_PORT_TELEM_CTR_EXT_RCV_DATA
64b counter; see
NVSDM_PORT_TELEM_CTR_RCV_DATA
for 32b version
-
enumerator NVSDM_PORT_TELEM_CTR_EXT_XMIT_PKTS
64b counter; see
NVSDM_PORT_TELEM_CTR_XMIT_PKTS
for 32b version
-
enumerator NVSDM_PORT_TELEM_CTR_EXT_RCV_PKTS
64b counter; see
NVSDM_PORT_TELEM_CTR_RCV_PKTS
for 32b version
-
enumerator NVSDM_PORT_TELEM_CTR_MAX
-
enumerator NVSDM_PORT_TELEM_CTR_NONE
-
enumerator NVSDM_PORT_TELEM_CTR_RCV_PKTS
-
enum nvsdmTelemType_t
NVSDM telemetry type.
Values:
-
enumerator NVSDM_TELEM_TYPE_PORT
Basic port telemetry.
-
enumerator NVSDM_TELEM_TYPE_PLATFORM
Telemetry from QM3 ASIC sensors.
-
enumerator NVSDM_TELEM_TYPE_CUSTOM
Custom counter.
-
enumerator NVSDM_TELEM_TYPE_CONNECTX
ConnectX telemetry counter.
-
enumerator NVSDM_TELEM_TYPE_MAX
-
enumerator NVSDM_TELEM_TYPE_NONE
-
enumerator NVSDM_TELEM_TYPE_PORT
-
enum nvsdmValType_t
NVSDM value types.
Values:
-
enumerator NVSDM_VAL_TYPE_DOUBLE
-
enumerator NVSDM_VAL_TYPE_UINT64
-
enumerator NVSDM_VAL_TYPE_INT64
-
enumerator NVSDM_VAL_TYPE_FLOAT
-
enumerator NVSDM_VAL_TYPE_UINT32
-
enumerator NVSDM_VAL_TYPE_INT32
-
enumerator NVSDM_VAL_TYPE_UINT16
-
enumerator NVSDM_VAL_TYPE_INT16
-
enumerator NVSDM_VAL_TYPE_UINT8
-
enumerator NVSDM_VAL_TYPE_INT8
-
enumerator NVSDM_VAL_TYPE_NONE
-
enumerator NVSDM_VAL_TYPE_DOUBLE
3.10.3. Functions
-
nvsdmRet_t nvsdmDeviceGetSwitchInfo(nvsdmDevice_t const device, nvsdmSwitchInfo_t *info)
Retrieve information corresponding to the SwitchInfo MAD attribute from the switch referenced by device.
Refer to nvsdmSwitchInfo_t for a full list of the information retrieved.
- Parameters
device – [in] Device handle for the target switch
info – [out] The retrieved switch info
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle, or refers to a non-switch device, or ifinfo
is NULL- Returns
NVSDM_ERROR_VERSION_NOT_SUPPORTED if
info->version
is not valid
-
nvsdmRet_t nvsdmDeviceGetTelemetryValues(nvsdmDevice_t const device, nvsdmTelemParam_t *param)
Retrieve telemetry values from a ConnectX HCA.
On return, status code in individual entries in
telemVals
describe success/failure when retrieving the given telemetry value.- Parameters
device – [in] The device from which to retrieve telemetry values
param – [inout] Structure wrapping the array of telemetry counters to be read.
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_UNINITIALIZED if the nvsdm interface was not initialized i.e.
nvsdmInitialize
was not called prior to calling this function- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm device handle, or ifparam
is NULL- Returns
NVSDM_ERROR_VERSION_NOT_SUPPORTED if
param->version
is not valid
-
nvsdmRet_t nvsdmPortGetTelemetryValues(nvsdmPort_t const port, nvsdmTelemParam_t *param)
Retrieve telemetry values.
On return, status code in individual entries in
telemVals
describe success/failure when retrieving the given telemetry value.- Parameters
port – [in] The port from which to retrieve telemetry values
param – [inout] Structure wrapping the array of telemetry counters to be read.
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_UNINITIALIZED if the nvsdm interface was not initialized i.e. nvsdmInitialize was not called prior to calling this function
- Returns
NVSDM_ERROR_INVALID_ARG if
device
is not a valid nvsdm port handle, or ifparam
is NULL- Returns
NVSDM_ERROR_VERSION_NOT_SUPPORTED if
param->version
is not valid
3.10.4. Typedefs
-
typedef nvsdmTelemParam_v1_t nvsdmTelemParam_t
Unversioned typedef to latest version of structure.
3.11. Topology functions
Discovery and topology functions.
Macros
- NVSDM_MAX_DEVICES
The maximum number of devices discoverable.
Functions
- nvsdmRet_t nvsdmDiscoverTopology(char *srcCA, int srcPort)
Discover network topology.
3.11.1. Macros
-
NVSDM_MAX_DEVICES
The maximum number of devices discoverable.
3.11.2. Functions
-
nvsdmRet_t nvsdmDiscoverTopology(char *srcCA, int srcPort)
Discover network topology.
- Parameters
srcCA – [in] CA of the start point i.e. the CA from which to start the topology discovery process. Set to NULL to use the first CA with a connected port.
srcPort – [in] Port number of the start point. Ignored if
srcCA
is NULL.
- Returns
NVSDM_SUCCESS on success
- Returns
NVSDM_ERROR_UNINITIALIZED if the nvsdm interface was not initialized i.e. nvsdmInitialize was not called prior to calling this function
3.12. nvsdmDeviceHealthStatus_v1_t
-
struct nvsdmDeviceHealthStatus_v1_t
NVSDM Device Health Status.
3.13. nvsdmPCIInfo_v1_t
-
struct nvsdmPCIInfo_v1_t
Structure holding the PCI info of a device.
3.14. nvsdmPortInfo_v1_t
-
struct nvsdmPortInfo_v1_t
NVSDM Port Info.
Public Members
-
uint32_t version
The version number of this struct.
-
int32_t portState
Port state. One of
nvsdmPortState_t
.
-
int32_t portPhysState
Port physical state. One of
nvsdmPortState_t
.
-
uint32_t linkWidthActive
Link width active.
-
uint32_t linkWidthEnabled
Link width enabled.
-
uint32_t linkWidthSupported
Link width supported.
-
uint32_t linkSpeedSupported
Link speed supported.
-
uint32_t linkSpeedActive
Link speed active.
-
uint32_t linkSpeedEnabled
Link speed enabled.
-
uint32_t linkSpeedExtActive
Link speed ext active.
-
uint32_t fdr10
FDR10.
-
uint32_t version
3.15. nvsdmSwitchInfo_v1_t
-
struct nvsdmSwitchInfo_v1_t
NVSDM Switch Info.
Public Members
-
uint32_t version
The version number of this struct.
-
uint16_t linearFDBCap
linear FDB cap
-
uint16_t randomFDBCap
random FDB cap
-
uint16_t multicastFDBCap
multicast FDB cap
-
uint16_t linearFDBTop
linear FDB top
-
uint8_t defaultPort
Default port.
-
uint8_t defaultMulticastPrimaryPort
Default multicast primary port.
-
uint8_t defaultMulticastNotPrimaryPort
Default multicast not primary port.
-
uint8_t lifeTimeValue
Lifetime value.
-
uint8_t portStateChange
Port state change.
-
uint8_t optimizedSLToVLMappingProgramming
Optimized SL To VL Mapping Programming.
-
uint16_t lidsPerPort
LIDs per port.
-
uint16_t partitionEnforcementCap
partition encorcement cap
-
uint8_t inboundEnforcementCap
inbound Enforcement cap
-
uint8_t outboundEnforcementCap
outbound enforcementcap
-
uint8_t filterRawInboundCap
filter raw inbound cap
-
uint8_t filterRawOutboundCap
filter raw outbound cap
-
uint8_t enhancedPort0
enhanced port 0
-
uint8_t disableDRSMPClassVersionValidationSupportedNotAvailable
No entry in “enum MAD_FIELDS” in infinband “mad.h” header.
-
uint8_t disableDRSMPClassVersionValidationEnabledNotAvailable
No entry in “enum MAD_FIELDS” in infinband “mad.h” header.
-
uint16_t multicastFDBTop
multicast FDB
-
uint32_t version
3.16. nvsdmTelem_v1_t
-
struct nvsdmTelem_v1_t
NVSDM telemetry structure.
Public Members
-
uint8_t telemType
One of
nvsdmTelemType_t
.
-
uint8_t reserved
Reserved for future use.
-
uint16_t telemCtr
One of
nvsdmPortTelemCounter_t
ornvsdmPlatformTelemCounter_t
ornvsdmConnectXTelemCounter_t
a custom telemetry counter, depending on the value oftelemType
.
-
uint16_t valType
One of
nvsdmValType_t
.
-
nvsdmVal_t val
The retrieved telemtry value; only valid if status is
NVSDM_SUCCESS
.
-
uint16_t status
One of
nvsdmRet_t
.
-
uint8_t telemType
3.17. nvsdmTelemParam_v1_t
-
struct nvsdmTelemParam_v1_t
NVSDM telemetry structure.
Public Members
-
uint32_t version
The version number of this struct.
-
uint32_t numTelemEntries
Number of entries in the
telemValsArray
.
-
nvsdmTelem_v1_t *telemValsArray
Array of
nvsdmTelem_v1_t
instances.
-
uint32_t version
3.18. nvsdmVersionInfo_v1_t
-
struct nvsdmVersionInfo_v1_t
Generic structure to encode extended i.e.
32b version numbers.
3.19. nvsdmVal_t
-
union nvsdmVal_t
NVSDM value union.
Public Members
-
double dVal
Double.
-
uint64_t u64Val
64 bit unsigned int
-
int64_t s64Val
64 bit signed int
-
float fVal
Float.
-
uint32_t u32Val
32 bit unsigned int
-
int32_t s32Val
32 bit signed int
-
uint16_t u16Val
16 bit unsigned int
-
int16_t s16Val
16 bit signed int
-
uint8_t u8Val
8 bit unsigned int
-
int8_t s8Val
8 bit signed int
-
double dVal