NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

The NvSciIpc library provides interfaces for any two entities in a system to communicate with each other irrespective of where they are placed. Entities can be in:

Each of these different boundaries will be abstracted by a library providing unified communication (Read/Write) APIs to entities. The communication consists of two bi-directional send/receive queues.

Programming model in using NvSciIpc library is explained in SDK developer guide with examples.

Note
Start-up sequence
Single thread handling Tx and Rx data
  • For Inter-VM and Inter-Process backend applications on QNX OS, only a single event-blocking OS API (e.g. NvSciIpcWaitEventQnx(), NvSciEventLoopService::WaitForEvent()) is allowed per endpoint in the same process boundary. If a client application tries to use receiving and sending thread separately for the same endpoint handle, the event-blocking OS APIs must be used in a single thread in order to receive remote notification. Once a remote notification arrives in the thread, the notification should be forwarded to the other thread using the same endpoint handle through any OS synchronization method (e.g. sem_post, pthread_cond_signal or MsgSendPulse etc.) Single thread usage is recommended to handle both TX and RX data.
Getting events before using Read/Write NvSciIpc API
Checksum for data integrity
  • NvSciIpc does not provide checksum for data to be transferred or check for data integrity error. If such a mechanism is required, the client user should implement checksum processing routine for data.
Use ChannelCreatePulsePool() - QNX OS
  • In using legacy event handling (without NvSciEventService) on NvSciIpc, user has to create chid and coid using ChannelCreate_r() and ConnectAttach_r() before calling NvSciIpcSetQnxPulseParamSafe(). This ChannelCreate() uses global pulse message pool. If privileged and non-privileged processes use the same global pool, unprivileged processes can potentially interfere with privileged processes by receiving and not handling large numbers of pulses (thereby causing denial of service attack). So, ChannelCreatePulsePool() API is recommended to use fixed private pool of pulses instead of using ChannelCreate_r().
    struct nto_channel_config {
    struct sigevent event;
    unsigned num_pulses;
    unsigned rearm_threshold;
    unsigned options;
    unsigned reserved[3];
    }
  • The num_pulses should be based on the number of event notifications that can occur at the same time. The notifications that can occur on an endpoint are reset /read /write and are independent of each other, so at least 3 notifications can occur on one endpoint.
    num_pulses = 3 * number of endpoints
  • More information can be found in QNX OS manual page.
  • In order to detect IVC signalling storm, user needs to create separate thread to receive semaphore event which is set in nto_channel_config structure and call sem_wait() in that thread. NvSciIpcInspectEventQnx() API returns NvSciIpcEndpoint handle in which IVC signalling storm happens. User can decide post action (e.g. close endpoint, restart process, deinit NvSciIpc etc.) per system usecase scenario after detecting issue.
Configuring thread pool of resource manager - QNX OS
  • NvSciIpc resource manager (io-nvsciipc) uses thread pool to manage concurrent request from multiple NvSciIpc client processes using NvSciIpc library. io-nvsciipc is used during opening endpoint. Users should evaluate thread pool capacity of io-nvsciipc then configure them with -t option in startup script. Thread pool capacity for NvSciIPC can be evaluated based on number of parallel outstanding NvSciIPC requests, at any point of time, that are expected in the system. Default value of thread pool capacity is 10.
When to use blocking API
Consideration when choosing Read/Write APIs
Maximum number of endpoints
  • One NvSciIpc client process is allowed to open up to 500 endpoints. QNX NvSciIpc opens two device nodes in opening endpoint. QNX OS kernel supports 1024 100 open channels without disabling kernel preemption. User client needs one channel/connection pair to receive an endpoint notification.
Concurrent read/write
  • Client processes who want concurrent read and write operation on endpoints need to open two endpoints, one for read and the other for write operation. Read and write operation on different endpoint work exclusively without any external locking mechanism in multiple threads. Channel memory consumption will be doubled in using two endpoints.

Data Structures

struct  NvSciIpcEndpointAccessInfo
 Defines access information about NvSciIpc endpoint. More...
 
struct  NvSciIpcEndpointInfo
 Defines information about the NvSciIpc endpoint. More...
 

Macros

#define NVSCIIPC_BACKEND_ITC   0U
 backend type definition More...
 
#define NVSCIIPC_BACKEND_IPC   1U
 
#define NVSCIIPC_BACKEND_ITC_NVSCICOM   2U
 
#define NVSCIIPC_BACKEND_IPC_NVSCICOM   3U
 
#define NVSCIIPC_BACKEND_ITC_IVCLIB   4U
 
#define NVSCIIPC_BACKEND_IPC_IVCLIB   5U
 
#define NVSCIIPC_BACKEND_IVC   6U
 
#define NVSCIIPC_BACKEND_C2C   7U
 
#define NVSCIIPC_BACKEND_C2C_PCIE   7U
 
#define NVSCIIPC_BACKEND_C2C_NPM   8U
 
#define NVSCIIPC_BACKEND_MAX   9U
 
#define NVSCIIPC_INVALID_IRQ   (0xFFFFFFFFU)
 
#define NVSCIIPC_INVALID_IID   (-1)
 
#define NVSCIIPC_MAX_ENDPOINT_NAME   64U
 Specifies maximum Endpoint name length including null terminator. More...
 
#define NV_SCI_IPC_EVENT_READ   0x01U
 Specifies the IPC read event. More...
 
#define NV_SCI_IPC_EVENT_WRITE   0x02U
 Specifies the IPC write event. More...
 
#define NV_SCI_IPC_EVENT_CONN_EST   0x04U
 Specifies the IPC connection established event. More...
 
#define NV_SCI_IPC_EVENT_CONN_RESET   0x08U
 Specifies the IPC connection reset event. More...
 
#define NV_SCI_IPC_EVENT_WRITE_EMPTY   0x10U
 Specifies the IPC write fifo empty event. More...
 
#define NV_SCI_IPC_EVENT_ASYNC_ERROR   0x20U
 Specifies the IPC asynchronous error event. More...
 
#define NV_SCI_IPC_EVENT_CONN_EST_ALL
 Specifies single event mask to check IPC connection establishment. More...
 
#define NVSCIIPC_INFINITE_WAIT   -1LL
 infinite timeout for NvSciIpcWaitEventQnx() More...
 
