From: Omer Yamac <omer.yamac@ceng.metu.edu.tr>
To: "Hunt, David" <david.hunt@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH] examples/distributor: update dynamic configuration
Date: Tue, 28 Jun 2022 15:06:19 +0300 [thread overview]
Message-ID: <b1123af508865c236f2b568155e7dc86@ceng.metu.edu.tr> (raw)
In-Reply-To: <ce8028dc-c063-8918-3b00-f64d3d686d24@intel.com>
Hi,
Here is the final version. If it is ok, I will test the code and
publish.
if (enable_lcore_rx_distributor){
// rx and distributor combined, 3 fixed function cores (stat, TX, at
least 1 worker)
min_cores = 4;
num_workers = rte_lcore_count() - 3;
}
else{
// separate rx and distributor, 3 fixed function cores (stat, TX, at
least 1 worker)
min_cores = 5;
num_workers = rte_lcore_count() - 4;
}
On 28.06.2022 14:25, Hunt, David wrote:
> On 28/06/2022 12:06, Omer Yamac wrote:
>> Hi David,
>>
>> I have one more question. When I was working on new patch, I just want
>> to make sure what we are doing.
>> On 27.06.2022 18:51, Hunt, David wrote:
>>> Hi Ömer,
>>>
>>> I've a few comments:
>>>
>>> On 21/06/2022 21:15, Abdullah Ömer Yamaç wrote:
>> --clipped--
>>>> @@ -39,6 +39,7 @@ volatile uint8_t quit_signal_rx;
>>>> volatile uint8_t quit_signal_dist;
>>>> volatile uint8_t quit_signal_work;
>>>> unsigned int power_lib_initialised;
>>>> +bool enable_lcore_rx_distributor;
>>>> static volatile struct app_stats {
>>>> struct {
>> --clipped--
>>>> @@ -724,7 +794,12 @@ main(int argc, char *argv[])
>>>> if (ret < 0)
>>>> rte_exit(EXIT_FAILURE, "Invalid distributor
>>>> parameters\n");
>>>> - if (rte_lcore_count() < 5)
>>>> + if (enable_lcore_rx_distributor)
>>>> + num_workers = rte_lcore_count() - 3;
>>>> + else
>>>> + num_workers = rte_lcore_count() - 4;
>>>> +
>>>
>>> This could be "num_workers = rte_lcore_count() - (4 -
>>> enable_lcore_rx_distributor)".
>>>
>> For the "if-else" case of enable_lcore_rx_distributor, we will reduce
>> the line of codes; but I am not sure about that change. Because the
>> type of the variable is bool and we are using arithmetic operation on
>> that variable. I think it is a little bit harder for people to
>> understand operation. Am I right? I can suggest one more solution. We
>> may change the data type to "unsigned int" or Is it okay to leave as
>> before?
>>
>> --clipped--
>
>
> Hi Ömer,
>
> You raise a good point about readability. Let's leave it as you had
> it originally. Maybe just add a couple of one-line comments? "rx and
> distributor combined, 3 fixed function cores" and "separate rx and
> distributor, 4 fixed function cores?
>
> Rgds,
> Dave.
next prev parent reply other threads:[~2022-06-28 12:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-21 20:15 Abdullah Ömer Yamaç
2022-06-27 15:51 ` Hunt, David
2022-06-27 16:28 ` Omer Yamac
2022-06-28 8:12 ` Hunt, David
2022-06-28 11:06 ` Omer Yamac
2022-06-28 11:25 ` Hunt, David
2022-06-28 12:06 ` Omer Yamac [this message]
2022-06-28 12:34 ` Hunt, David
2022-06-21 21:13 Abdullah Ömer Yamaç
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=b1123af508865c236f2b568155e7dc86@ceng.metu.edu.tr \
--to=omer.yamac@ceng.metu.edu.tr \
--cc=david.hunt@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).