Re: [dpdk-dev] [PATCH v2] net/af_xdp: optimisations to improve packet loss
From: Ferruh Yigit <hidden>
Date: 2020-06-30 14:14:22
On 6/23/2020 3:29 PM, Ciara Loftus wrote:
This commit makes some changes to the AF_XDP PMD in an effort to improve its packet loss characteristics. 1. In the case of failed transmission due to inability to reserve a tx descriptor, the PMD now pulls from the completion ring, issues a syscall in which the kernel attempts to complete outstanding tx operations, then tries to reserve the tx descriptor again. Prior to this we dropped the packet after the syscall and didn't try to re-reserve. 2. During completion ring cleanup, always pull as many entries as possible from the ring as opposed to the batch size or just how many packets we're going to attempt to send. Keeping the completion ring emptier should reduce failed transmissions in the kernel, as the kernel requires space in the completion ring to successfully tx. 3. Size the fill ring as twice the receive ring size which may help reduce allocation failures in the driver. 4. Emulate a tx_free_thresh - when the number of available entries in the completion ring rises above this, we pull from it. The threshold is set to 1k entries. With these changes, a benchmark which measured the packet rate at which 0.01% packet loss could be reached improved from ~0.1G to ~3Gbps. Signed-off-by: Ciara Loftus <redacted> Acked-by: Xiaolong Ye <redacted>
Applied to dpdk-next-net/master, thanks.