From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 4FBCB58FA for ; Thu, 31 May 2018 16:32:37 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2018 07:32:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,463,1520924400"; d="scan'208";a="204232033" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga004.jf.intel.com with ESMTP; 31 May 2018 07:32:34 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w4VEWXmC003127; Thu, 31 May 2018 15:32:33 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w4VEWXMP023456; Thu, 31 May 2018 15:32:33 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w4VEWXnT023452; Thu, 31 May 2018 15:32:33 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: Bruce Richardson , ray.kinsella@intel.com, kuralamudhan.ramakrishnan@intel.com, louise.m.daly@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com Date: Thu, 31 May 2018 15:32:25 +0100 Message-Id: <814570b61c300b6e745d0d40bb31db5e94e012b8.1527776837.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [RFC 02/10] eal: make --no-shconf an alias for --no-shared-files X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2018 14:32:37 -0000 Move all functionality associated with --no-shconf to --no-shared-files, and make the former an alias for the latter. Signed-off-by: Anatoly Burakov --- lib/librte_eal/bsdapp/eal/eal.c | 4 ++-- lib/librte_eal/common/eal_common_memory.c | 3 ++- lib/librte_eal/common/eal_common_options.c | 8 ++------ lib/librte_eal/common/eal_internal_cfg.h | 1 - lib/librte_eal/common/eal_options.h | 2 +- lib/librte_eal/linuxapp/eal/eal.c | 6 +++--- test/test/test_eal_flags.c | 18 +++++++++--------- 7 files changed, 19 insertions(+), 23 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index dc279542d..4dff1804e 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -222,7 +222,7 @@ rte_eal_config_create(void) const char *pathname = eal_runtime_config_path(); - if (internal_config.no_shconf) + if (internal_config.no_shared_files) return; if (mem_cfg_fd < 0){ @@ -261,7 +261,7 @@ rte_eal_config_attach(void) void *rte_mem_cfg_addr; const char *pathname = eal_runtime_config_path(); - if (internal_config.no_shconf) + if (internal_config.no_shared_files) return; if (mem_cfg_fd < 0){ diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c index 4f0688f9d..a9c4b9b68 100644 --- a/lib/librte_eal/common/eal_common_memory.c +++ b/lib/librte_eal/common/eal_common_memory.c @@ -938,7 +938,8 @@ rte_eal_memory_init(void) if (retval < 0) goto fail; - if (internal_config.no_shconf == 0 && rte_eal_memdevice_init() < 0) + if (internal_config.no_shared_files == 0 && + rte_eal_memdevice_init() < 0) goto fail; return 0; diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 38df094de..0f3eb928a 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -65,7 +65,7 @@ eal_long_options[] = { {OPT_NO_HPET, 0, NULL, OPT_NO_HPET_NUM }, {OPT_NO_HUGE, 0, NULL, OPT_NO_HUGE_NUM }, {OPT_NO_PCI, 0, NULL, OPT_NO_PCI_NUM }, - {OPT_NO_SHCONF, 0, NULL, OPT_NO_SHCONF_NUM }, + {OPT_NO_SHCONF, 0, NULL, OPT_NO_SHARED_FILES_NUM }, {OPT_NO_SHARED_FILES, 0, NULL, OPT_NO_SHARED_FILES_NUM }, {OPT_PCI_BLACKLIST, 1, NULL, OPT_PCI_BLACKLIST_NUM }, {OPT_PCI_WHITELIST, 1, NULL, OPT_PCI_WHITELIST_NUM }, @@ -1162,10 +1162,6 @@ eal_parse_common_option(int opt, const char *optarg, conf->vmware_tsc_map = 1; break; - case OPT_NO_SHCONF_NUM: - conf->no_shconf = 1; - break; - case OPT_NO_SHARED_FILES_NUM: conf->no_shared_files = 1; break; @@ -1382,6 +1378,6 @@ eal_common_usage(void) " --"OPT_NO_HUGE" Use malloc instead of hugetlbfs\n" " --"OPT_NO_PCI" Disable PCI\n" " --"OPT_NO_HPET" Disable HPET\n" - " --"OPT_NO_SHCONF" No shared config (mmap'd files)\n" + " --"OPT_NO_SHCONF" Deprecated. Alias for --no-shared-files\n" "\n", RTE_MAX_LCORE); } diff --git a/lib/librte_eal/common/eal_internal_cfg.h b/lib/librte_eal/common/eal_internal_cfg.h index 3fc71bb49..d80bacd4d 100644 --- a/lib/librte_eal/common/eal_internal_cfg.h +++ b/lib/librte_eal/common/eal_internal_cfg.h @@ -40,7 +40,6 @@ struct internal_config { volatile unsigned no_hpet; /**< true to disable HPET */ volatile unsigned vmware_tsc_map; /**< true to use VMware TSC mapping * instead of native TSC */ - volatile unsigned no_shconf; /**< true if there is no shared config */ volatile unsigned no_shared_files; /**< true if there are no shared files to be created*/ volatile unsigned create_uio_dev; /**< true to create /dev/uioX devices */ volatile enum rte_proc_type_t process_type; /**< multi-process proc type */ diff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h index b0d9d6819..6890d4114 100644 --- a/lib/librte_eal/common/eal_options.h +++ b/lib/librte_eal/common/eal_options.h @@ -43,8 +43,8 @@ enum { OPT_NO_HUGE_NUM, #define OPT_NO_PCI "no-pci" OPT_NO_PCI_NUM, +/* no-shconf is an alias for no-shared-files */ #define OPT_NO_SHCONF "no-shconf" - OPT_NO_SHCONF_NUM, #define OPT_NO_SHARED_FILES "no-shared-files" OPT_NO_SHARED_FILES_NUM, #define OPT_SOCKET_MEM "socket-mem" diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 8655b8691..32ca25dc2 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -230,7 +230,7 @@ rte_eal_config_create(void) const char *pathname = eal_runtime_config_path(); - if (internal_config.no_shconf) + if (internal_config.no_shared_files) return; /* map the config before hugepage address so that we don't waste a page */ @@ -283,7 +283,7 @@ rte_eal_config_attach(void) const char *pathname = eal_runtime_config_path(); - if (internal_config.no_shconf) + if (internal_config.no_shared_files) return; if (mem_cfg_fd < 0){ @@ -309,7 +309,7 @@ rte_eal_config_reattach(void) struct rte_mem_config *mem_config; void *rte_mem_cfg_addr; - if (internal_config.no_shconf) + if (internal_config.no_shared_files) return; /* save the address primary process has mapped shared config to */ diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c index f840ca50b..8e83ea7bf 100644 --- a/test/test/test_eal_flags.c +++ b/test/test/test_eal_flags.c @@ -27,7 +27,7 @@ #define mp_flag "--proc-type=secondary" #define no_hpet "--no-hpet" #define no_huge "--no-huge" -#define no_shconf "--no-shconf" +#define no_shared_files "--no-shared-files" #define pci_whitelist "--pci-whitelist" #define vdev "--vdev" #define memtest "memtest" @@ -370,7 +370,7 @@ test_invalid_vdev_flag(void) #ifdef RTE_EXEC_ENV_BSDAPP /* BSD target doesn't support prefixes at this point, and we also need to * run another primary process here */ - const char * prefix = no_shconf; + const char * prefix = no_shared_files; #else const char * prefix = "--file-prefix=vdev"; #endif @@ -662,15 +662,15 @@ test_invalid_n_flag(void) #endif /* -n flag but no value */ - const char *argv1[] = { prgname, prefix, no_huge, no_shconf, "-c", "1", "-n"}; + const char *argv1[] = { prgname, prefix, no_huge, no_shared_files, "-c", "1", "-n"}; /* bad numeric value */ - const char *argv2[] = { prgname, prefix, no_huge, no_shconf, "-c", "1", "-n", "e" }; + const char *argv2[] = { prgname, prefix, no_huge, no_shared_files, "-c", "1", "-n", "e" }; /* zero is invalid */ - const char *argv3[] = { prgname, prefix, no_huge, no_shconf, "-c", "1", "-n", "0" }; + const char *argv3[] = { prgname, prefix, no_huge, no_shared_files, "-c", "1", "-n", "0" }; /* sanity test - check with good value */ - const char *argv4[] = { prgname, prefix, no_huge, no_shconf, "-c", "1", "-n", "2" }; + const char *argv4[] = { prgname, prefix, no_huge, no_shared_files, "-c", "1", "-n", "2" }; /* sanity test - check with no -n flag */ - const char *argv5[] = { prgname, prefix, no_huge, no_shconf, "-c", "1"}; + const char *argv5[] = { prgname, prefix, no_huge, no_shared_files, "-c", "1"}; if (launch_proc(argv1) == 0 || launch_proc(argv2) == 0 @@ -734,7 +734,7 @@ test_no_huge_flag(void) #ifdef RTE_EXEC_ENV_BSDAPP /* BSD target doesn't support prefixes at this point, and we also need to * run another primary process here */ - const char * prefix = no_shconf; + const char * prefix = no_shared_files; #else const char * prefix = "--file-prefix=nohuge"; #endif @@ -851,7 +851,7 @@ test_misc_flags(void) const char *argv5[] = {prgname, prefix, mp_flag, "-c", "1", "--syslog", "error"}; /* With no-sh-conf */ const char *argv6[] = {prgname, "-c", "1", "-n", "2", "-m", DEFAULT_MEM_SIZE, - no_shconf, nosh_prefix }; + no_shared_files, nosh_prefix }; #ifdef RTE_EXEC_ENV_BSDAPP return 0; -- 2.17.0