#define NV_SCI_ASYNC_PCIE_EDMA_XFER_ERROR   0x1U
 Indicates there is eDMA error during PCIE operation. More...
 
#define NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_FATAL   0x2U
 Indicates there is uncorrectable fatal error during PCIE operation. More...
 
#define NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_NONFATAL   0x4U
 Indicates there is uncorrectable non fatal error during PCIE operation. More...
 
#define NV_SCI_ASYNC_PCIE_VALIDATION_ERROR   0x8U
 Indicates there is validation error. More...
 

Typedefs

typedef uint64_t NvSciIpcEndpoint
 Handle to the NvSciIpc endpoint. More...
 
typedef struct NvSciIpcEndpointInfo NvSciIpcEndpointInfo
 
typedef uint64_t NvSciIpcEndpointVuid
 VUID(VM unique ID) of the NvSciIpc endpoint. More...
 
typedef struct NvSciIpcEndpointAccessInfo NvSciIpcEndpointAccessInfo
 

Functions

NvSciError NvSciIpcInit (void)
 Initializes the NvSciIpc library. More...
 
void NvSciIpcDeinit (void)
 De-initializes the NvSciIpc library. More...
 
NvSciError NvSciIpcOpenCfgBlob (void)
 Opens NvSciIpc ConfigBlob. More...
 
NvSciError NvSciIpcGetEndpointAccessInfo (const char *endpoint, NvSciIpcEndpointAccessInfo *info)
 Gets endpoint access information from ConfigBlob. More...
 
void NvSciIpcCloseCfgBlob (void)
 Closes NvSciIpc ConfigBlob. More...
 
NvSciError NvSciIpcOpenEndpoint (const char *endpoint, NvSciIpcEndpoint *handle)
 Opens an endpoint with the given name. More...
 
NvSciError NvSciIpcOpenEndpointWithEventService (const char *endpoint, NvSciIpcEndpoint *handle, NvSciEventService *eventService)
 Opens an endpoint with the given name and event service. More...
 
NvSciError NvSciIpcGetEventNotifier (NvSciIpcEndpoint handle, NvSciEventNotifier **eventNotifier)
 Get NvSciIpc event notifier. More...
 
void NvSciIpcCloseEndpoint (NvSciIpcEndpoint handle)
 Closes an endpoint with the given handle. More...
 
NvSciError NvSciIpcCloseEndpointSafe (NvSciIpcEndpoint handle, bool clear)
 Closes an endpoint with the given handle (safety version) More...
 
void NvSciIpcResetEndpoint (NvSciIpcEndpoint handle)
 Resets an endpoint. More...
 
NvSciError NvSciIpcResetEndpointSafe (NvSciIpcEndpoint handle)
 Resets an endpoint. More...
 
NvSciError NvSciIpcRead (NvSciIpcEndpoint handle, void *buf, size_t size, int32_t *bytes)
 Reads a frame from the endpoint. More...
 
NvSciError NvSciIpcReadSafe (NvSciIpcEndpoint handle, void *buf, uint32_t size, uint32_t *bytes)
 Reads a frame from the endpoint (safety version) More...
 
NvSciError NvSciIpcReadGetNextFrame (NvSciIpcEndpoint handle, const volatile void **buf)
 Get a pointer to the read frame from the endpoint. More...
 
NvSciError NvSciIpcReadAdvance (NvSciIpcEndpoint handle)
 Advance to the next read frame of the endpoint. More...
 
NvSciError NvSciIpcWrite (NvSciIpcEndpoint handle, const void *buf, size_t size, int32_t *bytes)
 Writes a frame to the endpoint. More...
 
NvSciError NvSciIpcWriteSafe (NvSciIpcEndpoint handle, const void *buf, uint32_t size, uint32_t *bytes)
 Writes a frame to the endpoint. More...
 
NvSciError NvSciIpcWriteGetNextFrame (NvSciIpcEndpoint handle, volatile void **buf)
 Get a pointer to the write frame from the endpoint. More...
 
NvSciError NvSciIpcWriteAdvance (NvSciIpcEndpoint handle)
 Advance to the next write frame of the endpoint. More...
 
NvSciError NvSciIpcGetEndpointInfo (NvSciIpcEndpoint handle, NvSciIpcEndpointInfo *info)
 Returns endpoint information. More...
 
NvSciError NvSciIpcGetLinuxEventFd (NvSciIpcEndpoint handle, int32_t *fd)
 Returns the NvSciIpc file descriptor for a given endpoint. More...
 
NvSciError NvSciIpcGetEvent (NvSciIpcEndpoint handle, uint32_t *events)
 Get Events. More...
 
NvSciError NvSciIpcGetEventSafe (NvSciIpcEndpoint handle, uint32_t *events)
 Get Events (safety version) More...
 
NvSciError NvSciIpcGetAsyncErrors (NvSciIpcEndpoint handle, uint32_t *errors)
 Get asynchronouse errors. More...
 
NvSciError NvSciIpcEnableNotification (NvSciIpcEndpoint handle, bool flag)
 Enable event notification (or polling) More...
 
NvSciError NvSciIpcCheckVersionCompatibility (uint32_t majorVer, uint32_t minorVer, bool *isCompatible)
 Check NvSciIpc library version compatibility. More...
 

Macro Definition Documentation

◆ NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_FATAL

#define NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_FATAL   0x2U

Indicates there is uncorrectable fatal error during PCIE operation.

Definition at line 422 of file nvsciipc.h.

◆ NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_NONFATAL

#define NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_NONFATAL   0x4U

Indicates there is uncorrectable non fatal error during PCIE operation.

Definition at line 424 of file nvsciipc.h.

◆ NV_SCI_ASYNC_PCIE_EDMA_XFER_ERROR

#define NV_SCI_ASYNC_PCIE_EDMA_XFER_ERROR   0x1U

Indicates there is eDMA error during PCIE operation.

Definition at line 420 of file nvsciipc.h.

◆ NV_SCI_ASYNC_PCIE_VALIDATION_ERROR

#define NV_SCI_ASYNC_PCIE_VALIDATION_ERROR   0x8U

Indicates there is validation error.

Definition at line 426 of file nvsciipc.h.

◆ NV_SCI_IPC_EVENT_ASYNC_ERROR

#define NV_SCI_IPC_EVENT_ASYNC_ERROR   0x20U

Specifies the IPC asynchronous error event.

Definition at line 409 of file nvsciipc.h.

◆ NV_SCI_IPC_EVENT_CONN_EST

#define NV_SCI_IPC_EVENT_CONN_EST   0x04U

Specifies the IPC connection established event.

Definition at line 403 of file nvsciipc.h.

◆ NV_SCI_IPC_EVENT_CONN_EST_ALL

#define NV_SCI_IPC_EVENT_CONN_EST_ALL
Value:
NV_SCI_IPC_EVENT_WRITE | NV_SCI_IPC_EVENT_WRITE_EMPTY | \
NV_SCI_IPC_EVENT_READ)

Specifies single event mask to check IPC connection establishment.

Definition at line 411 of file nvsciipc.h.

◆ NV_SCI_IPC_EVENT_CONN_RESET

#define NV_SCI_IPC_EVENT_CONN_RESET   0x08U

Specifies the IPC connection reset event.

Definition at line 405 of file nvsciipc.h.

◆ NV_SCI_IPC_EVENT_READ

#define NV_SCI_IPC_EVENT_READ   0x01U

Specifies the IPC read event.

Definition at line 399 of file nvsciipc.h.

◆ NV_SCI_IPC_EVENT_WRITE

#define NV_SCI_IPC_EVENT_WRITE   0x02U

Specifies the IPC write event.

Definition at line 401 of file nvsciipc.h.

◆ NV_SCI_IPC_EVENT_WRITE_EMPTY

#define NV_SCI_IPC_EVENT_WRITE_EMPTY   0x10U

Specifies the IPC write fifo empty event.

Definition at line 407 of file nvsciipc.h.

◆ NVSCIIPC_BACKEND_C2C

#define NVSCIIPC_BACKEND_C2C   7U

Definition at line 335 of file nvsciipc.h.

◆ NVSCIIPC_BACKEND_C2C_NPM

#define NVSCIIPC_BACKEND_C2C_NPM   8U

Definition at line 337 of file nvsciipc.h.

◆ NVSCIIPC_BACKEND_C2C_PCIE

#define NVSCIIPC_BACKEND_C2C_PCIE   7U

Definition at line 336 of file nvsciipc.h.

◆ NVSCIIPC_BACKEND_IPC

#define NVSCIIPC_BACKEND_IPC   1U

Definition at line 329 of file nvsciipc.h.

◆ NVSCIIPC_BACKEND_IPC_IVCLIB

#define NVSCIIPC_BACKEND_IPC_IVCLIB   5U

Definition at line 333 of file nvsciipc.h.

◆ NVSCIIPC_BACKEND_IPC_NVSCICOM

#define NVSCIIPC_BACKEND_IPC_NVSCICOM   3U

Definition at line 331 of file nvsciipc.h.

◆ NVSCIIPC_BACKEND_ITC

#define NVSCIIPC_BACKEND_ITC   0U

backend type definition

Definition at line 328 of file nvsciipc.h.

◆ NVSCIIPC_BACKEND_ITC_IVCLIB

#define NVSCIIPC_BACKEND_ITC_IVCLIB   4U

Definition at line 332 of file nvsciipc.h.

◆ NVSCIIPC_BACKEND_ITC_NVSCICOM

#define NVSCIIPC_BACKEND_ITC_NVSCICOM   2U

Definition at line 330 of file nvsciipc.h.

◆ NVSCIIPC_BACKEND_IVC

#define NVSCIIPC_BACKEND_IVC   6U

Definition at line 334 of file nvsciipc.h.

◆ NVSCIIPC_BACKEND_MAX

#define NVSCIIPC_BACKEND_MAX   9U

Definition at line 340 of file nvsciipc.h.

◆ NVSCIIPC_INFINITE_WAIT

#define NVSCIIPC_INFINITE_WAIT   -1LL

infinite timeout for NvSciIpcWaitEventQnx()

Definition at line 416 of file nvsciipc.h.

◆ NVSCIIPC_INVALID_IID

#define NVSCIIPC_INVALID_IID   (-1)

Definition at line 347 of file nvsciipc.h.

◆ NVSCIIPC_INVALID_IRQ

#define NVSCIIPC_INVALID_IRQ   (0xFFFFFFFFU)

Definition at line 346 of file nvsciipc.h.

◆ NVSCIIPC_MAX_ENDPOINT_NAME

#define NVSCIIPC_MAX_ENDPOINT_NAME   64U

Specifies maximum Endpoint name length including null terminator.

Definition at line 395 of file nvsciipc.h.

Typedef Documentation

◆ NvSciIpcEndpoint

typedef uint64_t NvSciIpcEndpoint

Handle to the NvSciIpc endpoint.

Definition at line 314 of file nvsciipc.h.

◆ NvSciIpcEndpointAccessInfo

Definition at line 354 of file nvsciipc.h.

◆ NvSciIpcEndpointInfo

Definition at line 316 of file nvsciipc.h.

◆ NvSciIpcEndpointVuid

typedef uint64_t NvSciIpcEndpointVuid

VUID(VM unique ID) of the NvSciIpc endpoint.

Definition at line 352 of file nvsciipc.h.

Function Documentation

◆ NvSciIpcCheckVersionCompatibility()

NvSciError NvSciIpcCheckVersionCompatibility ( uint32_t  majorVer,
uint32_t  minorVer,
bool *  isCompatible 
)

Check NvSciIpc library version compatibility.

Checks if loaded NvSciIpc library version is compatible with the version the application was compiled against. This function checks loaded NvSciIpc library version with input NvSciIpc library version and sets output variable true provided major version of the loaded library is same as majorVer and minor version of the loaded library is not less than minorVer, else sets output to false

Parameters
[in]majorVerbuild major version. Valid value: 0 to UINT32_MAX
[in]minorVerbuild minor version. Valid value: 0 to UINT32_MAX
[out]isCompatibleboolean value stating if loaded NvSciIpc library is compatible or not. Valid value: isCompatible must be non-NULL.
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success if successful.
  • ::NvSciError_BadParameter if any of the following occurs:
    • isCompatible is NULL
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcCloseCfgBlob()

void NvSciIpcCloseCfgBlob ( void  )

Closes NvSciIpc ConfigBlob.

