From patchwork Wed Aug 30 18:10:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tan, Jianfeng" X-Patchwork-Id: 9930493 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A6B876022E for ; Wed, 30 Aug 2017 18:12:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F1F52874A for ; Wed, 30 Aug 2017 18:12:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93C5B2874E; Wed, 30 Aug 2017 18:12:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E5D302874A for ; Wed, 30 Aug 2017 18:12:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dn7R1-00078O-N2; Wed, 30 Aug 2017 18:09:51 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dn7R0-00076W-EX for xen-devel@lists.xenproject.org; Wed, 30 Aug 2017 18:09:50 +0000 Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id BB/E9-02231-D6FF6A95; Wed, 30 Aug 2017 18:09:49 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRWlGSWpSXmKPExsVywNwkVjfn/7J Ig00Nehbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bNj4UFrxwrtu1/xdbAuN2si5GTQ0hgGqPE xH9cILaEAK/EkWUzWCFsf4lth+8zQdSUS/xtfwYWZxPQlvi0qocdxBYREJD43LmYrYuRi4NZ4 CyjxLflb8ASwgJuEi+7P4E1sAioSmx+94INxOYVcJd4uv4pC8QCOYmb5zqZQWxOAQ+J7rtrmC GWuUvcvreNeQIj7wJGhlWMGsWpRWWpRbrGBnpJRZnpGSW5iZk5uoYGpnq5qcXFiempOYlJxXr J+bmbGIHBUM/AwLiDccIqv0OMkhxMSqK8Fr+WRQrxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4JX+ B5QTLEpNT61Iy8wBhiVMWoKDR0mENwIkzVtckJhbnJkOkTrFqMtxp2/DFyYhlrz8vFQpcd5vf 4GKBECKMkrz4EbAYuQSo6yUMC8jAwODEE9BalFuZgmq/CtGcQ5GJWGIVTyZeSVwm14BHcEEdE Ss11KQI0oSEVJSDYwrbbc+urduzoYlzC2bj6XHzd+y7Xl0kekV3rKXEyKqXjk1Med5zlmmuzn w8meHNy/al4h+nPeh7M0SgycnjsrlTQ3OYPdQ/mZV6uBadeeXlfDPrr86mxd7VFq4NgXdWyh1 zjLqfcncub3GU5YX1E5PuXN6moLA2iUS9z0T5I6EPfygcebk1bPhSizFGYmGWsxFxYkAWZhZW YwCAAA= X-Env-Sender: jianfeng.tan@intel.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1504116581!70786327!4 X-Originating-IP: [192.55.52.93] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDMyNDY2NQ==\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 62715 invoked from network); 30 Aug 2017 18:09:48 -0000 Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 30 Aug 2017 18:09:48 -0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Aug 2017 11:09:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,449,1498546800"; d="scan'208";a="130029481" Received: from dpdk06.sh.intel.com ([10.67.110.196]) by orsmga002.jf.intel.com with ESMTP; 30 Aug 2017 11:09:44 -0700 From: Jianfeng Tan To: dev@dpdk.org Date: Wed, 30 Aug 2017 18:10:31 +0000 Message-Id: <1504116634-115687-4-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504116634-115687-1-git-send-email-jianfeng.tan@intel.com> References: <1504116634-115687-1-git-send-email-jianfeng.tan@intel.com> Cc: jerin.jacob@caviumnetworks.com, shahafs@mellanox.com, john.mcnamara@intel.com, Jianfeng Tan , oao.m.martins@oracle.com, thomas@monjalon.net, xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH 3/6] xen: remove xen dependency in app, examples, test X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jianfeng Tan Acked-by: Bruce Richardson --- app/test-pmd/testpmd.c | 2 +- examples/ip_pipeline/app.h | 4 -- examples/ip_pipeline/config_parse.c | 19 --------- examples/ip_pipeline/init.c | 5 --- examples/kni/main.c | 3 -- test/test/process.h | 10 ----- test/test/test.c | 4 -- test/test/test_eal_flags.c | 81 ------------------------------------- 8 files changed, 1 insertion(+), 127 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index f8d02ae..d9c785c 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -494,7 +494,7 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf, "create a new mbuf pool <%s>: n=%u, size=%u, socket=%u\n", pool_name, nb_mbuf, mbuf_seg_size, socket_id); - /* if the former XEN allocation failed fall back to normal allocation */ + /* if the former allocation failed fall back to normal allocation */ if (rte_mp == NULL) { if (mp_anon != 0) { rte_mp = rte_mempool_create_empty(pool_name, nb_mbuf, diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h index e41290e..94e7a6d 100644 --- a/examples/ip_pipeline/app.h +++ b/examples/ip_pipeline/app.h @@ -428,10 +428,6 @@ struct app_eal_params { /* Interrupt mode for VFIO (legacy|msi|msix) */ char *vfio_intr; - /* Support running on Xen dom0 without hugetlbfs */ - uint32_t xen_dom0_present; - int xen_dom0; - uint32_t parsed; }; diff --git a/examples/ip_pipeline/config_parse.c b/examples/ip_pipeline/config_parse.c index 0b76134..3211c6a 100644 --- a/examples/ip_pipeline/config_parse.c +++ b/examples/ip_pipeline/config_parse.c @@ -809,21 +809,6 @@ parse_eal(struct app_params *app, continue; } - /* xen_dom0 */ - if (strcmp(entry->name, "xen_dom0") == 0) { - int val; - - PARSE_ERROR_DUPLICATE((p->xen_dom0_present == 0), - section_name, - entry->name); - p->xen_dom0_present = 1; - - val = parser_read_arg_bool(entry->value); - PARSE_ERROR((val >= 0), section_name, entry->name); - p->xen_dom0 = val; - continue; - } - /* unrecognized */ PARSE_ERROR_INVALID(0, section_name, entry->name); } @@ -2643,10 +2628,6 @@ save_eal_params(struct app_params *app, FILE *f) if (p->vfio_intr) fprintf(f, "%s = %s\n", "vfio_intr", p->vfio_intr); - if (p->xen_dom0_present) - fprintf(f, "%s = %s\n", "xen_dom0", - (p->xen_dom0) ? "yes" : "no"); - fputc('\n', f); } diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c index 7cde49a..034c238 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -296,11 +296,6 @@ app_init_eal(struct app_params *app) app->eal_argv[n_args++] = strdup(buffer); } - if ((p->xen_dom0_present) && (p->xen_dom0)) { - snprintf(buffer, sizeof(buffer), "--xen-dom0"); - app->eal_argv[n_args++] = strdup(buffer); - } - snprintf(buffer, sizeof(buffer), "--"); app->eal_argv[n_args++] = strdup(buffer); diff --git a/examples/kni/main.c b/examples/kni/main.c index e3bc2fb..9f9d227 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -919,9 +919,6 @@ main(int argc, char** argv) continue; kni_free_kni(port); } -#ifdef RTE_LIBRTE_XEN_DOM0 - rte_kni_close(); -#endif for (i = 0; i < RTE_MAX_ETHPORTS; i++) if (kni_port_params_array[i]) { rte_free(kni_port_params_array[i]); diff --git a/test/test/process.h b/test/test/process.h index 4f8d121..51ced12 100644 --- a/test/test/process.h +++ b/test/test/process.h @@ -52,11 +52,7 @@ static inline int process_dup(const char *const argv[], int numargs, const char *env_value) { int num; -#ifdef RTE_LIBRTE_XEN_DOM0 - char *argv_cpy[numargs + 2]; -#else char *argv_cpy[numargs + 1]; -#endif int i, fd, status; char path[32]; @@ -67,14 +63,8 @@ process_dup(const char *const argv[], int numargs, const char *env_value) /* make a copy of the arguments to be passed to exec */ for (i = 0; i < numargs; i++) argv_cpy[i] = strdup(argv[i]); -#ifdef RTE_LIBRTE_XEN_DOM0 - argv_cpy[i] = strdup("--xen-dom0"); - argv_cpy[i + 1] = NULL; - num = numargs + 1; -#else argv_cpy[i] = NULL; num = numargs; -#endif /* close all open file descriptors, check /proc/self/fd to only * call close on open fds. Exclude fds 0, 1 and 2*/ diff --git a/test/test/test.c b/test/test/test.c index c561eb5..9accbd1 100644 --- a/test/test/test.c +++ b/test/test/test.c @@ -87,11 +87,7 @@ do_recursive_call(void) { "test_invalid_b_flag", no_action }, { "test_invalid_vdev_flag", no_action }, { "test_invalid_r_flag", no_action }, -#ifdef RTE_LIBRTE_XEN_DOM0 - { "test_dom0_misc_flags", no_action }, -#else { "test_misc_flags", no_action }, -#endif { "test_memory_flags", no_action }, { "test_file_prefix", no_action }, { "test_no_huge_flag", no_action }, diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c index 594d79d..310109e 100644 --- a/test/test/test_eal_flags.c +++ b/test/test/test_eal_flags.c @@ -51,11 +51,7 @@ #include "process.h" -#ifdef RTE_LIBRTE_XEN_DOM0 -#define DEFAULT_MEM_SIZE "30" -#else #define DEFAULT_MEM_SIZE "18" -#endif #define mp_flag "--proc-type=secondary" #define no_hpet "--no-hpet" #define no_huge "--no-huge" @@ -809,72 +805,6 @@ test_no_huge_flag(void) return 0; } -#ifdef RTE_LIBRTE_XEN_DOM0 -static int -test_dom0_misc_flags(void) -{ - char prefix[PATH_MAX], tmp[PATH_MAX]; - - if (get_current_prefix(tmp, sizeof(tmp)) == NULL) { - printf("Error - unable to get current prefix!\n"); - return -1; - } - snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp); - - /* check that some general flags don't prevent things from working. - * All cases, apart from the first, app should run. - * No further testing of output done. - */ - /* sanity check - failure with invalid option */ - const char *argv0[] = {prgname, prefix, mp_flag, "-c", "1", "--invalid-opt"}; - - /* With --no-pci */ - const char *argv1[] = {prgname, prefix, mp_flag, "-c", "1", "--no-pci"}; - /* With -v */ - const char *argv2[] = {prgname, prefix, mp_flag, "-c", "1", "-v"}; - /* With valid --syslog */ - const char *argv3[] = {prgname, prefix, mp_flag, "-c", "1", - "--syslog", "syslog"}; - /* With empty --syslog (should fail) */ - const char *argv4[] = {prgname, prefix, mp_flag, "-c", "1", "--syslog"}; - /* With invalid --syslog */ - const char *argv5[] = {prgname, prefix, mp_flag, "-c", "1", "--syslog", "error"}; - /* With no-sh-conf */ - const char *argv6[] = {prgname, "-c", "1", "-n", "2", "-m", "20", - "--no-shconf", "--file-prefix=noshconf" }; - - if (launch_proc(argv0) == 0) { - printf("Error - process ran ok with invalid flag\n"); - return -1; - } - if (launch_proc(argv1) != 0) { - printf("Error - process did not run ok with --no-pci flag\n"); - return -1; - } - if (launch_proc(argv2) != 0) { - printf("Error - process did not run ok with -v flag\n"); - return -1; - } - if (launch_proc(argv3) != 0) { - printf("Error - process did not run ok with --syslog flag\n"); - return -1; - } - if (launch_proc(argv4) == 0) { - printf("Error - process run ok with empty --syslog flag\n"); - return -1; - } - if (launch_proc(argv5) == 0) { - printf("Error - process run ok with invalid --syslog flag\n"); - return -1; - } - if (launch_proc(argv6) != 0) { - printf("Error - process did not run ok with --no-shconf flag\n"); - return -1; - } - - return 0; -} -#else static int test_misc_flags(void) { @@ -1061,7 +991,6 @@ test_misc_flags(void) } return 0; } -#endif static int test_file_prefix(void) @@ -1098,9 +1027,6 @@ test_file_prefix(void) printf("Error - unable to get current prefix!\n"); return -1; } -#ifdef RTE_LIBRTE_XEN_DOM0 - return 0; -#endif /* check if files for current prefix are present */ if (process_hugefiles(prefix, HUGEPAGE_CHECK_EXISTS) != 1) { @@ -1299,9 +1225,6 @@ test_memory_flags(void) printf("Error - process failed with valid -m flag!\n"); return -1; } -#ifdef RTE_LIBRTE_XEN_DOM0 - return 0; -#endif if (launch_proc(argv2) == 0) { printf("Error - process run ok with invalid (zero) --socket-mem!\n"); return -1; @@ -1427,11 +1350,7 @@ test_eal_flags(void) return ret; } -#ifdef RTE_LIBRTE_XEN_DOM0 - ret = test_dom0_misc_flags(); -#else ret = test_misc_flags(); -#endif if (ret < 0) { printf("Error in test_misc_flags()"); return ret;