Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/7188/?format=api
https://patches.dpdk.org/api/patches/7188/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/774b7fb9998c2ff1862a25c92e0d2452678fd4de.1443181743.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": "<774b7fb9998c2ff1862a25c92e0d2452678fd4de.1443181743.git.pmatilai@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/774b7fb9998c2ff1862a25c92e0d2452678fd4de.1443181743.git.pmatilai@redhat.com", "date": "2015-09-25T11:58:27", "name": "[dpdk-dev,2/2] eal: add support for driver directory concept", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "197a7eb949f1f6638576d944cc7349c1a9a8d447", "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/774b7fb9998c2ff1862a25c92e0d2452678fd4de.1443181743.git.pmatilai@redhat.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/7188/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/7188/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 0A48A8E7D;\n\tFri, 25 Sep 2015 13:59:20 +0200 (CEST)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id 00C498E6F\n\tfor <dev@dpdk.org>; Fri, 25 Sep 2015 13:59:13 +0200 (CEST)", "from int-mx09.intmail.prod.int.phx2.redhat.com\n\t(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])\n\tby mx1.redhat.com (Postfix) with ESMTPS id A8E3E2589E;\n\tFri, 25 Sep 2015 11:59:12 +0000 (UTC)", "from dhcp195.koti.laiskiainen.org.com (vpn1-4-213.ams2.redhat.com\n\t[10.36.4.213])\n\tby int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with\n\tESMTP id t8PBx87V021625; Fri, 25 Sep 2015 07:59:11 -0400" ], "From": "Panu Matilainen <pmatilai@redhat.com>", "To": "dev@dpdk.org", "Date": "Fri, 25 Sep 2015 14:58:27 +0300", "Message-Id": "<774b7fb9998c2ff1862a25c92e0d2452678fd4de.1443181743.git.pmatilai@redhat.com>", "In-Reply-To": [ "<cover.1443181743.git.pmatilai@redhat.com>", "<cover.1443181743.git.pmatilai@redhat.com>" ], "References": [ "<cover.1443181743.git.pmatilai@redhat.com>", "<cover.1443181743.git.pmatilai@redhat.com>" ], "X-Scanned-By": "MIMEDefang 2.68 on 10.5.11.22", "Subject": "[dpdk-dev] [PATCH 2/2] eal: add support for driver directory concept", "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": "Add a new EAL option -D for loading all drivers from a given directory.\nAdditionally a default driver directory can be set in build-time\nconfiguration, in which case it will be always be used when EAL is\ninitialized (but can be overridden or disabled with -D).\n\nThis simplifies usage in shared library configuration significantly over\nmanually loading individual drivers with -d, and allows distros to\nestablish a drop-in driver directory for seamless integration\nwith 3rd party drivers etc.\n\nSigned-off-by: Panu Matilainen <pmatilai@redhat.com>\n---\n config/common_linuxapp | 3 ++\n lib/librte_eal/common/eal_common_options.c | 1 +\n lib/librte_eal/linuxapp/eal/eal.c | 48 ++++++++++++++++++++++++++++++\n 3 files changed, 52 insertions(+)", "diff": "diff --git a/config/common_linuxapp b/config/common_linuxapp\nindex 0de43d5..a0d8cd2 100644\n--- a/config/common_linuxapp\n+++ b/config/common_linuxapp\n@@ -111,6 +111,9 @@ CONFIG_RTE_EAL_IGB_UIO=y\n CONFIG_RTE_EAL_VFIO=y\n CONFIG_RTE_MALLOC_DEBUG=n\n \n+# Default driver path (or \"\" to disable)\n+CONFIG_RTE_EAL_PMD_PATH=\"\"\n+\n #\n # Special configurations in PCI Config Space for high performance\n #\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 1f459ac..4dba608 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -58,6 +58,7 @@ eal_short_options[] =\n \t\"b:\" /* pci-blacklist */\n \t\"c:\" /* coremask */\n \t\"d:\" /* driver */\n+\t\"D:\" /* driver directory */\n \t\"h\" /* help */\n \t\"l:\" /* corelist */\n \t\"m:\" /* memory size */\ndiff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex 31f3915..bbb02f0 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -50,6 +50,8 @@\n #include <errno.h>\n #include <sys/mman.h>\n #include <sys/queue.h>\n+#include <sys/types.h>\n+#include <dirent.h>\n #if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686)\n #include <sys/io.h>\n #endif\n@@ -104,6 +106,9 @@ struct shared_driver {\n static struct shared_driver_list solib_list =\n TAILQ_HEAD_INITIALIZER(solib_list);\n \n+/* Path of external loadable drivers */\n+static const char *solib_dir = RTE_EAL_SOLIB_PATH;\n+\n /* early configuration structure, when memory config is not mmapped */\n static struct rte_mem_config early_mem_config;\n \n@@ -351,6 +356,7 @@ eal_usage(const char *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 \" -D DIRECTORY Add driver directory\\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@@ -548,6 +554,40 @@ eal_add_solib(const char *path)\n \treturn 0;\n }\n \n+static int\n+eal_add_solib_dir(const char *path)\n+{\n+\tDIR *d = NULL;\n+\tstruct dirent *dent = NULL;\n+\tchar sopath[PATH_MAX];\n+\n+\tif (path == NULL || *path == '\\0')\n+\t\treturn 0;\n+\n+\td = opendir(path);\n+\tif (d == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"failed to open directory %s: %s\\n\",\n+\t\t\tpath, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\n+\twhile ((dent = readdir(d)) != NULL) {\n+\t\tif (dent->d_type != DT_REG && dent->d_type != DT_LNK)\n+\t\t\tcontinue;\n+\n+\t\tsnprintf(sopath, PATH_MAX-1, \"%s/%s\", path, dent->d_name);\n+\t\tsopath[PATH_MAX-1] = 0;\n+\n+\t\tif (eal_add_solib(sopath) == -1)\n+\t\t\tbreak;\n+\t}\n+\n+\tclosedir(d);\n+\n+\t/* XXX this ignores failures from readdir() itself */\n+\treturn (dent == NULL) ? 0 : -1;\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@@ -591,6 +631,11 @@ eal_parse_args(int argc, char **argv)\n \t\t\t\treturn -1;\n \t\t\tbreak;\n \n+\t\t/* set external driver directory */\n+\t\tcase 'D':\n+\t\t\tsolib_dir = optarg;\n+\t\t\tbreak;\n+\n \t\t/* long options */\n \t\tcase OPT_XEN_DOM0_NUM:\n #ifdef RTE_LIBRTE_XEN_DOM0\n@@ -837,6 +882,9 @@ rte_eal_init(int argc, char **argv)\n \n \trte_eal_mcfg_complete();\n \n+\tif (eal_add_solib_dir(solib_dir) == -1)\n+\t\trte_panic(\"Cannot init plugin directory %s\\n\", solib_dir);\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", "prefixes": [ "dpdk-dev", "2/2" ] }{ "id": 7188, "url": "