When a big batch will reach a vhost-user port, there will be some
non avoidable retries due to a hardcoded limit in the vhost library.
Extend the retry limit.

Link: https://git.dpdk.org/dpdk/tree/lib/vhost/virtio_net.c?h=v25.11#n1722
Signed-off-by: David Marchand <[email protected]>
---
 lib/netdev-dpdk.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index e375275de1..cab69f00db 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -3352,12 +3352,21 @@ netdev_dpdk_vhost_send(struct netdev *netdev, int qid,
             cnt -= tx_pkts;
             /* Prepare for possible retry.*/
             pkts = &pkts[tx_pkts];
-            if (OVS_UNLIKELY(cnt && !retries)) {
-                /*
-                 * Read max retries as there are packets not sent
-                 * and no retries have already occurred.
-                 */
-                atomic_read_relaxed(&dev->vhost_tx_retries_max, &max_retries);
+            if (OVS_UNLIKELY(cnt)) {
+                if (!retries) {
+                    /*
+                     * Read max retries as there are packets not sent
+                     * and no retries have already occurred.
+                     */
+                    atomic_read_relaxed(&dev->vhost_tx_retries_max,
+                                        &max_retries);
+                }
+                if (tx_pkts == 32) {
+                    /* As of v25.11, the vhost library only sends 32 mbufs
+                     * at maximum for a reason lost in limbo.
+                     * Extend our max retries for this batch. */
+                    max_retries++;
+                }
             }
         } else {
             /* No packets sent - do not retry.*/
-- 
2.54.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to