|
XLIO
The NVIDIA® Accelerated IO
|
Callback functions for handling socket events. More...
Typedefs | |
| typedef void(* | xlio_memory_cb_t) (void *addr, size_t len, size_t hugepage_size) |
| Memory allocation callback function. More... | |
| typedef void(* | xlio_socket_event_cb_t) (xlio_socket_t sock, uintptr_t userdata_sq, int event, int value) |
| Socket event callback function. More... | |
| typedef void(* | xlio_socket_comp_cb_t) (xlio_socket_t sock, uintptr_t userdata_sq, uintptr_t userdata_op) |
| Zero-copy completion callback function. More... | |
| typedef void(* | xlio_socket_rx_cb_t) (xlio_socket_t sock, uintptr_t userdata_sq, void *data, size_t len, struct xlio_buf *buf) |
| Receive data callback function. More... | |
| typedef void(* | xlio_socket_accept_cb_t) (xlio_socket_t sock, xlio_socket_t parent, uintptr_t parent_userdata_sq) |
| Accept callback function. More... | |
Enumerations | |
| enum | { XLIO_SOCKET_EVENT_ESTABLISHED = 1 , XLIO_SOCKET_EVENT_TERMINATED , XLIO_SOCKET_EVENT_CLOSED , XLIO_SOCKET_EVENT_ERROR } |
| Socket events. More... | |
Callback functions for handling socket events.
The XLIO Ultra API uses callbacks to notify applications of various events including connection state changes, data arrival, and completion of zero-copy operations.
Most of the callbacks are expected from the xlio_poll_group_poll() context.
| typedef void(* xlio_memory_cb_t) (void *addr, size_t len, size_t hugepage_size) |
Memory allocation callback function.
This callback is invoked when XLIO allocates memory regions that can be used for RX buffers. Applications can use this information for memory management or preparation.
| addr | Base address of the allocated memory |
| len | Size of the allocated memory |
| hugepage_size | Page size if hugepages are used, 0 for regular pages |
| typedef void(* xlio_socket_accept_cb_t) (xlio_socket_t sock, xlio_socket_t parent, uintptr_t parent_userdata_sq) |
Accept callback function.
This callback is invoked when a new connection is accepted on a listening socket. The new socket is automatically created and associated with the same polling group.
| sock | The newly accepted socket |
| parent | The listening socket that accepted the connection |
| parent_userdata_sq | User data from the parent socket |
| typedef void(* xlio_socket_comp_cb_t) (xlio_socket_t sock, uintptr_t userdata_sq, uintptr_t userdata_op) |
Zero-copy completion callback function.
This callback is invoked when a zero-copy send operation completes, allowing the application to reclaim or reuse the transmitted buffers.
| sock | The socket that completed the operation |
| userdata_sq | User data associated with the socket |
| userdata_op | User data associated with the specific operation |
| typedef void(* xlio_socket_event_cb_t) (xlio_socket_t sock, uintptr_t userdata_sq, int event, int value) |
Socket event callback function.
This callback is invoked when socket state changes occur, such as connection establishment, errors, or termination.
| sock | The socket generating the event |
| userdata_sq | User data associated with the socket |
| event | The event type (XLIO_SOCKET_EVENT_*) |
| value | Event-specific value (error code for ERROR events, 0 otherwise) |
| typedef void(* xlio_socket_rx_cb_t) (xlio_socket_t sock, uintptr_t userdata_sq, void *data, size_t len, struct xlio_buf *buf) |
Receive data callback function.
This callback is invoked when TCP payload arrives on a socket. Each call provides a single contiguous buffer containing received data.
| sock | The socket that received the data |
| userdata_sq | User data associated with the socket |
| data | Pointer to the received data |
| len | Length of the received data |
| buf | Buffer descriptor that must be returned via xlio_*_buf_free() |