net/af_xdp: improve packet loss
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 <b3d6c0da41dcf0b8333ab29bfd5c6eca84b2ba45@intel.com>
Acked-by: Xiaolong Ye <c7d6fc2f7e22da80deb234d523238b510a8c0f08@intel.com>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk