[v4] examples/multi_process: fix Rx packets distribution
Checks
Commit Message
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.
Cc: stable@dpdk.org
Fixes: af75078fece3 ("first public release")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
v2: Remove explisit static variable initialization.
v3: Remove comment.
v4: Spell check.
---
examples/multi_process/client_server_mp/mp_server/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Nov 10, 2021 at 5:58 PM Gregory Etelson <getelson@nvidia.com> wrote:
>
> 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>
Applied, thanks.
@@ -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]);