This API is specific to QNX OS. Unmap NvSciIpc configuration blob shared memory and close it.

Note
This API can be called in Init mode to release resources in error handling or to test functionality.
Precondition
Invocation of NvSciIpcOpenCfgBlob() must be successful.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: Yes
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcCloseEndpoint()

void NvSciIpcCloseEndpoint ( NvSciIpcEndpoint  handle)

Closes an endpoint with the given handle.

Warning
This API is deprecated and returns without doing anything in safety build. Use NvSciIpcCloseEndpointSafe() instead of this.

◆ NvSciIpcCloseEndpointSafe()

NvSciError NvSciIpcCloseEndpointSafe ( NvSciIpcEndpoint  handle,
bool  clear 
)

Closes an endpoint with the given handle (safety version)

The function frees the NvSciIpc endpoint associated with the given handle.

Note
This API can be called in Init mode to release resources in error handling or to test functionality.
Parameters
[in]handleA handle to the endpoint to close. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
[in]clearReserved for future use and any value has no change to the function behavior.
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_BadParameter Indicates an invalid handle.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_NotPermitted Indicates incorrect API group usage.
Precondition
Invocation of NvSciIpcOpenEndpoint() or NvSciIpcOpenEndpointWithEventService() must be successful.
Note
Deleting NvSciEventNotifier
Closing Inter-Chip Endpoint
  • When used in streaming mode, before calling NvSciIpcCloseEndpointSafe() for (INTER_CHIP, PCIE) endpoint, the user must ensure all fences submitted to NvIpc for Inter-Chip communication for signaling are expired and also all NvSciBufObjs and NvSciSyncObjs mappings registered, exported and imported with NvIpc for Inter-Chip communication are un-registered and released.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: Yes
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcDeinit()

void NvSciIpcDeinit ( void  )

De-initializes the NvSciIpc library.

This function cleans up the NvSciIpc endpoint internal database created by NvSciIpcInit().

Note
This API can be called in Init mode to release resources in error handling or to test functionality.
Returns
void
Precondition
Invocation of NvSciIpcInit() must be successful.
Note
Closing endpoints before deinitialization


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: Yes
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcEnableNotification()

NvSciError NvSciIpcEnableNotification ( NvSciIpcEndpoint  handle,
bool  flag 
)

Enable event notification (or polling)

Control notification when connection or FIFO status is changed. If notification is disabled, NvSciIpc doesn't send notification to remote endpoint. notification is enabled by default unless user disables it using this API explicitly. User can use this API to choose asynchronous event notification mode or polling mode. Once notification is disabled in both endpoints, user shall not call event blocking API (e.g. poll, NvSciIpcWaitEventQnx, WaitForEvent, WaitForMultipleEvents etc.).

Note
This API supports Intra-VM and Inter-VM backend only.
Parameters
[in]handleNvSciIpc endpoint handle. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
[in]flagflag to enable IPC notification. Valid value: true, false
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_BadParameter Indicates an invalid handle.
  • ::NvSciError_NotSupported Indicates API is not supported in provided endpoint backend type or OS environment.
Precondition
Invocation of NvSciIpcResetEndpointSafe() must be successful.
Note
Pending event in disabling notification
  • Before calling this API to disable notification, The user shall ensure that there are no remaining outstanding data transactions between the two endpoints using their own handshaking mechanism at the client level. If this is not guaranteed, pending notification might be delivered from local to remote peer. In that case, user shall handle (receive or ignore) such spurious incoming notifications.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcGetAsyncErrors()

NvSciError NvSciIpcGetAsyncErrors ( NvSciIpcEndpoint  handle,
uint32_t *  errors 
)

Get asynchronouse errors.

Returns error codes that can happen asynchronousely in the backend component. It could be errors from eDMA or PCIE in case of C2C backend.

There are four errors reported in errors and this API returns bitwise OR operaton on new errors that has occurred since the last call to it.

  • NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_FATAL
  • NV_SCI_ASYNC_PCIE_AER_UNCORRECTABLE_NONFATAL
  • NV_SCI_ASYNC_PCIE_EDMA_XFER_ERROR
  • NV_SCI_ASYNC_PCIE_VALIDATION_ERROR
Parameters
[in]handleNvSciIpc endpoint handle. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
[out]errorsplace holder to store bitwise OR errors Valid value: errors must be non-NULL.
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_BadParameter Indicates an invalid handle or error.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_InvalidState Indicates an invalid operation state.
  • ::NvSciError_NotSupported Indicates API is not supported in provided endpoint backend type or OS environment.
Precondition
Invocation of NvSciIpcGetEventSafe() must be successful.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcGetEndpointAccessInfo()

NvSciError NvSciIpcGetEndpointAccessInfo ( const char *  endpoint,
NvSciIpcEndpointAccessInfo *  info 
)

Gets endpoint access information from ConfigBlob.

This API is specific to QNX OS. The function search entry with endpoint name from configuration blob shared memory, then return its group id and backend type information. This information can be used to apply subgroup id, vuid and QNX OS abilities to NvSciIpc client program. This API can be used in root user process only due to security issue.

Parameters
[in]endpointThe name of the NvSciIpc endpoint to search. Valid value: endpoint name which is listed in nvsciipc configuration and it is a null-terminated string of up to 64 bytes.
[out]infoEndpoint access information on success. Valid value: info must be non-NULL.
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_BadParameter Indicates an invalid or NULL argument.
  • ::NvSciError_NoSuchEntry Indicates Endpoint name is not found.
  • ::NvSciError_NotPermitted Indicates process doesn't have the required privilege.
  • ::NvSciError_NotSupported Indicates API is not supported in provided OS environment.
  • ::NvSciError_InvalidState Indicates an invalid operation state
Precondition
Invocation of NvSciIpcInit() must be successful.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcGetEndpointInfo()

NvSciError NvSciIpcGetEndpointInfo ( NvSciIpcEndpoint  handle,
NvSciIpcEndpointInfo *  info 
)

Returns endpoint information.

Parameters
[in]handleNvSciIpc endpoint handle. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
[out]infoA pointer to NvSciIpcEndpointInfo object that this function copies the info to on success. Valid value: info must be non-NULL
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_BadParameter Indicates an invalid or NULL argument.
  • ::NvSciError_NotSupported Indicates API is not supported in provided endpoint backend type.
  • ::NvSciError_InvalidState Indicates an invalid operation state.
