From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: magnus.karlsson@gmail.com
Cc: "Björn Töpel" <bjorn.topel@intel.com>,
"Magnus Karlsson" <magnus.karlsson@intel.com>,
"Jonathan Lemon" <jonathan.lemon@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
"Martin KaFai Lau" <kafai@fb.com>,
"Song Liu" <songliubraving@fb.com>, "Yonghong Song" <yhs@fb.com>,
"Andrii Nakryiko" <andrii@kernel.org>,
"KP Singh" <kpsingh@chromium.org>,
netdev@vger.kernel.org (open list:XDP SOCKETS (AF_XDP)),
bpf@vger.kernel.org (open list:XDP SOCKETS (AF_XDP)),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH bpf v2 1/2] xsk: replace datagram_poll by sock_poll_wait
Date: Wed, 25 Nov 2020 14:48:56 +0800 [thread overview]
Message-ID: <01f59423cad1b634fe704fe238a0038fd74df3ba.1606285978.git.xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <cover.1606285978.git.xuanzhuo@linux.alibaba.com>
In-Reply-To: <cover.1606285978.git.xuanzhuo@linux.alibaba.com>
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.
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
net/xdp/xsk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index b014197..0df8651 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -534,11 +534,13 @@ static int xsk_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)
static __poll_t xsk_poll(struct file *file, struct socket *sock,
struct poll_table_struct *wait)
{
- __poll_t mask = datagram_poll(file, sock, wait);
+ __poll_t mask = 0;
struct sock *sk = sock->sk;
struct xdp_sock *xs = xdp_sk(sk);
struct xsk_buff_pool *pool;
+ sock_poll_wait(file, sock, wait);
+
if (unlikely(!xsk_is_bound(xs)))
return mask;
--
1.8.3.1
next prev parent reply other threads:[~2020-11-25 6:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <964677c6-442c-485e-9268-3a801dbd4bd3@orsmsx607.amr.corp.intel.com>
2020-11-17 10:00 ` [PATCH] xsk: add cq event Björn Töpel
2020-11-18 8:25 ` [PATCH 0/3] xsk: fix for xsk_poll writeable Xuan Zhuo
2020-11-18 8:25 ` [PATCH 1/3] xsk: replace datagram_poll by sock_poll_wait Xuan Zhuo
2020-11-23 14:11 ` Magnus Karlsson
2020-11-24 11:36 ` Magnus Karlsson
2020-11-18 8:25 ` [PATCH 2/3] xsk: change the tx writeable condition Xuan Zhuo
2020-11-24 9:28 ` Magnus Karlsson
2020-11-18 8:25 ` [PATCH 3/3] xsk: set tx/rx the min entries Xuan Zhuo
2020-11-23 14:00 ` [PATCH 0/3] xsk: fix for xsk_poll writeable Magnus Karlsson
[not found] ` <1606142229.4575405-1-xuanzhuo@linux.alibaba.com>
2020-11-24 9:01 ` Magnus Karlsson
2020-11-24 10:38 ` Magnus Karlsson
2020-11-25 6:48 ` [PATCH bpf v2 0/2] " Xuan Zhuo
2020-11-25 6:48 ` Xuan Zhuo [this message]
2020-11-27 8:23 ` [PATCH bpf v2 1/2] xsk: replace datagram_poll by sock_poll_wait Magnus Karlsson
2020-11-25 6:48 ` [PATCH bpf v2 2/2] xsk: change the tx writeable condition Xuan Zhuo
2020-11-27 8:22 ` Magnus Karlsson
2020-11-27 21:29 ` Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=01f59423cad1b634fe704fe238a0038fd74df3ba.1606285978.git.xuanzhuo@linux.alibaba.com \
--to=xuanzhuo@linux.alibaba.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bjorn.topel@intel.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jonathan.lemon@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.karlsson@gmail.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).