|
XLIO
The NVIDIA® Accelerated IO
|
Functions for creating and managing XLIO sockets. More...
Classes | |
| struct | xlio_socket_attr |
| Socket creation attributes. More... | |
Typedefs | |
| typedef uintptr_t | xlio_socket_t |
| Socket handle. More... | |
Functions | |
| int | xlio_socket_create (const struct xlio_socket_attr *attr, xlio_socket_t *sock_out) |
| Create a new XLIO socket. More... | |
| int | xlio_socket_destroy (xlio_socket_t sock) |
| Destroy an XLIO socket. More... | |
| int | xlio_socket_update (xlio_socket_t sock, unsigned flags, uintptr_t userdata_sq) |
| Update socket attributes. More... | |
| int | xlio_socket_setsockopt (xlio_socket_t sock, int level, int optname, const void *optval, socklen_t optlen) |
| Set socket options. More... | |
| int | xlio_socket_getsockname (xlio_socket_t sock, struct sockaddr *addr, socklen_t *addrlen) |
| Get socket name. More... | |
| int | xlio_socket_getpeername (xlio_socket_t sock, struct sockaddr *addr, socklen_t *addrlen) |
| Get peer name. More... | |
| int | xlio_socket_bind (xlio_socket_t sock, const struct sockaddr *addr, socklen_t addrlen) |
| Bind socket to address. More... | |
| int | xlio_socket_connect (xlio_socket_t sock, const struct sockaddr *to, socklen_t tolen) |
| Connect socket to remote address. More... | |
| int | xlio_socket_listen (xlio_socket_t sock) |
| Listen for incoming connections. More... | |
| struct ibv_pd * | xlio_socket_get_pd (xlio_socket_t sock) |
| Get InfiniBand protection domain. More... | |
| int | xlio_socket_detach_group (xlio_socket_t sock) |
| Detach socket from polling group. More... | |
| int | xlio_socket_attach_group (xlio_socket_t sock, xlio_poll_group_t group) |
| Attach socket to polling group. More... | |
Functions for creating and managing XLIO sockets.
XLIO sockets are high-performance TCP socket abstractions that provide zero-copy capabilities. They are represented by opaque handles rather than file descriptors.
| typedef uintptr_t xlio_socket_t |
Socket handle.
Opaque handle representing an XLIO high-performance socket.
| int xlio_socket_attach_group | ( | xlio_socket_t | sock, |
| xlio_poll_group_t | group | ||
| ) |
Attach socket to polling group.
Attaches a previously detached socket to a polling group. The socket will begin generating events according to the group's configuration.
| sock | The socket to attach |
| group | The polling group to attach to |
| int xlio_socket_bind | ( | xlio_socket_t | sock, |
| const struct sockaddr * | addr, | ||
| socklen_t | addrlen | ||
| ) |
Bind socket to address.
Binds the socket to a local address, similar to bind().
| sock | The socket to bind |
| addr | The address to bind to |
| addrlen | Length of the address |
| int xlio_socket_connect | ( | xlio_socket_t | sock, |
| const struct sockaddr * | to, | ||
| socklen_t | tolen | ||
| ) |
Connect socket to remote address.
Initiates a connection to a remote address. The operation is non-blocking, and the connection status is reported via the socket event callback.
| sock | The socket to connect |
| to | The remote address to connect to |
| tolen | Length of the remote address |
| int xlio_socket_create | ( | const struct xlio_socket_attr * | attr, |
| xlio_socket_t * | sock_out | ||
| ) |
Create a new XLIO socket.
Creates a new XLIO socket with the specified attributes. The socket is automatically associated with the specified polling group and configured for high-performance operation.
| attr | Socket attributes |
| sock_out | Pointer to store the created socket handle |
| int xlio_socket_destroy | ( | xlio_socket_t | sock | ) |
Destroy an XLIO socket.
Initiates the socket closing procedure. The process may be asynchronous, and socket events may continue to arrive until the XLIO_SOCKET_EVENT_TERMINATED event is received.
| sock | The socket to destroy |
| int xlio_socket_detach_group | ( | xlio_socket_t | sock | ) |
Detach socket from polling group.
Removes the socket from its current polling group. The socket becomes inactive and will not generate events until attached to another group.
| sock | The socket to detach |
| struct ibv_pd* xlio_socket_get_pd | ( | xlio_socket_t | sock | ) |
Get InfiniBand protection domain.
Returns the InfiniBand protection domain associated with the socket. This can be used for registering memory regions for zero-copy operations.
| sock | The socket to query |
| int xlio_socket_getpeername | ( | xlio_socket_t | sock, |
| struct sockaddr * | addr, | ||
| socklen_t * | addrlen | ||
| ) |
Get peer name.
Retrieves the remote address of the socket, similar to getpeername().
| sock | The socket to query |
| addr | Buffer to store the address |
| addrlen | Pointer to the address length |
| int xlio_socket_getsockname | ( | xlio_socket_t | sock, |
| struct sockaddr * | addr, | ||
| socklen_t * | addrlen | ||
| ) |
Get socket name.
Retrieves the local address of the socket, similar to getsockname().
| sock | The socket to query |
| addr | Buffer to store the address |
| addrlen | Pointer to the address length |
| int xlio_socket_listen | ( | xlio_socket_t | sock | ) |
Listen for incoming connections.
Configures the socket to listen for incoming connections. Requires that the polling group has a socket_accept_cb callback registered.
| sock | The socket to configure for listening |
| int xlio_socket_setsockopt | ( | xlio_socket_t | sock, |
| int | level, | ||
| int | optname, | ||
| const void * | optval, | ||
| socklen_t | optlen | ||
| ) |
Set socket options.
Sets socket options, similar to the standard setsockopt() function. Supports standard socket options as well as XLIO-specific options.
| sock | The socket to configure |
| level | The protocol level (SOL_SOCKET, IPPROTO_TCP, etc.) |
| optname | The option name |
| optval | Pointer to the option value |
| optlen | Length of the option value |
| int xlio_socket_update | ( | xlio_socket_t | sock, |
| unsigned | flags, | ||
| uintptr_t | userdata_sq | ||
| ) |
Update socket attributes.
Updates the flags and user data associated with a socket. This allows changing socket behavior and context without recreating the socket.
| sock | The socket to update |
| flags | New flags for the socket |
| userdata_sq | New user data for the socket |