Precondition
Invocation of NvSciIpcOpenEndpoint() or NvSciIpcOpenEndpointWithEventService() must be successful.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcGetEvent()

NvSciError NvSciIpcGetEvent ( NvSciIpcEndpoint  handle,
uint32_t *  events 
)

Get Events.

Warning
This API is deprecated and returns NvSciError_NotSupported without doing anything in safety build. Use NvSciIpcGetEventSafe() instead of this.

◆ NvSciIpcGetEventNotifier()

NvSciError NvSciIpcGetEventNotifier ( NvSciIpcEndpoint  handle,
NvSciEventNotifier **  eventNotifier 
)

Get NvSciIpc event notifier.

This API is used to connect NvSciIpc event handling with OS-provided event interface. It also utilizes NvSciEventService infrastructure.

Note
This API is only compatible with an endpoint that is opened with NvSciIpcOpenEndpointWithEventService()
Parameters
[in]handleNvSciIpc endpoint handle. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
[out]eventNotifierA pointer to NvSciEventNotifier object on success. Valid value: eventNotifier must be non-NULL.
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_BadParameter Indicates an invalid or NULL argument.
  • ::NvSciError_NotSupported Indicates API is not supported on provided endpoint backend type.
  • ::NvSciError_InvalidState Indicates an invalid operation state.
  • ::NvSciError_InsufficientMemory Indicates memory allocation failed for the operation.
  • ::NvSciError_ResourceError Indicates not enough system resources.
  • ::NvSciError_NotPermitted Indicates incorrect API group usage.
Precondition
Invocation of NvSciIpcOpenEndpointWithEventService() must be successful.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX):
    • PROCMGR_AID_INTERRUPTEVENT (Inter-VM only)
    • PROCMGR_AID_PUBLIC_CHANNEL
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcGetEventSafe()

NvSciError NvSciIpcGetEventSafe ( NvSciIpcEndpoint  handle,
uint32_t *  events 
)

Get Events (safety version)

Returns a bitwise OR operation on new events that occurred since the last call to this function.

This function sets events to the result of a bitwise OR operation of zero or more NV_SCI_IPC_EVENT_* constants corresponding to all new events that have occurred on the endpoint since:

  • the preceding call to this function on the endpoint or
  • opening the endpoint, if this is the first call to this function on the endpoint since it was opened.

The parameter events is set to zero if no new events have occurred.

There are 6 types of events:

  • NV_SCI_IPC_EVENT_CONN_EST : IPC connection established
  • NV_SCI_IPC_EVENT_WRITE : IPC write
  • NV_SCI_IPC_EVENT_READ : IPC read
  • NV_SCI_IPC_EVENT_CONN_RESET : IPC connection reset
  • NV_SCI_IPC_EVENT_WRITE_EMPTY : IPC write FIFO empty
  • NV_SCI_IPC_EVENT_ASYNC_ERROR : Asynchronous error

NV_SCI_IPC_EVENT_CONN_EST and NV_SCI_IPC_EVENT_CONN_RESET events are connection event. They're edge-triggered events and once they're read by user, events are cleared.

NV_SCI_IPC_EVENT_WRITE, NV_SCI_IPC_EVENT_READ and NV_SCI_IPC_EVENT_WRITE_EMPTY events are FIFO status event. As long as free buffer is available on write FIFO or data are available in read FIFO, API keeps reporting same events. All these events also mean that connection is established.

An NV_SCI_IPC_EVENT_CONN_EST event occurs on an endpoint each time a connection is established through the endpoint (between the endpoint and the other end of the corresponding channel).

An NV_SCI_IPC_EVENT_WRITE event occurs on an endpoint:

  1. In conjunction with the delivery of each NV_SCI_IPC_CONN_EST event.
  2. Each time the endpoint's sending FIFO ceases to be full.

An NV_SCI_IPC_EVENT_READ event occurs on an endpoint:

  1. In conjunction with the delivery of each NV_SCI_IPC_EVENT_CONN_EST event, if frames can already be read as of delivery.
  2. Each time the endpoint's receiving FIFO ceases to be empty.

An NV_SCI_IPC_EVENT_CONN_RESET event occurs on an endpoint when the user calls NvSciIpcResetEndpoint.

An NV_SCI_IPC_EVENT_WRITE_EMPTY event occurs on an endpoint when write FIFO is empty. user can utilize this event to check if remote endpoint reads all data which local endpoint sent.

An NV_SCI_IPC_EVENT_ASYNC_ERROR event occurs on an endpoint when there is a asynchronouse error, e.g. failure on eDMA or PCIE. To get detailed error information, the user can call NvSciIpcGetAsyncError().

If this function doesn't return desired events, user must call OS-provided blocking API to wait for notification from remote endpoint.

The following are blocking API examples:

In case of QNX OS, in order to authenticate user client process, NvSciIpc uses custom ability "NvSciIpcEndpoint". Use procmgr_ability_lookup() QNX OS API to get ability ID.

Note
Before using any read and write NvSciIpc API, user should call this API to make sure if connection is established.
Parameters
[in]handleNvSciIpc endpoint handle. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
[out]eventsA pointer to the variable into which to store the bitwise OR result of new events on success. Valid value: events must be non-NULL
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_BadParameter Indicates an invalid or NULL argument.
  • ::NvSciError_InvalidState Indicates an invalid operation state.
  • ::NvSciError_NotSupported Indicates API is not supported in provided endpoint backend type.
Precondition
NvSciIpcResetEndpointSafe() must be successful.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): "NvSciIpcEndpoint"
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcGetLinuxEventFd()

NvSciError NvSciIpcGetLinuxEventFd ( NvSciIpcEndpoint  handle,
int32_t *  fd 
)

Returns the NvSciIpc file descriptor for a given endpoint.

Warning
This API will be deprecated in future. Use NvSciIpcGetEventNotifier() and NvSciEventService library for event handling.

This API is specific to Linux OS. Event handle will be used to plug OS event notification (can be read, can be written, established, reset etc.)

