Skip to content

Commit

Permalink
examples/multi_process: fix Rx packets distribution
Browse files Browse the repository at this point in the history
[ upstream commit 69f9d8a ]

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: af75078 ("first public release")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  • Loading branch information
getelson-at-mellanox authored and cpaelzer committed Nov 30, 2021
1 parent c98edab commit 2f782b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/multi_process/client_server_mp/mp_server/main.c
Expand Up @@ -233,7 +233,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]);
Expand Down

0 comments on commit 2f782b7

Please sign in to comment.