Skip to content

Commit f5da541

Browse files
fengidriborkmann
authored andcommitted
xsk: Replace datagram_poll by sock_poll_wait
datagram_poll will judge the current socket status (EPOLLIN, EPOLLOUT) based on the traditional socket information (eg: sk_wmem_alloc), but this does not apply to xsk. So this patch uses sock_poll_wait instead of datagram_poll, and the mask is calculated by xsk_poll. Fixes: c497176 ("xsk: add Rx receive functions and poll support") Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> Link: https://lore.kernel.org/bpf/e82f4697438cd63edbf271ebe1918db8261b7c09.1606555939.git.xuanzhuo@linux.alibaba.com
1 parent 156c9b7 commit f5da541

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎net/xdp/xsk.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,13 @@ static int xsk_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)
471471
static __poll_t xsk_poll(struct file *file, struct socket *sock,
472472
struct poll_table_struct *wait)
473473
{
474-
__poll_t mask = datagram_poll(file, sock, wait);
474+
__poll_t mask = 0;
475475
struct sock *sk = sock->sk;
476476
struct xdp_sock *xs = xdp_sk(sk);
477477
struct xsk_buff_pool *pool;
478478

479+
sock_poll_wait(file, sock, wait);
480+
479481
if (unlikely(!xsk_is_bound(xs)))
480482
return mask;
481483

0 commit comments

Comments
 (0)