From patchwork Fri Feb 1 13:11:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1034754 X-Patchwork-Delegate: ian.stokes@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="l5aYx32F"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43rd2800K5z9s9G for ; Sat, 2 Feb 2019 00:17:51 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 76E3F76B9; Fri, 1 Feb 2019 13:16:42 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 6BD1E76B4 for ; Fri, 1 Feb 2019 13:11:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B17FD711 for ; Fri, 1 Feb 2019 13:11:37 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190201131136euoutp0271336561d72008014b8511cc6d1ace81~-P5K6hV833161131611euoutp02y for ; Fri, 1 Feb 2019 13:11:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190201131136euoutp0271336561d72008014b8511cc6d1ace81~-P5K6hV833161131611euoutp02y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549026696; bh=jb0Ru0JRbhnH7KPweNAY8HX/UdId0KTQWS+L/Fv1ZeA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l5aYx32FHM/vE3M1YVzrfAfvO7yrOIBnCpv/sDCzqqgG5QL3Y4bHuZsGYOHDhM67Z +ZMd9PjOkExJnp6O4pUWSZ3pMTd5vAHsIzktVkm+e/3NJQfnQUnT1J2x6WEaqBlHa4 5py+dxAXlLP2jr4Vk3w0K6VtnBxvgcOaht7P+rUk= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190201131135eucas1p242dc0de30efb487d9e4d7b5097893498~-P5KkF0ow1050710507eucas1p25; Fri, 1 Feb 2019 13:11:35 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 18.27.04806.785445C5; Fri, 1 Feb 2019 13:11:35 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190201131135eucas1p162efe7d7b6fc64dbebc36099e908a750~-P5J33St31505315053eucas1p1k; Fri, 1 Feb 2019 13:11:35 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190201131135eusmtrp12bf2a69cce433b3347bc3c40a2712910~-P5J3GZoB2924629246eusmtrp1k; Fri, 1 Feb 2019 13:11:35 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-0c-5c54458771ff Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id FA.C2.04284.785445C5; Fri, 1 Feb 2019 13:11:35 +0000 (GMT) Received: from imaximets.rnd.samsung.ru (unknown [106.109.129.180]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190201131134eusmtip1647664668a7229cfa09308d78811d30e~-P5JP7Ejp1208912089eusmtip1c; Fri, 1 Feb 2019 13:11:34 +0000 (GMT) From: Ilya Maximets To: ovs-dev@openvswitch.org, Ian Stokes Date: Fri, 1 Feb 2019 16:11:13 +0300 Message-Id: <20190201131114.29799-3-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190201131114.29799-1-i.maximets@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBIsWRmVeSWpSXmKPExsWy7djP87rtriExBlea1C1+vXnAbvFqcgOj xZX2n+wWGx+eZbVYe+gDu8XcT88ZHdg8Fu95yeTx7OZ/Ro/n13pYPN7vu8rm0bdlFWMAaxSX TUpqTmZZapG+XQJXxusWo4JpNhWLp01hbWC8pdnFyMkhIWAicXT7PqYuRi4OIYEVjBJH9q1h g3C+MEosn/iWEcL5zCjR/W8WG0zL/N6zUInljBKdm25A9f8A6t/fwgxSxSagI3Fq9RFGEFtE wE5i2qomsCJmgV5Giam3LoONEhYIkNi2/i5YA4uAqsS3+S/AbF4Ba4mGE6eYIdbJS6zecADM 5hSwkfg0fQbYIAmB12wSV7b3sUAUuUjMnH2TFcIWlnh1fAs7hC0jcXpyD1RNvcT9lpeMEM0d jBLTD/1jgkjYS2x5fQ6ogQPoPE2J9bv0IcKOEpPfd7OAhCUE+CRuvBUECTMDmZO2TWeGCPNK dLQJQVSrSPw+uBzqZCmJm+8+Q13gIdG14y0LJID6GSUe7VzKPIFRfhbCsgWMjKsYxVNLi3PT U4uN81LL9YoTc4tL89L1kvNzNzEC08Ppf8e/7mDc9yfpEKMAB6MS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XvI7WdYe3Dzv/zvLR1OV WIozEg21mIuKEwE+15QTaQIAAA== X-CMS-MailID: 20190201131135eucas1p162efe7d7b6fc64dbebc36099e908a750 X-Msg-Generator: CA X-RootMTR: 20190201131135eucas1p162efe7d7b6fc64dbebc36099e908a750 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190201131135eucas1p162efe7d7b6fc64dbebc36099e908a750 References: <20190201131114.29799-1-i.maximets@samsung.com> X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ilya Maximets Subject: [ovs-dev] [RFC 2/3] dpdk: Drop support of deprecated options for EAL arguments. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Drop support of all the old configuration knobs. Values are always ignored now. Warning appears in case some of the old options detected in database. Signed-off-by: Ilya Maximets --- NEWS | 2 +- lib/dpdk.c | 155 +++-------------------------------------------------- 2 files changed, 9 insertions(+), 148 deletions(-) diff --git a/NEWS b/NEWS index 1c09e9d57..07528da95 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,7 @@ Post-v2.11.0 - DPDK: * New option 'other_config:dpdk-options' to pass all the DPDK EAL argumants in a single string. - * Following config options deprecated: + * Following config options no longer supported: 'dpdk-alloc-mem', 'dpdk-socket-mem', 'dpdk-socket-limit', 'dpdk-lcore-mask', 'dpdk-hugepage-dir' and 'dpdk-extra'. diff --git a/lib/dpdk.c b/lib/dpdk.c index 0c37f231d..fe271ce84 100644 --- a/lib/dpdk.c +++ b/lib/dpdk.c @@ -91,8 +91,8 @@ args_contains(const struct svec *args, const char *value) return false; } -static bool -report_deprecated_configs(const struct smap *ovs_other_config, bool ignore) +static void +report_unsupported_configs(const struct smap *ovs_other_config) { struct option { const char *opt; @@ -112,152 +112,16 @@ report_deprecated_configs(const struct smap *ovs_other_config, bool ignore) const char *value = smap_get(ovs_other_config, options[i].opt); if (value) { - VLOG_WARN("Detected deprecated '%s' config. Use '%s %s'" - " in 'dpdk-options' instead.%s", - options[i].opt, options[i].replacement, value, - ignore ? " Value ignored." : ""); + VLOG_WARN("Detected unsupported '%s' config. Use '%s %s'" + " in 'dpdk-options' instead. Value ignored.", + options[i].opt, options[i].replacement, value); found = true; } } if (found) { - VLOG_WARN("Deprecated options will be " + VLOG_WARN("Unsupported options will be " "silently ignored in the future."); } - return found; -} - -static void -construct_dpdk_options(const struct smap *ovs_other_config, struct svec *args) -{ - struct dpdk_options_map { - const char *ovs_configuration; - const char *dpdk_option; - bool default_enabled; - const char *default_value; - } opts[] = { - {"dpdk-lcore-mask", "-c", false, NULL}, - {"dpdk-hugepage-dir", "--huge-dir", false, NULL}, - {"dpdk-socket-limit", "--socket-limit", false, NULL}, - }; - - int i; - - /*First, construct from the flat-options (non-mutex)*/ - for (i = 0; i < ARRAY_SIZE(opts); ++i) { - const char *value = smap_get(ovs_other_config, - opts[i].ovs_configuration); - if (!value && opts[i].default_enabled) { - value = opts[i].default_value; - } - - if (value) { - if (!args_contains(args, opts[i].dpdk_option)) { - svec_add(args, opts[i].dpdk_option); - svec_add(args, value); - } else { - VLOG_WARN("Ignoring database defined option '%s' due to " - "dpdk-extra config", opts[i].dpdk_option); - } - } - } -} - -static char * -construct_dpdk_socket_mem(void) -{ - const char *def_value = "1024"; - int numa, numa_nodes = ovs_numa_get_n_numas(); - struct ds dpdk_socket_mem = DS_EMPTY_INITIALIZER; - - if (numa_nodes == 0 || numa_nodes == OVS_NUMA_UNSPEC) { - numa_nodes = 1; - } - - ds_put_cstr(&dpdk_socket_mem, def_value); - for (numa = 1; numa < numa_nodes; ++numa) { - ds_put_format(&dpdk_socket_mem, ",%s", def_value); - } - - return ds_cstr(&dpdk_socket_mem); -} - -#define MAX_DPDK_EXCL_OPTS 10 - -static void -construct_dpdk_mutex_options(const struct smap *ovs_other_config, - struct svec *args) -{ - char *default_dpdk_socket_mem = construct_dpdk_socket_mem(); - - struct dpdk_exclusive_options_map { - const char *category; - const char *ovs_dpdk_options[MAX_DPDK_EXCL_OPTS]; - const char *eal_dpdk_options[MAX_DPDK_EXCL_OPTS]; - const char *default_value; - int default_option; - } excl_opts[] = { - {"memory type", - {"dpdk-alloc-mem", "dpdk-socket-mem", NULL,}, - {"-m", "--socket-mem", NULL,}, - default_dpdk_socket_mem, 1 - }, - }; - - int i; - for (i = 0; i < ARRAY_SIZE(excl_opts); ++i) { - int found_opts = 0, scan, found_pos = -1; - const char *found_value; - struct dpdk_exclusive_options_map *popt = &excl_opts[i]; - - for (scan = 0; scan < MAX_DPDK_EXCL_OPTS - && popt->ovs_dpdk_options[scan]; ++scan) { - const char *value = smap_get(ovs_other_config, - popt->ovs_dpdk_options[scan]); - if (value && strlen(value)) { - found_opts++; - found_pos = scan; - found_value = value; - } - } - - if (!found_opts) { - if (popt->default_option) { - found_pos = popt->default_option; - found_value = popt->default_value; - } else { - continue; - } - } - - if (found_opts > 1) { - VLOG_ERR("Multiple defined options for %s. Please check your" - " database settings and reconfigure if necessary.", - popt->category); - } - - if (!args_contains(args, popt->eal_dpdk_options[found_pos])) { - svec_add(args, popt->eal_dpdk_options[found_pos]); - svec_add(args, found_value); - } else { - VLOG_WARN("Ignoring database defined option '%s' due to " - "dpdk-extra config", popt->eal_dpdk_options[found_pos]); - } - } - - free(default_dpdk_socket_mem); -} - -static void -construct_dpdk_args(const struct smap *ovs_other_config, struct svec *args) -{ - const char *extra_configuration = smap_get(ovs_other_config, "dpdk-extra"); - - if (extra_configuration) { - svec_parse_words(args, extra_configuration); - } - - construct_dpdk_options(ovs_other_config, args); - construct_dpdk_mutex_options(ovs_other_config, args); } static ssize_t @@ -305,7 +169,6 @@ dpdk_init__(const struct smap *ovs_other_config) char **argv = NULL; int result; bool auto_determine = true; - bool deprecated_found; int err = 0; cpu_set_t cpuset; const char *dpdk_options; @@ -353,15 +216,13 @@ dpdk_init__(const struct smap *ovs_other_config) VLOG_INFO("Per port memory for DPDK devices %s.", per_port_memory ? "enabled" : "disabled"); + report_unsupported_configs(ovs_other_config); + svec_add(&args, ovs_get_program_name()); dpdk_options = smap_get(ovs_other_config, "dpdk-options"); - deprecated_found = report_deprecated_configs(ovs_other_config, - dpdk_options ? true : false); if (dpdk_options) { svec_parse_words(&args, dpdk_options); - } else if (deprecated_found) { - construct_dpdk_args(ovs_other_config, &args); } if (!args_contains(&args, "--legacy-mem")