1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation.
6 #include <linux/version.h>
9 #if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE && \
10 defined(RTE_LIBRTE_AF_XDP_PMD_SHARED_UMEM)
11 #define ETH_AF_XDP_SHARED_UMEM 1
14 #ifdef ETH_AF_XDP_SHARED_UMEM
15 static __rte_always_inline int
16 create_shared_socket(struct xsk_socket **xsk_ptr,
18 __u32 queue_id, struct xsk_umem *umem,
19 struct xsk_ring_cons *rx,
20 struct xsk_ring_prod *tx,
21 struct xsk_ring_prod *fill,
22 struct xsk_ring_cons *comp,
23 const struct xsk_socket_config *config)
25 return xsk_socket__create_shared(xsk_ptr, ifname, queue_id, umem, rx,
26 tx, fill, comp, config);
29 static __rte_always_inline int
30 create_shared_socket(struct xsk_socket **xsk_ptr __rte_unused,
31 const char *ifname __rte_unused,
32 __u32 queue_id __rte_unused,
33 struct xsk_umem *umem __rte_unused,
34 struct xsk_ring_cons *rx __rte_unused,
35 struct xsk_ring_prod *tx __rte_unused,
36 struct xsk_ring_prod *fill __rte_unused,
37 struct xsk_ring_cons *comp __rte_unused,
38 const struct xsk_socket_config *config __rte_unused)
44 #ifdef XDP_USE_NEED_WAKEUP
46 tx_syscall_needed(struct xsk_ring_prod *q)
48 return xsk_ring_prod__needs_wakeup(q);
52 tx_syscall_needed(struct xsk_ring_prod *q __rte_unused)