From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [210.143.35.51]) by dpdk.org (Postfix) with ESMTP id B95C25930 for ; Wed, 23 Jul 2014 01:40:26 +0200 (CEST) Received: from mailgate3.nec.co.jp ([10.7.69.195]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id s6MNfjgv000013 for ; Wed, 23 Jul 2014 08:41:45 +0900 (JST) Received: from mailsv3.nec.co.jp (imss63.nec.co.jp [10.7.69.158]) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) with ESMTP id s6MNfja16102 for ; Wed, 23 Jul 2014 08:41:45 +0900 (JST) Received: from mail01b.kamome.nec.co.jp (mail01b.kamome.nec.co.jp [10.25.43.2]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id s6MNfiLo011207 for ; Wed, 23 Jul 2014 08:41:44 +0900 (JST) Received: from bpxc99gp.gisp.nec.co.jp ([10.38.151.141] [10.38.151.141]) by mail02.kamome.nec.co.jp with ESMTP id BT-MMP-721503; Wed, 23 Jul 2014 08:40:56 +0900 Received: from BPXM14GP.gisp.nec.co.jp ([169.254.1.238]) by BPXC13GP.gisp.nec.co.jp ([10.38.151.141]) with mapi id 14.02.0328.011; Wed, 23 Jul 2014 08:40:56 +0900 From: Hiroshi Shimamoto To: Simon Kuenzer , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] eal/linuxapp: Add parameter to specify master lcore id Thread-Index: AQHPpP/5HRcYWawLzUK9QPLwaiBbj5usvvzA Date: Tue, 22 Jul 2014 23:40:55 +0000 Message-ID: <7F861DC0615E0C47A872E6F3C5FCDDBD01161242@BPXM14GP.gisp.nec.co.jp> References: <1404808110-16314-1-git-send-email-simon.kuenzer@neclab.eu> <53BBBCFC.1070907@neclab.eu> <53CD3E26.1060708@neclab.eu> In-Reply-To: <53CD3E26.1060708@neclab.eu> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.205.5.123] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] eal/linuxapp: Add parameter to specify master lcore id X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 23:40:27 -0000 Hi all, does anyone have interest in this functionality? I think this is important and useful. Since we should care about core assignment to get high performance and the master lcore thread is special in DPDK, we will want to assign the master to the target core. For example, with hyperthreading I'd like to make a pair of packet processing threads into one physical core and separate the master thread which does some management. thanks, Hiroshi > Subject: Re: [dpdk-dev] [PATCH] eal/linuxapp: Add parameter to specify ma= ster lcore id >=20 > Comments? >=20 > On 08.07.2014 11:42, Simon Kuenzer wrote: > > Here are some comments about the use case of this patch: > > > > This patch is especially useful in cases where DPDK applications scale > > their CPU resources at runtime via starting and stopping slave lcores. > > Since the coremask defines the maximum scale-out for such a application= , > > the master lcore becomes to the minimum scale-in. > > Imagine, running multiple primary processed of such DPDK applications, > > users might want to overlap the coremasks for scaling. However, it woul= d > > still make sense to run the master lcores on different CPU cores. > > > > In DPDK vSwitch we might end up in such a scenario with a future releas= e: > > https://lists.01.org/pipermail/dpdk-ovs/2014-March/000770.html > > https://lists.01.org/pipermail/dpdk-ovs/2014-March/000773.html > > > > Thanks, > > > > Simon > > > > On 08.07.2014 10:28, Simon Kuenzer wrote: > >> This commit enables users to specify the lcore id that > >> is used as master lcore. > >> > >> Signed-off-by: Simon Kuenzer > >> --- > >> lib/librte_eal/linuxapp/eal/eal.c | 33 > >> +++++++++++++++++++++++++++++++++ > >> 1 file changed, 33 insertions(+) > >> > >> diff --git a/lib/librte_eal/linuxapp/eal/eal.c > >> b/lib/librte_eal/linuxapp/eal/eal.c > >> index 573fd06..4ad5b9b 100644 > >> --- a/lib/librte_eal/linuxapp/eal/eal.c > >> +++ b/lib/librte_eal/linuxapp/eal/eal.c > >> @@ -101,6 +101,7 @@ > >> #define OPT_XEN_DOM0 "xen-dom0" > >> #define OPT_CREATE_UIO_DEV "create-uio-dev" > >> #define OPT_VFIO_INTR "vfio-intr" > >> +#define OPT_MASTER_LCORE "master-lcore" > >> > >> #define RTE_EAL_BLACKLIST_SIZE 0x100 > >> > >> @@ -336,6 +337,7 @@ eal_usage(const char *prgname) > >> "[--proc-type primary|secondary|auto] \n\n" > >> "EAL options:\n" > >> " -c COREMASK : A hexadecimal bitmask of cores to run > >> on\n" > >> + " --"OPT_MASTER_LCORE" ID: Core ID that is used as master= \n" > >> " -n NUM : Number of memory channels\n" > >> " -v : Display version information on startup\= n" > >> " -d LIB.so : add driver (can be used multiple times)= \n" > >> @@ -468,6 +470,21 @@ eal_parse_coremask(const char *coremask) > >> return 0; > >> } > >> > >> +/* Changes the lcore id of the master thread */ > >> +static int > >> +eal_parse_master_lcore(const char *arg) > >> +{ > >> + struct rte_config *cfg =3D rte_eal_get_configuration(); > >> + int master_lcore =3D atoi(arg); > >> + > >> + if (!(master_lcore >=3D 0 && master_lcore < RTE_MAX_LCORE)) > >> + return -1; > >> + if (cfg->lcore_role[master_lcore] !=3D ROLE_RTE) > >> + return -1; > >> + cfg->master_lcore =3D master_lcore; > >> + return 0; > >> +} > >> + > >> static int > >> eal_parse_syslog(const char *facility) > >> { > >> @@ -653,6 +670,7 @@ eal_parse_args(int argc, char **argv) > >> {OPT_HUGE_DIR, 1, 0, 0}, > >> {OPT_NO_SHCONF, 0, 0, 0}, > >> {OPT_PROC_TYPE, 1, 0, 0}, > >> + {OPT_MASTER_LCORE, 1, 0, 0}, > >> {OPT_FILE_PREFIX, 1, 0, 0}, > >> {OPT_SOCKET_MEM, 1, 0, 0}, > >> {OPT_PCI_WHITELIST, 1, 0, 0}, > >> @@ -802,6 +820,21 @@ eal_parse_args(int argc, char **argv) > >> else if (!strcmp(lgopts[option_index].name, > >> OPT_PROC_TYPE)) { > >> internal_config.process_type =3D > >> eal_parse_proc_type(optarg); > >> } > >> + else if (!strcmp(lgopts[option_index].name, > >> OPT_MASTER_LCORE)) { > >> + if (!coremask_ok) { > >> + RTE_LOG(ERR, EAL, "please specify the master " > >> + "lcore id after specifying " > >> + "the coremask\n"); > >> + eal_usage(prgname); > >> + return -1; > >> + } > >> + if (eal_parse_master_lcore(optarg) < 0) { > >> + RTE_LOG(ERR, EAL, "invalid parameter for --" > >> + OPT_MASTER_LCORE "\n"); > >> + eal_usage(prgname); > >> + return -1; > >> + } > >> + } > >> else if (!strcmp(lgopts[option_index].name, > >> OPT_FILE_PREFIX)) { > >> internal_config.hugefile_prefix =3D optarg; > >> } > >> > >