[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201104153320.66cecba8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Wed, 4 Nov 2020 15:33:20 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Magnus Karlsson <magnus.karlsson@...il.com>
Cc: magnus.karlsson@...el.com, bjorn.topel@...el.com, ast@...nel.org,
daniel@...earbox.net, netdev@...r.kernel.org,
jonathan.lemon@...il.com, bpf@...r.kernel.org,
jeffrey.t.kirsher@...el.com, anthony.l.nguyen@...el.com,
maciej.fijalkowski@...el.com, maciejromanfijalkowski@...il.com,
intel-wired-lan@...ts.osuosl.org
Subject: Re: [PATCH bpf-next 1/6] i40e: introduce lazy Tx completions for
AF_XDP zero-copy
On Wed, 4 Nov 2020 15:08:57 +0100 Magnus Karlsson wrote:
> From: Magnus Karlsson <magnus.karlsson@...el.com>
>
> Introduce lazy Tx completions when a queue is used for AF_XDP
> zero-copy. In the current design, each time we get into the NAPI poll
> loop we try to complete as many Tx packets as possible from the
> NIC. This is performed by reading the head pointer register in the NIC
> that tells us how many packets have been completed. Reading this
> register is expensive as it is across PCIe, so let us try to limit the
> number of times it is read by only completing Tx packets to user-space
> when the number of available descriptors in the Tx HW ring is below
> some threshold. This will decrease the number of reads issued to the
> NIC and improves performance with 1.5% - 2% for the l2fwd xdpsock
> microbenchmark.
>
> The threshold is set to the minimum possible size that the HW ring can
> have. This so that we do not run into a scenario where the threshold
> is higher than the configured number of descriptors in the HW ring.
>
> Signed-off-by: Magnus Karlsson <magnus.karlsson@...el.com>
I feel like this needs a big fat warning somewhere.
It's perfectly fine to never complete TCP packets, but AF_XDP could be
used to implement protocols in user space. What if someone wants to
implement something like TSQ?
Powered by blists - more mailing lists