Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/34895/?format=api
http://patches.dpdk.org/api/patches/34895/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180202144736.8239-5-adrien.mazarguil@6wind.com/", "project": { "id": 1, "url": "http://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": "<20180202144736.8239-5-adrien.mazarguil@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180202144736.8239-5-adrien.mazarguil@6wind.com", "date": "2018-02-02T15:16:41", "name": "[dpdk-dev,v1,4/4] net/mlx: make rdma-core glue path configurable", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "ddb8c8444e1095fdc93f1695f65508448edc415f", "submitter": { "id": 165, "url": "http://patches.dpdk.org/api/people/165/?format=api", "name": "Adrien Mazarguil", "email": "adrien.mazarguil@6wind.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180202144736.8239-5-adrien.mazarguil@6wind.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/34895/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/34895/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7AA521B1B0;\n\tFri, 2 Feb 2018 16:16:55 +0100 (CET)", "from mail-wm0-f67.google.com (mail-wm0-f67.google.com\n\t[74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 9A6EB1B1AC\n\tfor <dev@dpdk.org>; Fri, 2 Feb 2018 16:16:54 +0100 (CET)", "by mail-wm0-f67.google.com with SMTP id v123so13069638wmd.5\n\tfor <dev@dpdk.org>; Fri, 02 Feb 2018 07:16:54 -0800 (PST)", "from 6wind.com (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\ts26sm1928081eds.49.2018.02.02.07.16.53\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 02 Feb 2018 07:16:53 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to;\n\tbh=5slZr5J+PcyvjnUtJdQdOUeGo49HNfpAxQ8IeWtTyjI=;\n\tb=URySnAeuyqXBfv46rfl+XrvzGn9Hq773VQmYz+3mV4UpKYIvixrsQDwT2sHvyfKQt4\n\tf+OeIM12ZsclBV7ab4rdNUMAVPakHibgD82LrrcLh0BmbIwmj2qss/0rWm3lV4eTZrJD\n\t+OXCFqCXs1cAwYSfyq47tlWMIPkunORsk1HBijtmvNnqvMd8cgAj7fMVpIgaZ6oTD7wP\n\ti9OC8/WHNl0NT2/4SLE7HbpbzFES5LmbDhXZIzie1gm42EwNeiRBYqw8jj1jKtpuSxna\n\tNUAkWFGzbKx0QYz+tw+0VBY6UxKFyVMrGgeR9hGAQY1DrsbNTfOaJLc6XeIjyty9xb0C\n\t9PNg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to;\n\tbh=5slZr5J+PcyvjnUtJdQdOUeGo49HNfpAxQ8IeWtTyjI=;\n\tb=n1+XctN9Rm56UwbR1SfEcea7Jd5mag+EzMRnZcvBR8D+NKaBOTvo5Dl4K77Yl1K+5H\n\tFzmOW534o5mqIzxiWG9GfXz2dpyY5jSFLfWDADD2udhKVevx4YuIXEwj9M5hpG6JnnaH\n\tfc7dug5eAom15sIhKxdZisy+S9dwGnqi7bXZ+WtXLHyn8MbctKa86XhO19BHghedZ/7S\n\tptc87wiRLTzKit4FnZPXEuhYCoBh1qNMbeXDTMQeslgdKdTtDqKWkEMIFQxakD+nHQpF\n\t0Y20wADq03+FYRGRDkaN5+RJLe3uAKwSFm+MOtdkYCcGPktNJh3WQhXeEuXIYmLMavIm\n\taMWw==", "X-Gm-Message-State": "AKwxytcfFL7WCGK1pQwyb9PnL/UpCHCBpMxxYgWuBr47MiR/odu1gH6j\n\tXabFiHVUL6ODjcb4Di1RvkAh1w==", "X-Google-Smtp-Source": "AH8x225yXoIIqzztFNIwFWK7PabZolYvL1fxKzmohKJRqXheEzg/eIvNi0o/e1oO7y9587GVlOCg6w==", "X-Received": "by 10.80.163.199 with SMTP id t7mr21196885edb.56.1517584614271; \n\tFri, 02 Feb 2018 07:16:54 -0800 (PST)", "Date": "Fri, 2 Feb 2018 16:16:41 +0100", "From": "Adrien Mazarguil <adrien.mazarguil@6wind.com>", "To": "Shahaf Shuler <shahafs@mellanox.com>", "Cc": "Nelio Laranjeiro <nelio.laranjeiro@6wind.com>, dev@dpdk.org,\n\tMarcelo Ricardo Leitner <mleitner@redhat.com>", "Message-ID": "<20180202144736.8239-5-adrien.mazarguil@6wind.com>", "References": "<20180202144736.8239-1-adrien.mazarguil@6wind.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=us-ascii", "Content-Disposition": "inline", "In-Reply-To": "<20180202144736.8239-1-adrien.mazarguil@6wind.com>", "X-Mailer": "git-send-email 2.11.0", "Subject": "[dpdk-dev] [PATCH v1 4/4] net/mlx: make rdma-core glue path\n\tconfigurable", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://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": "<https://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": "Since rdma-core glue libraries are intrinsically tied to their respective\nPMDs and used as internal plug-ins, their presence in the default search\npath among other system libraries for the dynamic linker is not necessarily\ndesired.\n\nThis commit enables their installation and subsequent look-up at run time\nin RTE_EAL_PMD_PATH if configured to a nonempty string. This path can also\nbe overridden by environment variables MLX[45]_GLUE_PATH.\n\nSigned-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>\n---\n doc/guides/nics/mlx4.rst | 17 +++++++++++++++++\n doc/guides/nics/mlx5.rst | 14 ++++++++++++++\n drivers/net/mlx4/mlx4.c | 43 ++++++++++++++++++++++++++++++++++++++++++-\n drivers/net/mlx5/mlx5.c | 43 ++++++++++++++++++++++++++++++++++++++++++-\n 4 files changed, 115 insertions(+), 2 deletions(-)", "diff": "diff --git a/doc/guides/nics/mlx4.rst b/doc/guides/nics/mlx4.rst\nindex 88161781c..9e4fbf692 100644\n--- a/doc/guides/nics/mlx4.rst\n+++ b/doc/guides/nics/mlx4.rst\n@@ -97,6 +97,11 @@ These options can be modified in the ``.config`` file.\n ``CONFIG_RTE_BUILD_SHARED_LIB`` disabled) and they won't show up as\n missing with ``ldd(1)``.\n \n+ It works by moving these dependencies to a purpose-built rdma-core \"glue\"\n+ plug-in, which must either be installed in ``CONFIG_RTE_EAL_PMD_PATH`` if\n+ set, or in a standard location for the dynamic linker (e.g. ``/lib``) if\n+ left to the default empty string (``\"\"``).\n+\n This option has no performance impact.\n \n - ``CONFIG_RTE_LIBRTE_MLX4_DEBUG`` (default **n**)\n@@ -113,6 +118,18 @@ These options can be modified in the ``.config`` file.\n \n This value is always 1 for RX queues since they use a single MP.\n \n+Environment variables\n+~~~~~~~~~~~~~~~~~~~~~\n+\n+- ``MLX4_GLUE_PATH``\n+\n+ A list of directories in which to search for the rdma-core \"glue\" plug-in,\n+ separated by colons or semi-colons.\n+\n+ Only matters when compiled with ``CONFIG_RTE_LIBRTE_MLX4_DLOPEN_DEPS``\n+ enabled and most useful when ``CONFIG_RTE_EAL_PMD_PATH`` is also set,\n+ since ``LD_LIBRARY_PATH`` has no effect in this case.\n+\n Run-time configuration\n ~~~~~~~~~~~~~~~~~~~~~~\n \ndiff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst\nindex a9e4bf51a..1635dff2b 100644\n--- a/doc/guides/nics/mlx5.rst\n+++ b/doc/guides/nics/mlx5.rst\n@@ -170,6 +170,11 @@ These options can be modified in the ``.config`` file.\n ``CONFIG_RTE_BUILD_SHARED_LIB`` disabled) and they won't show up as\n missing with ``ldd(1)``.\n \n+ It works by moving these dependencies to a purpose-built rdma-core \"glue\"\n+ plug-in, which must either be installed in ``CONFIG_RTE_EAL_PMD_PATH`` if\n+ set, or in a standard location for the dynamic linker (e.g. ``/lib``) if\n+ left to the default empty string (``\"\"``).\n+\n This option has no performance impact.\n \n - ``CONFIG_RTE_LIBRTE_MLX5_DEBUG`` (default **n**)\n@@ -189,6 +194,15 @@ These options can be modified in the ``.config`` file.\n Environment variables\n ~~~~~~~~~~~~~~~~~~~~~\n \n+- ``MLX5_GLUE_PATH``\n+\n+ A list of directories in which to search for the rdma-core \"glue\" plug-in,\n+ separated by colons or semi-colons.\n+\n+ Only matters when compiled with ``CONFIG_RTE_LIBRTE_MLX5_DLOPEN_DEPS``\n+ enabled and most useful when ``CONFIG_RTE_EAL_PMD_PATH`` is also set,\n+ since ``LD_LIBRARY_PATH`` has no effect in this case.\n+\n - ``MLX5_PMD_ENABLE_PADDING``\n \n Enables HW packet padding in PCI bus transactions.\ndiff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c\nindex 61a852fb9..4266cb1bb 100644\n--- a/drivers/net/mlx4/mlx4.c\n+++ b/drivers/net/mlx4/mlx4.c\n@@ -741,11 +741,52 @@ static struct rte_pci_driver mlx4_driver = {\n static int\n mlx4_glue_init(void)\n {\n+\tconst char *path[] = {\n+\t\t/*\n+\t\t * A basic security check is necessary before trusting\n+\t\t * MLX4_GLUE_PATH, which may override RTE_EAL_PMD_PATH.\n+\t\t */\n+\t\t(geteuid() == getuid() && getegid() == getgid() ?\n+\t\t getenv(\"MLX4_GLUE_PATH\") : NULL),\n+\t\tRTE_EAL_PMD_PATH,\n+\t};\n+\tunsigned int i = 0;\n \tvoid *handle = NULL;\n \tvoid **sym;\n \tconst char *dlmsg;\n \n-\thandle = dlopen(MLX4_GLUE, RTLD_LAZY);\n+\twhile (!handle && i != RTE_DIM(path)) {\n+\t\tconst char *end;\n+\t\tsize_t len;\n+\t\tint ret;\n+\n+\t\tif (!path[i]) {\n+\t\t\t++i;\n+\t\t\tcontinue;\n+\t\t}\n+\t\tend = strpbrk(path[i], \":;\");\n+\t\tif (!end)\n+\t\t\tend = path[i] + strlen(path[i]);\n+\t\tlen = end - path[i];\n+\t\tret = 0;\n+\t\tdo {\n+\t\t\tchar name[ret + 1];\n+\n+\t\t\tret = snprintf(name, ret, \"%.*s%s\" MLX4_GLUE \"\\n\",\n+\t\t\t\t (int)len, path[i],\n+\t\t\t\t (!len || *(end - 1) == '/') ? \"\" : \"/\");\n+\t\t\tif (ret == -1)\n+\t\t\t\tbreak;\n+\t\t\tif (sizeof(name) != (size_t)ret + 1)\n+\t\t\t\tcontinue;\n+\t\t\tDEBUG(\"looking for rdma-core glue as \\\"%s\\\"\", name);\n+\t\t\thandle = dlopen(name, RTLD_LAZY);\n+\t\t\tbreak;\n+\t\t} while (1);\n+\t\tpath[i] = end + 1;\n+\t\tif (!*end)\n+\t\t\t++i;\n+\t}\n \tif (!handle) {\n \t\trte_errno = EINVAL;\n \t\tdlmsg = dlerror();\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 341230d2b..caa60339e 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -1085,11 +1085,52 @@ static struct rte_pci_driver mlx5_driver = {\n static int\n mlx5_glue_init(void)\n {\n+\tconst char *path[] = {\n+\t\t/*\n+\t\t * A basic security check is necessary before trusting\n+\t\t * MLX5_GLUE_PATH, which may override RTE_EAL_PMD_PATH.\n+\t\t */\n+\t\t(geteuid() == getuid() && getegid() == getgid() ?\n+\t\t getenv(\"MLX5_GLUE_PATH\") : NULL),\n+\t\tRTE_EAL_PMD_PATH,\n+\t};\n+\tunsigned int i = 0;\n \tvoid *handle = NULL;\n \tvoid **sym;\n \tconst char *dlmsg;\n \n-\thandle = dlopen(MLX5_GLUE, RTLD_LAZY);\n+\twhile (!handle && i != RTE_DIM(path)) {\n+\t\tconst char *end;\n+\t\tsize_t len;\n+\t\tint ret;\n+\n+\t\tif (!path[i]) {\n+\t\t\t++i;\n+\t\t\tcontinue;\n+\t\t}\n+\t\tend = strpbrk(path[i], \":;\");\n+\t\tif (!end)\n+\t\t\tend = path[i] + strlen(path[i]);\n+\t\tlen = end - path[i];\n+\t\tret = 0;\n+\t\tdo {\n+\t\t\tchar name[ret + 1];\n+\n+\t\t\tret = snprintf(name, ret, \"%.*s%s\" MLX5_GLUE \"\\n\",\n+\t\t\t\t (int)len, path[i],\n+\t\t\t\t (!len || *(end - 1) == '/') ? \"\" : \"/\");\n+\t\t\tif (ret == -1)\n+\t\t\t\tbreak;\n+\t\t\tif (sizeof(name) != (size_t)ret + 1)\n+\t\t\t\tcontinue;\n+\t\t\tDEBUG(\"looking for rdma-core glue as \\\"%s\\\"\", name);\n+\t\t\thandle = dlopen(name, RTLD_LAZY);\n+\t\t\tbreak;\n+\t\t} while (1);\n+\t\tpath[i] = end + 1;\n+\t\tif (!*end)\n+\t\t\t++i;\n+\t}\n \tif (!handle) {\n \t\trte_errno = EINVAL;\n \t\tdlmsg = dlerror();\n", "prefixes": [ "dpdk-dev", "v1", "4/4" ] }{ "id": 34895, "url": "