Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/7705/?format=api
https://patches.dpdk.org/api/patches/7705/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/08bc213ebb41b3b3b714c7aa9e0a53b79e674dbf.1444996480.git.pmatilai@redhat.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<08bc213ebb41b3b3b714c7aa9e0a53b79e674dbf.1444996480.git.pmatilai@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/08bc213ebb41b3b3b714c7aa9e0a53b79e674dbf.1444996480.git.pmatilai@redhat.com", "date": "2015-10-16T11:58:15", "name": "[dpdk-dev,3/5] eal: move plugin loading to eal/common", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1cea5c1746e6fa5d5546ab80d57c55c1c867f4d3", "submitter": { "id": 169, "url": "https://patches.dpdk.org/api/people/169/?format=api", "name": "Panu Matilainen", "email": "pmatilai@redhat.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/08bc213ebb41b3b3b714c7aa9e0a53b79e674dbf.1444996480.git.pmatilai@redhat.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/7705/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/7705/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 775178E8F;\n\tFri, 16 Oct 2015 13:58:33 +0200 (CEST)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id A21168DA1\n\tfor <dev@dpdk.org>; Fri, 16 Oct 2015 13:58:29 +0200 (CEST)", "from int-mx13.intmail.prod.int.phx2.redhat.com\n\t(int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26])\n\tby mx1.redhat.com (Postfix) with ESMTPS id 2A1C591746;\n\tFri, 16 Oct 2015 11:58:29 +0000 (UTC)", "from dhcp195.koti.laiskiainen.org.com (vpn1-6-41.ams2.redhat.com\n\t[10.36.6.41])\n\tby int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with\n\tESMTP id t9GBwMXN015206; Fri, 16 Oct 2015 07:58:27 -0400" ], "From": "Panu Matilainen <pmatilai@redhat.com>", "To": "dev@dpdk.org", "Date": "Fri, 16 Oct 2015 14:58:15 +0300", "Message-Id": "<08bc213ebb41b3b3b714c7aa9e0a53b79e674dbf.1444996480.git.pmatilai@redhat.com>", "In-Reply-To": [ "<cover.1444996152.git.pmatilai@redhat.com>", "<e18b068e2e25a82fb1d321a4bd4f32d41c6d83e6.1444996480.git.pmatilai@redhat.com>" ], "References": [ "<cover.1443181743.git.pmatilai@redhat.com>\n\t<cover.1444996152.git.pmatilai@redhat.com>", "<e18b068e2e25a82fb1d321a4bd4f32d41c6d83e6.1444996480.git.pmatilai@redhat.com>" ], "X-Scanned-By": "MIMEDefang 2.68 on 10.5.11.26", "Subject": "[dpdk-dev] [PATCH 3/5] eal: move plugin loading to eal/common", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "There's no good reason to limit plugins to Linux, make it available\non FreeBSD too.\n\nSigned-off-by: Panu Matilainen <pmatilai@redhat.com>\n---\n lib/librte_eal/bsdapp/eal/eal.c | 2 ++\n lib/librte_eal/common/eal_common_options.c | 52 +++++++++++++++++++++++++++++\n lib/librte_eal/common/eal_options.h | 1 +\n lib/librte_eal/linuxapp/eal/eal.c | 53 ------------------------------\n 4 files changed, 55 insertions(+), 53 deletions(-)", "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c\nindex 1b6f705..73dab89 100644\n--- a/lib/librte_eal/bsdapp/eal/eal.c\n+++ b/lib/librte_eal/bsdapp/eal/eal.c\n@@ -543,6 +543,8 @@ rte_eal_init(int argc, char **argv)\n \n \trte_eal_mcfg_complete();\n \n+\teal_plugins_init();\n+\n \teal_thread_init_master(rte_config.master_lcore);\n \n \tret = eal_thread_dump_affinity(cpuset, RTE_CPU_AFFINITY_STR_LEN);\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 1f459ac..f8fc68a 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -39,6 +39,7 @@\n #include <limits.h>\n #include <errno.h>\n #include <getopt.h>\n+#include <dlfcn.h>\n \n #include <rte_eal.h>\n #include <rte_log.h>\n@@ -93,6 +94,20 @@ eal_long_options[] = {\n \t{0, 0, NULL, 0 }\n };\n \n+TAILQ_HEAD(shared_driver_list, shared_driver);\n+\n+/* Definition for shared object drivers. */\n+struct shared_driver {\n+\tTAILQ_ENTRY(shared_driver) next;\n+\n+\tchar name[PATH_MAX];\n+\tvoid* lib_handle;\n+};\n+\n+/* List of external loadable drivers */\n+static struct shared_driver_list solib_list =\n+TAILQ_HEAD_INITIALIZER(solib_list);\n+\n static int lcores_parsed;\n static int master_lcore_parsed;\n static int mem_parsed;\n@@ -134,6 +149,37 @@ eal_reset_internal_config(struct internal_config *internal_cfg)\n \tinternal_cfg->create_uio_dev = 0;\n }\n \n+static int\n+eal_plugin_add(const char *path)\n+{\n+\tstruct shared_driver *solib;\n+\n+\tsolib = malloc(sizeof(*solib));\n+\tif (solib == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"malloc(solib) failed\\n\");\n+\t\treturn -1;\n+\t}\n+\tmemset(solib, 0, sizeof(*solib));\n+\tstrncpy(solib->name, path, PATH_MAX-1);\n+\tsolib->name[PATH_MAX-1] = 0;\n+\tTAILQ_INSERT_TAIL(&solib_list, solib, next);\n+\n+\treturn 0;\n+}\n+\n+void\n+eal_plugins_init(void)\n+{\n+\tstruct shared_driver *solib = NULL;\n+\n+\tTAILQ_FOREACH(solib, &solib_list, next) {\n+\t\tRTE_LOG(DEBUG, EAL, \"open shared lib %s\\n\", solib->name);\n+\t\tsolib->lib_handle = dlopen(solib->name, RTLD_NOW);\n+\t\tif (solib->lib_handle == NULL)\n+\t\t\tRTE_LOG(WARNING, EAL, \"%s\\n\", dlerror());\n+\t}\n+}\n+\n /*\n * Parse the coremask given as argument (hexadecimal string) and fill\n * the global configuration (core role and core count) with the parsed\n@@ -716,6 +762,11 @@ eal_parse_common_option(int opt, const char *optarg,\n \t\t * even if info or warning messages are disabled */\n \t\tRTE_LOG(CRIT, EAL, \"RTE Version: '%s'\\n\", rte_version());\n \t\tbreak;\n+\t/* force loading of external driver */\n+\tcase 'd':\n+\t\tif (eal_plugin_add(optarg) == -1)\n+\t\t\treturn -1;\n+\t\tbreak;\n \n \t/* long options */\n \tcase OPT_NO_HUGE_NUM:\n@@ -902,6 +953,7 @@ eal_common_usage(void)\n \t \" --\"OPT_PROC_TYPE\" Type of this process (primary|secondary|auto)\\n\"\n \t \" --\"OPT_SYSLOG\" Set syslog facility\\n\"\n \t \" --\"OPT_LOG_LEVEL\" Set default log level\\n\"\n+\t \" -d LIB.so Add driver (can be used multiple times)\\n\"\n \t \" -v Display version information on startup\\n\"\n \t \" -h, --help This help\\n\"\n \t \"\\nEAL options for DEBUG use only:\\n\"\ndiff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h\nindex f6714d9..1f96825 100644\n--- a/lib/librte_eal/common/eal_options.h\n+++ b/lib/librte_eal/common/eal_options.h\n@@ -93,5 +93,6 @@ int eal_adjust_config(struct internal_config *internal_cfg);\n int eal_check_common_options(struct internal_config *internal_cfg);\n void eal_common_usage(void);\n enum rte_proc_type_t eal_proc_type_detect(void);\n+void eal_plugins_init(void);\n \n #endif /* EAL_OPTIONS_H */\ndiff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex d8a53e4..455243e 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -43,7 +43,6 @@\n #include <getopt.h>\n #include <sys/file.h>\n #include <fcntl.h>\n-#include <dlfcn.h>\n #include <stddef.h>\n #include <errno.h>\n #include <limits.h>\n@@ -90,20 +89,6 @@\n /* Allow the application to print its usage message too if set */\n static rte_usage_hook_t\trte_application_usage_hook = NULL;\n \n-TAILQ_HEAD(shared_driver_list, shared_driver);\n-\n-/* Definition for shared object drivers. */\n-struct shared_driver {\n-\tTAILQ_ENTRY(shared_driver) next;\n-\n-\tchar name[PATH_MAX];\n-\tvoid* lib_handle;\n-};\n-\n-/* List of external loadable drivers */\n-static struct shared_driver_list solib_list =\n-TAILQ_HEAD_INITIALIZER(solib_list);\n-\n /* early configuration structure, when memory config is not mmapped */\n static struct rte_mem_config early_mem_config;\n \n@@ -350,7 +335,6 @@ eal_usage(const char *prgname)\n \tprintf(\"\\nUsage: %s \", prgname);\n \teal_common_usage();\n \tprintf(\"EAL Linux options:\\n\"\n-\t \" -d LIB.so Add driver (can be used multiple times)\\n\"\n \t \" --\"OPT_SOCKET_MEM\" Memory to allocate on sockets (comma separated values)\\n\"\n \t \" --\"OPT_HUGE_DIR\" Directory where hugetlbfs is mounted\\n\"\n \t \" --\"OPT_FILE_PREFIX\" Prefix for hugepage filenames\\n\"\n@@ -530,37 +514,6 @@ eal_log_level_parse(int argc, char **argv)\n \toptind = 0; /* reset getopt lib */\n }\n \n-static int\n-eal_plugin_add(const char *path)\n-{\n-\tstruct shared_driver *solib;\n-\n-\tsolib = malloc(sizeof(*solib));\n-\tif (solib == NULL) {\n-\t\tRTE_LOG(ERR, EAL, \"malloc(solib) failed\\n\");\n-\t\treturn -1;\n-\t}\n-\tmemset(solib, 0, sizeof(*solib));\n-\tstrncpy(solib->name, path, PATH_MAX-1);\n-\tsolib->name[PATH_MAX-1] = 0;\n-\tTAILQ_INSERT_TAIL(&solib_list, solib, next);\n-\n-\treturn 0;\n-}\n-\n-static void\n-eal_plugins_init(void)\n-{\n-\tstruct shared_driver *solib = NULL;\n-\n-\tTAILQ_FOREACH(solib, &solib_list, next) {\n-\t\tRTE_LOG(DEBUG, EAL, \"open shared lib %s\\n\", solib->name);\n-\t\tsolib->lib_handle = dlopen(solib->name, RTLD_NOW);\n-\t\tif (solib->lib_handle == NULL)\n-\t\t\tRTE_LOG(WARNING, EAL, \"%s\\n\", dlerror());\n-\t}\n-}\n-\n /* Parse the argument given in the command line of the application */\n static int\n eal_parse_args(int argc, char **argv)\n@@ -598,12 +551,6 @@ eal_parse_args(int argc, char **argv)\n \t\t\teal_usage(prgname);\n \t\t\texit(EXIT_SUCCESS);\n \n-\t\t/* force loading of external driver */\n-\t\tcase 'd':\n-\t\t\tif (eal_plugin_add(optarg) == -1)\n-\t\t\t\treturn -1;\n-\t\t\tbreak;\n-\n \t\t/* long options */\n \t\tcase OPT_XEN_DOM0_NUM:\n #ifdef RTE_LIBRTE_XEN_DOM0\n", "prefixes": [ "dpdk-dev", "3/5" ] }{ "id": 7705, "url": "