eal: changes for setting control thread mask
Checks
Commit Message
Define a global variable ctrl_thread_set which the application can set.
If this is the case, use this for setting control thread affinity instead
of deducing it from the existing core pinning of the process.
signed-off-by: Kiran KN <kirankn@juniper.net>
---
lib/librte_eal/common/eal_common_options.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
Comments
On Tue, Apr 21, 2020 at 9:42 AM Kiran KN <kirankn@juniper.net> wrote:
> Define a global variable ctrl_thread_set which the application can set.
> If this is the case, use this for setting control thread affinity instead
> of deducing it from the existing core pinning of the process.
I am unconvinced on adding an EAL option for this.
It needs an explanation on why you can't rely on the dpdk process
current affinity for control threads.
And we will need a unit test.
Please rebase your patch on master too.
> signed-off-by: Kiran KN <kirankn@juniper.net>
Signed-off-by*
On Tue, Apr 21, 2020 at 10:01 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Tue, Apr 21, 2020 at 9:42 AM Kiran KN <kirankn@juniper.net> wrote:
> > Define a global variable ctrl_thread_set which the application can set.
> > If this is the case, use this for setting control thread affinity instead
> > of deducing it from the existing core pinning of the process.
>
> I am unconvinced on adding an EAL option for this.
> It needs an explanation on why you can't rely on the dpdk process
> current affinity for control threads.
> And we will need a unit test.
>
> Please rebase your patch on master too.
>
> > signed-off-by: Kiran KN <kirankn@juniper.net>
>
> Signed-off-by*
Is this patch abandoned?
Thanks.
Hi David,
This task was supposed to be taken up by someone else in my organisation. Will check and update.
Thanks
On 25/03/21, 8:21 PM, "David Marchand" <david.marchand@redhat.com> wrote:
[External Email. Be cautious of content]
On Tue, Apr 21, 2020 at 10:01 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Tue, Apr 21, 2020 at 9:42 AM Kiran KN <kirankn@juniper.net> wrote:
> > Define a global variable ctrl_thread_set which the application can set.
> > If this is the case, use this for setting control thread affinity instead
> > of deducing it from the existing core pinning of the process.
>
> I am unconvinced on adding an EAL option for this.
> It needs an explanation on why you can't rely on the dpdk process
> current affinity for control threads.
> And we will need a unit test.
>
> Please rebase your patch on master too.
>
> > signed-off-by: Kiran KN <kirankn@juniper.net>
>
> Signed-off-by*
Is this patch abandoned?
Thanks.
--
David Marchand
Juniper Business Use Only
@@ -41,6 +41,7 @@ eal_short_options[] =
"b:" /* pci-blacklist */
"c:" /* coremask */
"s:" /* service coremask */
+ "C:" /* control threads */
"d:" /* driver */
"h" /* help */
"l:" /* corelist */
@@ -1201,7 +1202,7 @@ eal_parse_common_option(int opt, const char *optarg,
{
static int b_used;
static int w_used;
-
+ static uint16_t set[RTE_MAX_LCORE];
switch (opt) {
/* blacklist */
case 'b':
@@ -1295,6 +1296,17 @@ eal_parse_common_option(int opt, const char *optarg,
return -1;
}
break;
+ /* control threads */
+ case 'C':
+ if (eal_parse_set(optarg, set, RTE_DIM(set)) < 0) {
+ RTE_LOG(ERR, EAL, "invalid control threads\n");
+ return -1;
+ }
+ if (convert_to_cpuset(&conf->ctrl_cpuset, set, RTE_DIM(set)) < 0) {
+ RTE_LOG(ERR, EAL, "Error adding set to control cpuset\n");
+ return -1;
+ }
+ break;
/* service corelist */
case 'S':
if (eal_parse_service_corelist(optarg) < 0) {
@@ -1542,7 +1554,9 @@ eal_adjust_config(struct internal_config *internal_cfg)
lcore_config[cfg->master_lcore].core_role = ROLE_RTE;
}
- compute_ctrl_threads_cpuset(internal_cfg);
+ if (CPU_COUNT(&internal_cfg->ctrl_cpuset) == 0) {
+ compute_ctrl_threads_cpuset(internal_cfg);
+ }
/* if no memory amounts were requested, this will result in 0 and
* will be overridden later, right after eal_hugepage_info_init() */
@@ -1656,6 +1670,10 @@ eal_common_usage(void)
" '( )' can be omitted for single element group,\n"
" '@' can be omitted if cpus and lcores have the same value\n"
" -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores\n"
+ " -C CONTROL THREADS The argument format is\n"
+ " (list of cpus) or Hexadecimal bitmask of cores\n"
+ " Within the list of cpus, '-' is used as range seperator,\n"
+ " ',' is used for single number seperator.\n"
" --"OPT_MASTER_LCORE" ID Core ID that is used as master\n"
" --"OPT_MBUF_POOL_OPS_NAME" Pool ops name for mbuf to use\n"
" -n CHANNELS Number of memory channels\n"