Parameters
handleNvSciIpc endpoint handle Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
fdA pointer to the endpoint file descriptor. Valid value: fd must be non-NULL
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_BadParameter Indicates an invalid or NULL argument.
  • ::NvSciError_NotSupported Indicates API is not supported in provided endpoint backend type or OS environment.
Precondition
Invocation of NvSciIpcOpenEndpoint() or NvSciIpcOpenEndpointWithEventService() must be successful.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcInit()

NvSciError NvSciIpcInit ( void  )

Initializes the NvSciIpc library.

This function parses the NvSciIpc configuration file and creates an internal database of NvSciIpc endpoints that exist in a system.

Returns
::NvSciError, the completion code of the operation.
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_NotPermitted Indicates initialization has failed. Indicates incorrect API group usage.
  • ::NvSciError_InvalidState Indicates an invalid operation state.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcOpenCfgBlob()

NvSciError NvSciIpcOpenCfgBlob ( void  )

Opens NvSciIpc ConfigBlob.

This API is specific to QNX OS. The function opens and read NvSciIpc configuration blob and populates internal DB to search endpoint entry.

Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_NotPermitted Indicates opening blob has failed. Indicates incorrect API group usage.
  • ::NvSciError_NotSupported Indicates API is not supported in the provided OS environment.
  • ::NvSciError_InvalidState Indicates an invalid operation state
Precondition
Invocation of NvSciIpcInit() must be successful.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcOpenEndpoint()

NvSciError NvSciIpcOpenEndpoint ( const char *  endpoint,
NvSciIpcEndpoint *  handle 
)

Opens an endpoint with the given name.

The function locates the NvSciIpc endpoint with the given name in the NvSciIpc configuration table in the internal database, and returns a handle to the endpoint if found. When the operation is successful, endpoint can utilize the allocated shared data area and the corresponding signaling mechanism setup. If the operation fails, the state of the NvSciIpc endpoint is undefined. In case of QNX OS, in order to authenticate user client process, NvSciIpc uses custom ability "NvSciIpcEndpoint". Use procmgr_ability_lookup() QNX OS API to get ability ID.

Parameters
[in]endpointThe name of the NvSciIpc endpoint to open. Valid value: endpoint name which is listed in nvsciipc configuration and it is a null-terminated string of up to 64 bytes.
[out]handleA handle to the endpoint on success. Valid value: handle must be non-NULL.
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_BadParameter Indicates any argument was NULL or invalid.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_NoSuchEntry Indicates the endpoint was not found.
  • ::NvSciError_Busy Indicates the endpoint is already in use.
  • ::NvSciError_InsufficientMemory Indicates memory allocation failed for the operation.
  • ::NvSciError_NotSupported Indicates API is not supported on provided endpoint backend type.
  • ::NvSciError_InvalidState Indicates an invalid operation state.
  • ::NvSciError_NotPermitted Indicates process doesn't have the required privilege. Indicates incorrect API group usage.
Precondition
Invocation of NvSciIpcInit() must be successful.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX):
    • "nvdvms/ClientCommGetState"
    • "NvSciIpcEndpoint"
    • "NvSciC2cPcieEndpoint" (Inter-Chip only)
    • "nvsys/system_info" (Inter-Chip only)
    • "NvMap/Interfaces:17,19" (Inter-Chip only)
    • When used in streaming mode (Inter-Chip only):
      • "NvHost/Interfaces:1-2"
      • "NvHost/Waiter:1" OR "NvHost/Waiter:N", where 'N' is the number of Inter-Chip endpoints application uses in the same process.
    • PROCMGR_AID_PROT_EXEC (Inter-Chip only)
    • PROCMGR_AID_MAP_FIXED (Inter-Chip only)
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcOpenEndpointWithEventService()

NvSciError NvSciIpcOpenEndpointWithEventService ( const char *  endpoint,
NvSciIpcEndpoint *  handle,
NvSciEventService *  eventService 
)

Opens an endpoint with the given name and event service.

This API provides same functionality as NvSciIpcOpenEndpoint(). But, it requires additional event service abstract object as an input parameter to utilize NvSciEventService infrastructure. NvSciEventService can be created through NvSciEventLoopServiceCreateSafe(). NvSciIpcGetEventNotifier() can be used only when this API is invoked successfully. In case of QNX OS, in order to authenticate user client process, NvSciIpc uses custom ability "NvSciIpcEndpoint". Use procmgr_ability_lookup() QNX OS API to get ability ID.

Parameters
[in]endpointThe name of the NvSciIpc endpoint to open. Valid value: endpoint name which is listed in nvsciipc configuration and it is a null-terminated string of up to 64 bytes.
[out]handleA handle to the endpoint on success. Valid value: handle must be non-NULL
[in]eventServiceAn abstract object to use NvSciEventService infrastructure. Valid value: eventService should be obtained from a successful call to NvSciEventLoopServiceCreateSafe() and has not yet been freed using eventService->Delete().
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_BadParameter Indicates any argument was NULL or invalid.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_NoSuchEntry Indicates the endpoint was not found.
  • ::NvSciError_Busy Indicates the endpoint is already in use.
  • ::NvSciError_InsufficientMemory Indicates memory allocation failed for the operation.
  • ::NvSciError_NotSupported Indicates API is not supported on provided endpoint backend type.
  • ::NvSciError_InvalidState Indicates an invalid operation state.
  • ::NvSciError_NotPermitted Indicates process doesn't have the required privilege. Indicates incorrect API group usage.
Precondition
Invocation of NvSciEventLoopServiceCreateSafe() must be successful. Invocation of NvSciIpcInit() must be successful.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX):
    • "nvdvms/ClientCommGetState"
    • "NvSciIpcEndpoint"
    • "NvSciC2cPcieEndpoint" (Inter-Chip only)
    • "nvsys/system_info" (Inter-Chip only)
    • "NvMap/Interfaces:17,19" (Inter-Chip only)
    • When used in streaming mode (Inter-Chip only):
      • "NvHost/Interfaces:1-2"
      • "NvHost/Waiter:1" OR "NvHost/Waiter:N", where 'N' is the number of Inter-Chip endpoints application uses in the same process.
    • PROCMGR_AID_PROT_EXEC (Inter-Chip only)
    • PROCMGR_AID_MAP_FIXED (Inter-Chip only)
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcRead()

NvSciError NvSciIpcRead ( NvSciIpcEndpoint  handle,
void *  buf,
size_t  size,
int32_t *  bytes 
)

