DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: changes for setting control thread mask
@ 2020-04-21  7:42 Kiran KN
  2020-04-21  8:01 ` David Marchand
  0 siblings, 1 reply; 4+ messages in thread
From: Kiran KN @ 2020-04-21  7:42 UTC (permalink / raw)
  To: dev; +Cc: Thomas Monjalon, david.marchand


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(-)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index a7f9c5f9b..1b99a986d 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -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"
-- 
2.16.6



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: changes for setting control thread mask
  2020-04-21  7:42 [dpdk-dev] [PATCH] eal: changes for setting control thread mask Kiran KN
@ 2020-04-21  8:01 ` David Marchand
  2021-03-25 14:51   ` David Marchand
  0 siblings, 1 reply; 4+ messages in thread
From: David Marchand @ 2020-04-21  8:01 UTC (permalink / raw)
  To: Kiran KN; +Cc: dev, Thomas Monjalon

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*


-- 
David Marchand


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: changes for setting control thread mask
  2020-04-21  8:01 ` David Marchand
@ 2021-03-25 14:51   ` David Marchand
  2021-03-27 18:54     ` Kiran KN
  0 siblings, 1 reply; 4+ messages in thread
From: David Marchand @ 2021-03-25 14:51 UTC (permalink / raw)
  To: Kiran KN; +Cc: dev, Thomas Monjalon

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: changes for setting control thread mask
  2021-03-25 14:51   ` David Marchand
@ 2021-03-27 18:54     ` Kiran KN
  0 siblings, 0 replies; 4+ messages in thread
From: Kiran KN @ 2021-03-27 18:54 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Thomas Monjalon

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-27 18:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21  7:42 [dpdk-dev] [PATCH] eal: changes for setting control thread mask Kiran KN
2020-04-21  8:01 ` David Marchand
2021-03-25 14:51   ` David Marchand
2021-03-27 18:54     ` Kiran KN

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).