19 #include <netinet/in.h>
20 #include <sys/socket.h>
26 #define SO_XLIO_GET_API 2800
27 #define SO_XLIO_RING_ALLOC_LOGIC 2810
28 #define SO_XLIO_SHUTDOWN_RX 2821
29 #define SO_XLIO_EXT_VLAN_TAG 2824
44 } xlio_recv_callback_retval_t;
50 struct __attribute__((packed)) xlio_info_t {
56 const struct sockaddr *src;
57 const struct sockaddr *dst;
63 uint32_t socket_ready_queue_pkt_count;
65 uint32_t socket_ready_queue_byte_count;
69 struct timespec hw_timestamp;
70 struct timespec sw_timestamp;
75 uint32_t max_burst_sz;
76 uint16_t typical_pkt_sz;
80 RING_LOGIC_PER_INTERFACE = 0,
81 RING_LOGIC_PER_IP = 1,
82 RING_LOGIC_PER_SOCKET = 10,
83 RING_LOGIC_PER_USER_ID = 11,
84 RING_LOGIC_PER_THREAD = 20,
85 RING_LOGIC_PER_CORE = 30,
86 RING_LOGIC_PER_CORE_ATTACH_THREADS = 31,
87 RING_LOGIC_PER_OBJECT = 32,
92 XLIO_RING_ALLOC_MASK_RING_USER_ID = (1 << 0),
93 XLIO_RING_ALLOC_MASK_RING_INGRESS = (1 << 1),
94 XLIO_RING_ALLOC_MASK_RING_ENGRESS = (1 << 2),
95 } xlio_ring_alloc_logic_attr_comp_mask;
113 ring_logic_t ring_alloc_logic;
115 uint32_t ingress : 1;
116 uint32_t engress : 1;
117 uint32_t reserved : 30;
148 typedef xlio_recv_callback_retval_t (*xlio_recv_callback_t)(
int fd,
size_t sz_iov,
150 struct xlio_info_t *xlio_info,
300 uintptr_t userdata_op);
342 uintptr_t parent_userdata_sq);
376 void *(*memory_alloc)(size_t);
377 void (*memory_free)(
void *);
388 #define XLIO_GROUP_FLAG_SAFE 0x1
390 #define XLIO_GROUP_FLAG_DIRTY 0x2
454 uintptr_t userdata_sq;
465 #define XLIO_SOCKET_SEND_FLAG_FLUSH 0x1
467 #define XLIO_SOCKET_SEND_FLAG_INLINE 0x2
492 uintptr_t userdata_op;
void(* xlio_socket_event_cb_t)(xlio_socket_t sock, uintptr_t userdata_sq, int event, int value)
Socket event callback function.
Definition: xlio_types.h:275
void(* xlio_memory_cb_t)(void *addr, size_t len, size_t hugepage_size)
Memory allocation callback function.
Definition: xlio_types.h:234
void(* xlio_socket_accept_cb_t)(xlio_socket_t sock, xlio_socket_t parent, uintptr_t parent_userdata_sq)
Accept callback function.
Definition: xlio_types.h:341
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.
Definition: xlio_types.h:321
void(* xlio_socket_comp_cb_t)(xlio_socket_t sock, uintptr_t userdata_sq, uintptr_t userdata_op)
Zero-copy completion callback function.
Definition: xlio_types.h:299
@ XLIO_SOCKET_EVENT_ESTABLISHED
Definition: xlio_types.h:239
@ XLIO_SOCKET_EVENT_ERROR
Definition: xlio_types.h:245
@ XLIO_SOCKET_EVENT_CLOSED
Definition: xlio_types.h:243
@ XLIO_SOCKET_EVENT_TERMINATED
Definition: xlio_types.h:241
uintptr_t xlio_poll_group_t
Polling group handle.
Definition: xlio_types.h:164
uintptr_t xlio_socket_t
Socket handle.
Definition: xlio_types.h:172
Buffer descriptor.
Definition: xlio_types.h:198
XLIO initialization attributes.
Definition: xlio_types.h:371
Polling group attributes.
Definition: xlio_types.h:414
Definition: xlio_types.h:73
Definition: xlio_types.h:111
Socket creation attributes.
Definition: xlio_types.h:450
Send operation attributes.
Definition: xlio_types.h:489