Reads a frame from the endpoint.

Warning
This API is deprecated and returns NvSciError_NotSupported without doing anything in safety build. Use NvSciIpcReadSafe() instead of this.

◆ NvSciIpcReadAdvance()

NvSciError NvSciIpcReadAdvance ( NvSciIpcEndpoint  handle)

Advance to the next read frame of the endpoint.

This is a non-blocking call. Read channel of the endpoint must not be empty. If a read channel of the endpoint was previously full, then this function notifies the remote endpoint.

This operation cannot proceed if the endpoint is being reset. However, if the remote endpoint has called NvSciIpcResetEndpointSafe(), calls to this function can still succeed until the next event notification on the local endpoint.

Note
This API is used together with NvSciIpcReadGetNextFrame(). Refer to precondition of NvSciIpcReadGetNextFrame()
Parameters
[in]handleThe handle to the endpoint to read from. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates successful operation.
  • ::NvSciError_BadParameter Indicates an invalid handle.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_InsufficientMemory Indicates read channel is empty and the read operation aborted.
  • ::NvSciError_ConnectionReset Indicates the endpoint is being reset.
  • ::NvSciError_NotSupported Indicates API is not supported in provided endpoint backend type.
  • ::NvSciError_InvalidState Indicates an invalid operation state.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcReadGetNextFrame()

NvSciError NvSciIpcReadGetNextFrame ( NvSciIpcEndpoint  handle,
const volatile void **  buf 
)

Get a pointer to the read frame from the endpoint.

This is a non-blocking call. This operation cannot proceed if the endpoint is being reset. However, if the remote endpoint has called NvSciIpcResetEndpointSafe(), calls to this function can still succeed until the next event notification on the local endpoint.

Parameters
[in]handleThe handle to the endpoint to read from. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
[out]bufA pointer to a destination buffer to receive the contents of the next frame on success. Valid value: buf must be non-NULL
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_BadParameter Indicates an invalid handle.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_InsufficientMemory Indicates read channel is empty and the read operation aborted.
  • ::NvSciError_ConnectionReset Indicates the endpoint is being reset.
  • ::NvSciError_NotSupported Indicates API is not supported in provided endpoint backend type.
  • ::NvSciError_InvalidState Indicates an invalid operation state.
Note
No overlapped read operation
No use of invalid pointer to read frame
No write operation with pointer to read frame
  • The user shall not write through a returned pointer of NvSciIpcReadGetNextFrame(). This is protected by a const volatile pointer return type.
Copy data before using it
  • The user shall not read the same memory location multiple times. If required, copy specific memory location to a local buffer before using it.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcReadSafe()

NvSciError NvSciIpcReadSafe ( NvSciIpcEndpoint  handle,
void *  buf,
uint32_t  size,
uint32_t *  bytes 
)

Reads a frame from the endpoint (safety version)

This function copies a new frame contents into a buffer and advances to the next frame. If the destination buffer is smaller than the configured frame size of the endpoint, the trailing bytes are discarded.

This is a non-blocking call. Read channel of the endpoint must not be empty. If read channel of the endpoint was previously full, then the function notifies the remote endpoint.

This operation cannot proceed if the endpoint is being reset. However, if the remote endpoint has called NvSciIpcResetEndpointSafe(), calls to this function can still succeed until the next event notification on the local endpoint.

Parameters
[in]handleThe handle to the endpoint to read from. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
[out]bufA pointer to a destination buffer to receive the contents of the next frame. Valid value: buf must be non-NULL
[in]sizeThe number of bytes to copy from the frame, not to exceed the length of the destination buffer and configured frame size of the endpoint. Valid value: 1 to frame size of given endpoint
[out]bytesThe number of bytes read on success. Valid value: bytes must be non-NULL
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_BadParameter Indicates an invalid handle or size.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_InsufficientMemory Indicates read channel is empty and the read operation aborted.
  • ::NvSciError_ConnectionReset Indicates the endpoint is being reset.
  • ::NvSciError_NotSupported Indicates API is not supported on provided endpoint backend type.
  • ::NvSciError_InvalidState Indicates an invalid operation state.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcResetEndpoint()

void NvSciIpcResetEndpoint ( NvSciIpcEndpoint  handle)

Resets an endpoint.

Warning
This API is deprecated and returns without doing anything in safety build. Use NvSciIpcResetEndpointSafe() instead of this.

◆ NvSciIpcResetEndpointSafe()

NvSciError NvSciIpcResetEndpointSafe ( NvSciIpcEndpoint  handle)

Resets an endpoint.

(safety version)

Initiates a reset on the endpoint and notifies the remote endpoint. Once this API is called, all existing data in channel will be discarded. After invoking this function, client user shall call NvSciIpcGetEventSafe() to get specific event type (READ, WRITE etc.).

Parameters
[in]handleA handle to the endpoint to reset. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_BadParameter Indicates an invalid handle.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_InvalidState Indicates an invalid operation state.
  • ::NvSciError_NotSupported Indicates API is not supported on provided endpoint backend type.
Precondition
Invocation of NvSciIpcSetQnxPulseParamSafe() or NvSciIpcGetLinuxEventFd() or NvSciIpcGetEventNotifier() must be successful.
Note
When to reset endpoint
  • This API must be called exactly once per endpoint handle during Init mode to complete the initialization sequence before using the endpoint for communication,and at most once during De-init mode only if both endpoints are in the established state (e.g. synchronization for closing channel). In case of De-Init mode, NvSciIpcGetEventSafe() must NOT be called after NvSciIpcResetEndpointSafe() is called.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: Yes
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcWrite()

NvSciError NvSciIpcWrite ( NvSciIpcEndpoint  handle,
const void *  buf,
size_t  size,
int32_t *  bytes 
)

Writes a frame to the endpoint.

Warning
This API is deprecated and returns NvSciError_NotSupported without doing anything in safety build. Use NvSciIpcWriteSafe() instead of this.

◆ NvSciIpcWriteAdvance()

NvSciError NvSciIpcWriteAdvance ( NvSciIpcEndpoint  handle)

Advance to the next write frame of the endpoint.

This is a non-blocking call. If write channel of the endpoint is not full, then post the next frame. If write channel of the endpoint was previously empty, then this function notifies the remote endpoint.

