]> git.droids-corp.org - dpdk.git/commitdiff
examples/multi_process: fix Rx packets distribution
authorGregory Etelson <getelson@nvidia.com>
Wed, 10 Nov 2021 16:57:59 +0000 (18:57 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 16 Nov 2021 15:22:26 +0000 (16:22 +0100)
MP servers distributes Rx packets between clients according to
round-robin scheme.

Current implementation always started packets distribution from
the first client. That procedure resulted in uniform distribution
in cases when Rx packets number was around clients number
multiplication. However, if RX burst repeatedly returned single
packet, round-robin scheme would not work because all packets
were assigned to the first client only.

The patch does not restart packets distribution from
the first client.
Packets distribution always continues to the next client.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
examples/multi_process/client_server_mp/mp_server/main.c

index b4761ebc7b0532b6fdf7609e3ac264152d2633ee..f54bb8b75a1784c7d3b337b04ae1fb68e7537832 100644 (file)
@@ -234,7 +234,7 @@ process_packets(uint32_t port_num __rte_unused,
                struct rte_mbuf *pkts[], uint16_t rx_count)
 {
        uint16_t i;
-       uint8_t client = 0;
+       static uint8_t client;
 
        for (i = 0; i < rx_count; i++) {
                enqueue_rx_packet(client, pkts[i]);