All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Gregory Etelson <getelson@nvidia.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Matan Azrad <matan@nvidia.com>,
	Raslan Darawsheh <rasland@nvidia.com>,
	Dmitry Kozlyuk <dkozlyuk@oss.nvidia.com>
Subject: Re: [dpdk-dev] [PATCH] examples/multi_process: fix RX packets distribution
Date: Thu, 28 Oct 2021 16:35:41 +0100	[thread overview]
Message-ID: <db01795a-db69-ee9b-e3ed-26c8ff75f7b6@intel.com> (raw)
In-Reply-To: <BN6PR1201MB02277E0CA080B2F1DBF5034EA5869@BN6PR1201MB0227.namprd12.prod.outlook.com>

On 28-Oct-21 4:14 PM, Gregory Etelson wrote:
> Hello Anatoly,
> 
> ..snip..
> 
>> b/examples/multi_process/client_server_mp/m
>> p_server/main.c
>>> @@ -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 = 0;
>>>
>>>        for (i = 0; i < rx_count; i++) {
>>>                enqueue_rx_packet(client, pkts[i]);
>>>
>>
>> Wouldn't that make it global? I don't recall off
>> the top of my head if
>> the multiprocess app is intended to have
>> multiple Rx threads, but if you
>> did have two forwarding threads, they would
>> effectively both use the
>> same `client` value, stepping on top of each
>> other. This should probably
>> be per-thread?
>>
> 
> MP client-server example was not designed as a multi-threaded app.
> Server and clients run in a different process and the model allows one server process.
> Server allocates a dedicated ring to each client and distributes Rx packets
> between rings in round-robin sequence.
> Each ring configured for single producer and single consumer.
> Consider an example when server's rte_eth_rx_burst() returns a single packet
> on each call.
> Without the patch, the server will ignore all clients with id > 0 and
> assign all Rx packets to rx_ring 0.
> Changing process_packets()  `client` variable to static allows unform round-robin
> packets distribution between rings.
> 
> Regards,
> Gregory
> 

Right, i just checked the code, and the app indeed allows only one 
forwarding thread on the server.

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

  reply	other threads:[~2021-10-28 15:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26  9:50 [dpdk-dev] [PATCH] examples/multi_process: fix RX packets distribution Gregory Etelson
2021-10-28 14:29 ` Burakov, Anatoly
2021-10-28 15:14   ` Gregory Etelson
2021-10-28 15:35     ` Burakov, Anatoly [this message]
2021-11-08 21:27       ` Thomas Monjalon
2021-11-09  6:42         ` Gregory Etelson
2021-11-09  7:30           ` Thomas Monjalon
2021-11-09  9:35             ` Gregory Etelson
2021-11-09  9:58 ` [dpdk-dev] [PATCH v2] examples/multi_proces: fix Rx " Gregory Etelson
2021-11-09 11:35   ` Thomas Monjalon
2021-11-09 11:49     ` Gregory Etelson
2021-11-09 14:17       ` Thomas Monjalon
2021-11-10 16:52 ` [PATCH v3] " Gregory Etelson
2021-11-10 16:57 ` [PATCH v4] examples/multi_process: " Gregory Etelson
2021-11-16 15:07   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db01795a-db69-ee9b-e3ed-26c8ff75f7b6@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=dkozlyuk@oss.nvidia.com \
    --cc=getelson@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.