This operation cannot proceed if the endpoint is being reset. However, if the remote endpoint has called NvSciIpcResetEndpointSafe(), calls to this function can still succeed until the next event notification on the local endpoint.

Note
This API is used together with NvSciIpcWriteGetNextFrame(). Refer to precondition of NvSciIpcWriteGetNextFrame()
Parameters
[in]handleThe handle to the endpoint to write to. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates successful operation.
  • ::NvSciError_BadParameter Indicates an invalid handle.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_InsufficientMemory Indicates write channel is full and the write operation aborted.
  • ::NvSciError_ConnectionReset Indicates the endpoint is being reset.
  • ::NvSciError_NotSupported Indicates API is not supported in provided endpoint backend type.
  • ::NvSciError_InvalidState Indicates an invalid operation state.
Note
Populated with data
  • The user shall ensure entire outgoing frame is populated with application data or filled with zeros prior call to NvScipcWriteAdvance().


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcWriteGetNextFrame()

NvSciError NvSciIpcWriteGetNextFrame ( NvSciIpcEndpoint  handle,
volatile void **  buf 
)

Get a pointer to the write frame from the endpoint.

This is a non-blocking call. write channel of the endpoint must not be full.

This operation cannot proceed if the endpoint is being reset. However, if the remote endpoint has called NvSciIpcResetEndpointSafe(), calls to this function can still succeed until the next event notification on the local endpoint.

Parameters
[in]handleThe handle to the endpoint to write to. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
[out]bufA pointer to a destination buffer to hold the contents of the next frame on success. Valid value: buf must be non-NULL
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates successful operation.
  • ::NvSciError_BadParameter Indicates an invalid handle.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_InsufficientMemory Indicates write channel is full and the write operation aborted.
  • ::NvSciError_ConnectionReset Indicates the endpoint is being reset.
  • ::NvSciError_NotSupported Indicates API is not supported in provided endpoint backend type.
  • ::NvSciError_InvalidState Indicates an invalid operation state.
Note
No overlapped write operation
No use of invalid pointer to write
No read operation with pointer to write frame


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA

◆ NvSciIpcWriteSafe()

NvSciError NvSciIpcWriteSafe ( NvSciIpcEndpoint  handle,
const void *  buf,
uint32_t  size,
uint32_t *  bytes 
)

Writes a frame to the endpoint.

(safety version)

If space is available in the endpoint, this function posts a new frame, copying the contents from the provided data buffer. If size is less than the frame size, then the remaining bytes of the frame are filled with zero.

This is a non-blocking call. If write channel of the endpoint was previously empty, then the function notifies the remote endpoint.

This operation cannot proceed if the endpoint is being reset.

The user shall make sure if actual input buffer size is equal or bigger than requested size before using this API.

Parameters
[in]handleThe handle to the endpoint to write to. Valid value: handle should be obtained from a successful call to NvSciIpcOpenEndpoint* API and has not yet been freed using NvSciIpcCloseEndpointSafe().
[in]bufA pointer to a source buffer for the contents of the next frame. Valid value: buf must be non-NULL
[in]sizeThe number of bytes to be copied to the frame, not to exceed the length of the destination buffer and configured frame size of the endpoint. Valid value: 1 to frame size of given endpoint
[out]bytesThe number of bytes written on success. Valid value: bytes must be non-NULL
Returns
::NvSciError, the completion code of the operation:
  • ::NvSciError_Success Indicates a successful operation.
  • ::NvSciError_BadParameter Indicates an invalid handle or size.
  • ::NvSciError_NotInitialized Indicates NvSciIpc is uninitialized.
  • ::NvSciError_InsufficientMemory Indicates write channel is full and the write operation aborted.
  • ::NvSciError_ConnectionReset Indicates the endpoint is being reset.
  • ::NvSciError_NotSupported Indicates API is not supported in provided endpoint backend type.
  • ::NvSciError_InvalidState Indicates an invalid operation state.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges(QNX): None
  • Allowed execution state
    • Initialization: No
    • Operational: Yes
    • Reinit/Deinit Preparation: No
  • Implementation ASIL: ASIL D
  • Maturity: GA
NvSciIpcGetEndpointInfo
NvSciError NvSciIpcGetEndpointInfo(NvSciIpcEndpoint handle, NvSciIpcEndpointInfo *info)
Returns endpoint information.
NV_SCI_IPC_EVENT_WRITE_EMPTY
#define NV_SCI_IPC_EVENT_WRITE_EMPTY
Specifies the IPC write fifo empty event.
Definition: nvsciipc.h:407
NvSciIpcOpenEndpoint
NvSciError NvSciIpcOpenEndpoint(const char *endpoint, NvSciIpcEndpoint *handle)
Opens an endpoint with the given name.
NvSciIpcOpenEndpointWithEventService
NvSciError NvSciIpcOpenEndpointWithEventService(const char *endpoint, NvSciIpcEndpoint *handle, NvSciEventService *eventService)
Opens an endpoint with the given name and event service.
NvSciEventNotifier
An abstract interface to notify event to event consumer and to register event handler of the event co...
Definition: nvscievent.h:457
NvSciIpcGetLinuxEventFd
NvSciError NvSciIpcGetLinuxEventFd(NvSciIpcEndpoint handle, int32_t *fd)
Returns the NvSciIpc file descriptor for a given endpoint.
NV_SCI_IPC_EVENT_CONN_EST
#define NV_SCI_IPC_EVENT_CONN_EST
Specifies the IPC connection established event.
Definition: nvsciipc.h:403
NvSciIpcResetEndpointSafe
NvSciError NvSciIpcResetEndpointSafe(NvSciIpcEndpoint handle)
Resets an endpoint.
NvSciEventLoopServiceCreateSafe
NvSciError NvSciEventLoopServiceCreateSafe(size_t maxEventLoops, void *config, NvSciEventLoopService **newEventLoopService)
Creates a new event loop service.
NvSciIpcInit
NvSciError NvSciIpcInit(void)
Initializes the NvSciIpc library.
NvSciIpcGetEventNotifier
NvSciError NvSciIpcGetEventNotifier(NvSciIpcEndpoint handle, NvSciEventNotifier **eventNotifier)
Get NvSciIpc event notifier.