From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: bjorn.topel@intel.com
Cc: 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>,
netdev@vger.kernel.org, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] xsk: fix for xsk_poll writeable
Date: Wed, 18 Nov 2020 16:25:07 +0800 [thread overview]
Message-ID: <cover.1605686678.git.xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <3306b4d8-8689-b0e7-3f6d-c3ad873b7093@intel.com>
I tried to combine cq available and tx writeable, but I found it very difficult.
Sometimes we pay attention to the status of "available" for both, but sometimes,
we may only pay attention to one, such as tx writeable, because we can use the
item of fq to write to tx. And this kind of demand may be constantly changing,
and it may be necessary to set it every time before entering xsk_poll, so
setsockopt is not very convenient. I feel even more that using a new event may
be a better solution, such as EPOLLPRI, I think it can be used here, after all,
xsk should not have OOB data ^_^.
However, two other problems were discovered during the test:
* The mask returned by datagram_poll always contains EPOLLOUT
* It is not particularly reasonable to return EPOLLOUT based on tx not full
After fixing these two problems, I found that when the process is awakened by
EPOLLOUT, the process can always get the item from cq.
Because the number of packets that the network card can send at a time is
actually limited, suppose this value is "nic_num". Once the number of
consumed items in the tx queue is greater than nic_num, this means that there
must also be new recycled items in the cq queue from nic.
In this way, as long as the tx configured by the user is larger, we won't have
the situation that tx is already in the writeable state but cannot get the item
from cq.
Xuan Zhuo (3):
xsk: replace datagram_poll by sock_poll_wait
xsk: change the tx writeable condition
xsk: set tx/rx the min entries
include/uapi/linux/if_xdp.h | 2 ++
net/xdp/xsk.c | 26 ++++++++++++++++++++++----
net/xdp/xsk_queue.h | 6 ++++++
3 files changed, 30 insertions(+), 4 deletions(-)
--
1.8.3.1
next prev parent reply other threads:[~2020-11-18 8:25 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 ` Xuan Zhuo [this message]
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 ` [PATCH bpf v2 1/2] xsk: replace datagram_poll by sock_poll_wait Xuan Zhuo
2020-11-27 8:23 ` 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=cover.1605686678.git.xuanzhuo@linux.alibaba.com \
--to=xuanzhuo@linux.alibaba.com \
--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=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
/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).