distributor: fix return pkt calls in single mode
authorLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Sat, 17 Oct 2020 03:06:50 +0000 (05:06 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 19 Oct 2020 08:57:17 +0000 (10:57 +0200)
In the single legacy version of the distributor synchronization
requires continues exchange of buffers between distributor
and workers. Empty buffers are sent if only handshake
synchronization is required.
However calls to the rte_distributor_return_pkt()
with 0 buffers in single mode were ignored and not passed to the
legacy algorithm implementation causing lack of synchronization.

This patch fixes this issue by passing NULL as buffer which is
a valid way of sending just synchronization handshakes
in single mode.

Fixes: 775003ad2f96 ("distributor: add new burst-capable library")
Cc: stable@dpdk.org
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: David Hunt <david.hunt@intel.com>
lib/librte_distributor/rte_distributor.c

index 7aa079d..6e3eae5 100644 (file)
@@ -167,6 +167,9 @@ rte_distributor_return_pkt(struct rte_distributor *d,
                if (num == 1)
                        return rte_distributor_return_pkt_single(d->d_single,
                                worker_id, oldpkt[0]);
+               else if (num == 0)
+                       return rte_distributor_return_pkt_single(d->d_single,
+                               worker_id, NULL);
                else
                        return -EINVAL;
        }