#ifdef XDP_USE_NEED_WAKEUP
static int
-syscall_needed(struct xsk_ring_prod *q, uint32_t busy_budget)
+rx_syscall_needed(struct xsk_ring_prod *q, uint32_t busy_budget)
{
return xsk_ring_prod__needs_wakeup(q) | busy_budget;
}
+static int
+tx_syscall_needed(struct xsk_ring_prod *q)
+{
+ return xsk_ring_prod__needs_wakeup(q);
+}
#else
static int
-syscall_needed(struct xsk_ring_prod *q __rte_unused, uint32_t busy_budget)
+rx_syscall_needed(struct xsk_ring_prod *q __rte_unused, uint32_t busy_budget)
{
return busy_budget;
}
+static int
+tx_syscall_needed(struct xsk_ring_prod *q __rte_unused)
+{
+ return 1;
+}
#endif
nb_pkts = xsk_ring_cons__peek(rx, nb_pkts, &idx_rx);
if (nb_pkts == 0) {
- if (syscall_needed(&rxq->fq, rxq->busy_budget))
+ if (rx_syscall_needed(&rxq->fq, rxq->busy_budget))
(void)recvfrom(xsk_socket__fd(rxq->xsk), NULL, 0,
MSG_DONTWAIT, NULL, NULL);
pull_umem_cq(umem, XSK_RING_CONS__DEFAULT_NUM_DESCS, cq);
- if (syscall_needed(&txq->tx, txq->pair->busy_budget))
+ if (tx_syscall_needed(&txq->tx))
while (send(xsk_socket__fd(txq->pair->xsk), NULL,
0, MSG_DONTWAIT) < 0) {
/* some thing unexpected */