From: "Hunt, David" <david.hunt@intel.com>
To: Omer Yamac <omer.yamac@ceng.metu.edu.tr>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: Re: [PATCH] examples/distributor: update dynamic configuration
Date: Tue, 28 Jun 2022 12:25:45 +0100 [thread overview]
Message-ID: <ce8028dc-c063-8918-3b00-f64d3d686d24@intel.com> (raw)
In-Reply-To: <1316cb8ca17a15f61db96dae18e99856@ceng.metu.edu.tr>
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 11:26 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 [this message]
2022-06-28 12:06 ` Omer Yamac
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=ce8028dc-c063-8918-3b00-f64d3d686d24@intel.com \
--to=david.hunt@intel.com \
--cc=dev@dpdk.org \
--cc=omer.yamac@ceng.metu.edu.tr \
--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).