Skip to content

Commit 9a91c05

Browse files
Gerhard EnglederPaolo Abeni
authored andcommitted
tsnep: Fix XDP_RING_NEED_WAKEUP for empty fill ring
The fill ring of the XDP socket may contain not enough buffers to completey fill the RX queue during socket creation. In this case the flag XDP_RING_NEED_WAKEUP is not set as this flag is only set if the RX queue is not completely filled during polling. Set XDP_RING_NEED_WAKEUP flag also if RX queue is not completely filled during XDP socket creation. Fixes: 3fc2333 ("tsnep: Add XDP socket zero-copy RX support") Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 50bad6f commit 9a91c05

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/net/ethernet/engleder/tsnep_main.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,19 @@ static void tsnep_rx_reopen_xsk(struct tsnep_rx *rx)
17621762
allocated--;
17631763
}
17641764
}
1765+
1766+
/* set need wakeup flag immediately if ring is not filled completely,
1767+
* first polling would be too late as need wakeup signalisation would
1768+
* be delayed for an indefinite time
1769+
*/
1770+
if (xsk_uses_need_wakeup(rx->xsk_pool)) {
1771+
int desc_available = tsnep_rx_desc_available(rx);
1772+
1773+
if (desc_available)
1774+
xsk_set_rx_need_wakeup(rx->xsk_pool);
1775+
else
1776+
xsk_clear_rx_need_wakeup(rx->xsk_pool);
1777+
}
17651778
}
17661779

17671780
static bool tsnep_pending(struct tsnep_queue *queue)

0 commit comments

Comments
 (0)