From: "Björn Töpel" <bjorn.topel@intel.com>
To: Maxim Mikityanskiy <maximmi@mellanox.com>,
"David S. Miller" <davem@davemloft.net>,
Magnus Karlsson <magnus.karlsson@intel.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Saeed Mahameed <saeedm@mellanox.com>, Jonathan Lemon <bsd@fb.com>,
Eran Ben Elisha <eranbe@mellanox.com>,
Tariq Toukan <tariqt@mellanox.com>
Subject: Re: [PATCH net-next 4/6] xsk: Extend channels to support combined XSK/non-XSK traffic
Date: Fri, 26 Apr 2019 22:26:50 +0200 [thread overview]
Message-ID: <e4c2a6ee-5aa4-eabf-444f-b5f6df17fe38@intel.com> (raw)
In-Reply-To: <20190426114156.8297-5-maximmi@mellanox.com>
On 2019-04-26 13:42, Maxim Mikityanskiy wrote:
> Currently, the drivers that implement AF_XDP zero-copy support (e.g.,
> i40e) switch the channel into a different mode when an XSK is opened. It
> causes some issues that have to be taken into account. For example, RSS
> needs to be reconfigured to skip the XSK-enabled channels, or the XDP
> program should filter out traffic not intended for that socket and
> XDP_PASS it with an additional copy. As nothing validates or forces the
> proper configuration, it's easy to have packets drops, when they get
> into an XSK by mistake, and, in fact, it's the default configuration.
> There has to be some tool to have RSS reconfigured on each socket open
> and close event, but such a tool is problematic to implement, because no
> one reports these events, and it's race-prone.
>
> This commit extends XSK to support both kinds of traffic (XSK and
> non-XSK) in the same channel. It implies having two RX queues in
> XSK-enabled channels: one for the regular traffic, and the other for
> XSK. It solves the problem with RSS: the default configuration just
> works without the need to manually reconfigure RSS or to perform some
> possibly complicated filtering in the XDP layer. It makes it easy to run
> both AF_XDP and regular sockets on the same machine. In the XDP program,
> the QID's most significant bit will serve as a flag to indicate whether
> it's the XSK queue or not. The extension is compatible with the legacy
> configuration, so if one wants to run the legacy mode, they can
> reconfigure RSS and ignore the flag in the XDP program (implemented in
> the reference XDP program in libbpf). mlx5e will support this extension.
>
> A single XDP program can run both with drivers supporting or not
> supporting this extension. The xdpsock sample and libbpf are updated
> accordingly.
>
> Signed-off-by: Maxim Mikityanskiy<maximmi@mellanox.com>
I acknowledge the problem you're addressing, but I'm not a fan of this
design.
Netdevs, queues and now channels. This is too complicated. The setup is
complex as it is. Adding more cognitive load is not good.
There's already an assumption that a user attaching to a certain netdev
queue has to take care of the flow steering.
What about adding a mode where the AF_XDP user just get a *new* queue,
by binding to (say) netdev;qid==-1? This new queue wouldn't be included
in the existing queue set. Create a bunch of AF_XDP sockets and steer
traffic to that set. And yes, we need a mechanism to steer to that
queue, in-app/socket or out-of-band. Please see this [1] discussion.
I don't like this "let's split a queue into channels".
Björn
[1] https://lore.kernel.org/netdev/20190415183258.36dcee9a@carbon/
next prev parent reply other threads:[~2019-04-26 20:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-26 11:42 [PATCH net-next 0/6] AF_XDP infrastructure improvements Maxim Mikityanskiy
2019-04-26 11:42 ` [PATCH net-next 1/6] samples/bpf: Add hbm to .gitignore Maxim Mikityanskiy
2019-04-26 14:57 ` Maciej Fijalkowski
2019-04-26 11:42 ` [PATCH net-next 2/6] xsk: Add API to check for available entries in FQ Maxim Mikityanskiy
2019-04-26 15:18 ` Alexei Starovoitov
2019-04-26 11:42 ` [PATCH net-next 3/6] xsk: Add getsockopt XDP_OPTIONS Maxim Mikityanskiy
2019-04-26 20:25 ` Björn Töpel
2019-04-26 11:42 ` [PATCH net-next 4/6] xsk: Extend channels to support combined XSK/non-XSK traffic Maxim Mikityanskiy
2019-04-26 15:24 ` Alexei Starovoitov
2019-04-26 19:11 ` Jakub Kicinski
2019-04-30 18:11 ` Maxim Mikityanskiy
2019-04-26 20:26 ` Björn Töpel [this message]
2019-04-30 18:11 ` Maxim Mikityanskiy
2019-04-30 18:24 ` Björn Töpel
2019-04-26 11:42 ` [PATCH net-next 5/6] xsk: Change the default frame size to 4096 and allow controlling it Maxim Mikityanskiy
2019-04-26 20:27 ` Björn Töpel
2019-04-26 11:42 ` [PATCH net-next 6/6] xsk: Return the whole xdp_desc from xsk_umem_consume_tx Maxim Mikityanskiy
2019-04-26 20:25 ` [PATCH net-next 0/6] AF_XDP infrastructure improvements Björn Töpel
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=e4c2a6ee-5aa4-eabf-444f-b5f6df17fe38@intel.com \
--to=bjorn.topel@intel.com \
--cc=bsd@fb.com \
--cc=davem@davemloft.net \
--cc=eranbe@mellanox.com \
--cc=magnus.karlsson@intel.com \
--cc=maximmi@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=tariqt@mellanox.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).