net/af_xdp: improve packet loss
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 <ciara.loftus@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>