mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 07:13:34 +00:00
tsnep: Fix XDP_RING_NEED_WAKEUP for empty fill ring
[ Upstream commit9a91c05f4b
] 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:3fc2333933
("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3fc1e53499
commit
d60ff1d313
1 changed files with 13 additions and 0 deletions
|
@ -1711,6 +1711,19 @@ static void tsnep_rx_reopen_xsk(struct tsnep_rx *rx)
|
|||
allocated--;
|
||||
}
|
||||
}
|
||||
|
||||
/* set need wakeup flag immediately if ring is not filled completely,
|
||||
* first polling would be too late as need wakeup signalisation would
|
||||
* be delayed for an indefinite time
|
||||
*/
|
||||
if (xsk_uses_need_wakeup(rx->xsk_pool)) {
|
||||
int desc_available = tsnep_rx_desc_available(rx);
|
||||
|
||||
if (desc_available)
|
||||
xsk_set_rx_need_wakeup(rx->xsk_pool);
|
||||
else
|
||||
xsk_clear_rx_need_wakeup(rx->xsk_pool);
|
||||
}
|
||||
}
|
||||
|
||||
static bool tsnep_pending(struct tsnep_queue *queue)
|
||||
|
|
Loading…
Reference in a new issue