From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.ics.ntt-tx.co.jp (mail05.ics.ntt-tx.co.jp [210.232.35.69]) by dpdk.org (Postfix) with ESMTP id 151367D30 for ; Thu, 28 Dec 2017 05:56:11 +0100 (CET) Received: from gwchk03.silk.ntt-tx.co.jp (gwchk03.silk.ntt-tx.co.jp [10.107.0.111]) by mail04.ics.ntt-tx.co.jp (unknown) with ESMTP id vBS4uAWF025203 for unknown; Thu, 28 Dec 2017 13:56:10 +0900 Received: (from root@localhost) by gwchk03.silk.ntt-tx.co.jp (unknown) id vBS4u8IB027385 for unknown; Thu, 28 Dec 2017 13:56:08 +0900 Received: from gwchk.silk.ntt-tx.co.jp [10.107.0.110] by gwchk03.silk.ntt-tx.co.jp with ESMTP id PAA27377; Thu, 28 Dec 2017 13:56:08 +0900 Received: from imss03.silk.ntt-tx.co.jp (localhost [127.0.0.1]) by imss03.silk.ntt-tx.co.jp (unknown) with ESMTP id vBS4u7u6011130 for unknown; Thu, 28 Dec 2017 13:56:07 +0900 Received: from mgate01.silk.ntt-tx.co.jp (smtp02.silk.ntt-tx.co.jp [10.107.0.37]) by imss03.silk.ntt-tx.co.jp (unknown) with ESMTP id vBS4u7HR011093 for unknown; Thu, 28 Dec 2017 13:56:07 +0900 Message-Id: <201712280456.vBS4u7HR011093@imss03.silk.ntt-tx.co.jp> Received: from localhost by mgate01.silk.ntt-tx.co.jp (unknown) id vBS4u4bA025622 ; Thu, 28 Dec 2017 13:56:06 +0900 From: x-fn-spp@sl.ntt-tx.co.jp To: spp@dpdk.org Date: Thu, 28 Dec 2017 13:55:43 +0900 X-Mailer: git-send-email 1.9.1 In-Reply-To: <4aae78ff-3b6c-cdfe-a8b7-24ec08b73935@lab.ntt.co.jp> References: <4aae78ff-3b6c-cdfe-a8b7-24ec08b73935@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-MML: No Subject: [spp] [PATCH 36/57] spp_vf: extend limit on number of usable cores X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 04:56:13 -0000 From: Hiroyuki Nakamura Extend the limit on the number of usable cores to 128. Remove unnecessary check procedure. Signed-off-by: Kentaro Watanabe Signed-off-by: Yasufum Ogawa --- src/vf/spp_config.h | 2 +- src/vf/spp_vf.c | 84 +++++------------------------------------------------ 2 files changed, 8 insertions(+), 78 deletions(-) diff --git a/src/vf/spp_config.h b/src/vf/spp_config.h index ac2bc55..69f6a3f 100644 --- a/src/vf/spp_config.h +++ b/src/vf/spp_config.h @@ -12,7 +12,7 @@ #define SPP_CONFIG_STR_LEN 32 #define SPP_CONFIG_MAC_TABLE_MAX 16 -#define SPP_CONFIG_CORE_MAX 64 +#define SPP_CONFIG_CORE_MAX 128 #define SPP_CONFIG_PATH_LEN 1024 #define SPP_CONFIG_DEFAULT_CLASSIFIED_SPEC_STR "default" diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c index 418520f..6947bf0 100644 --- a/src/vf/spp_vf.c +++ b/src/vf/spp_vf.c @@ -245,66 +245,6 @@ stop_process(int signal) { } /* - * 起動パラメータのCPUのbitmapを数値へ変換 - */ -static int -parse_cpu_bit(uint64_t *cpu, const char *cpu_bit) -{ - char *endptr = NULL; - uint64_t temp; - - temp = strtoull(cpu_bit, &endptr, 0); - if (unlikely(endptr == cpu_bit) || unlikely(*endptr != '\0')) { - return -1; - } - - *cpu = temp; - RTE_LOG(DEBUG, APP, "cpu = %lu", *cpu); - return 0; -} - -/* - * Parse the dpdk arguments for use in client app. - */ -static int -parse_dpdk_args(int argc, char *argv[]) -{ - int cnt; - int option_index, opt; - const int argcopt = argc; - char *argvopt[argcopt]; - const char *progname = argv[0]; - static struct option lgopts[] = { {0} }; - - /* getoptを使用するとargvが並び変わるみたいなので、コピーを実施 */ - for (cnt = 0; cnt < argcopt; cnt++) { - argvopt[cnt] = argv[cnt]; - } - - /* Check DPDK parameter */ - optind = 0; - opterr = 0; - while ((opt = getopt_long(argc, argvopt, "c:", lgopts, - &option_index)) != EOF) { - switch (opt) { - case 'c': - /* CPU */ - if (parse_cpu_bit(&g_startup_param.cpu, optarg) != 0) { - usage(progname); - return -1; - } - break; - default: - /* CPU */ - /* DPDKのパラメータは他にもあるので、エラーとはしない */ - break; - } - } - - return 0; -} - -/* * Parses the process ID of the application argument. */ static int @@ -493,7 +433,6 @@ set_form_proc_info(struct spp_config_area *config) int core_cnt, rx_start, rx_cnt, tx_start, tx_cnt; enum port_type if_type; int if_no; - uint64_t cpu_bit = 0; struct spp_config_functions *core_func = NULL; struct spp_core_info *core_info = NULL; struct patch_info *patch_info = NULL; @@ -517,7 +456,12 @@ set_form_proc_info(struct spp_config_area *config) /* Set CORE type */ core_info->type = core_func->type; - cpu_bit |= 1 << core_func->core_no; + if (!rte_lcore_is_enabled(core_func->core_no)) { + /* CPU mismatch */ + RTE_LOG(ERR, APP, "CPU mismatch (cpu = %u)\n", + core_func->core_no); + return -1; + } /* Set RX port */ rx_start = core_info->num_rx_port; @@ -570,14 +514,6 @@ set_form_proc_info(struct spp_config_area *config) } } -#if 0 /* bugfix#385 */ - if (unlikely((cpu_bit & g_startup_param.cpu) != cpu_bit)) { - /* CPU mismatch */ - RTE_LOG(ERR, APP, "CPU mismatch (cpu param = %lx, config = %lx)\n", - g_startup_param.cpu, cpu_bit); - return -1; - } -#endif return 0; } @@ -883,12 +819,6 @@ ut_main(int argc, char *argv[]) unsigned int main_lcore_id = 0xffffffff; while(1) { - /* Parse dpdk parameters */ - int ret_parse = parse_dpdk_args(argc, argv); - if (unlikely(ret_parse != 0)) { - break; - } - /* DPDK initialize */ int ret_dpdk = rte_eal_init(argc, argv); if (unlikely(ret_dpdk < 0)) { @@ -903,7 +833,7 @@ ut_main(int argc, char *argv[]) rte_log_set_global_level(RTE_LOG_LEVEL); /* Parse application parameters */ - ret_parse = parse_app_args(argc, argv); + int ret_parse = parse_app_args(argc, argv); if (unlikely(ret_parse != 0)) { break; } -- 1.9.1