diff options
Diffstat (limited to 'src/libknot/xdp/af_xdp.h')
-rw-r--r-- | src/libknot/xdp/af_xdp.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/libknot/xdp/af_xdp.h b/src/libknot/xdp/af_xdp.h index 5bed4bf4a..6009acae5 100644 --- a/src/libknot/xdp/af_xdp.h +++ b/src/libknot/xdp/af_xdp.h @@ -28,21 +28,22 @@ typedef struct { struct iovec payload; } knot_xsk_msg_t; -int knot_xsk_init(const char *ifname, const char *prog_fname, - ssize_t *out_busy_frames); +struct knot_xsk_socket; -void knot_xsk_deinit(void); +int knot_xsk_init(struct knot_xsk_socket **socket, const char *ifname, int if_queue, const char *prog_fname); -struct iovec knot_xsk_alloc_frame(void); +void knot_xsk_deinit(struct knot_xsk_socket *socket); -int knot_xsk_sendmsg(const knot_xsk_msg_t *msg); // msg->payload MUST have been allocated by knot_xsk_alloc_frame() +struct iovec knot_xsk_alloc_frame(struct knot_xsk_socket *socket); -int knot_xsk_sendmmsg(const knot_xsk_msg_t msgs[], uint32_t count); // skip messages with payload length == 0 +int knot_xsk_sendmsg(struct knot_xsk_socket *socket, const knot_xsk_msg_t *msg); // msg->payload MUST have been allocated by knot_xsk_alloc_frame() -int knot_xsk_recvmmsg(knot_xsk_msg_t msgs[], uint32_t max_count, uint32_t *count); +int knot_xsk_sendmmsg(struct knot_xsk_socket *socket, const knot_xsk_msg_t msgs[], uint32_t count); // skip messages with payload length == 0 -void knot_xsk_free_recvd(const knot_xsk_msg_t *msg); +int knot_xsk_recvmmsg(struct knot_xsk_socket *socket, knot_xsk_msg_t msgs[], uint32_t max_count, uint32_t *count); -int knot_xsk_check(void); +void knot_xsk_free_recvd(struct knot_xsk_socket *socket, const knot_xsk_msg_t *msg); -int knot_xsk_get_poll_fd(void); +int knot_xsk_check(struct knot_xsk_socket *socket); + +int knot_xsk_get_poll_fd(struct knot_xsk_socket *socket); |