get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/34899/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 34899,
    "url": "http://patches.dpdk.org/api/patches/34899/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180202164050.13017-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": "<20180202164050.13017-5-adrien.mazarguil@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180202164050.13017-5-adrien.mazarguil@6wind.com",
    "date": "2018-02-02T16:46:18",
    "name": "[dpdk-dev,v2,4/4] net/mlx: make rdma-core glue path configurable",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f7b2c49ea3d419d2add4f66424f03de2fab063f7",
    "submitter": {
        "id": 165,
        "url": "http://patches.dpdk.org/api/people/165/?format=api",
        "name": "Adrien Mazarguil",
        "email": "adrien.mazarguil@6wind.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180202164050.13017-5-adrien.mazarguil@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/34899/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/34899/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 BFAC61B1AA;\n\tFri,  2 Feb 2018 17:46:33 +0100 (CET)",
            "from mail-wr0-f194.google.com (mail-wr0-f194.google.com\n\t[209.85.128.194]) by dpdk.org (Postfix) with ESMTP id A70331B1A2\n\tfor <dev@dpdk.org>; Fri,  2 Feb 2018 17:46:31 +0100 (CET)",
            "by mail-wr0-f194.google.com with SMTP id g21so23120569wrb.13\n\tfor <dev@dpdk.org>; Fri, 02 Feb 2018 08:46:31 -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\t19sm1638515wrx.73.2018.02.02.08.46.30\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 02 Feb 2018 08:46:30 -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=m4Bop6SPV6yyuW9z5uutmdjdLeI2G36dXh4pigaz9fM=;\n\tb=XIfepK5VJceRbJIK6VbZqRt7QiohZsCxWc4G5d7UA/BevgDn5HZckP7NwpvhA5hQDz\n\tUfoSdqkY4o06YdfAmaNV0R14ttieosY0clXVLYnZ1BgX/e6xk1rfdSXS5o1ZRTx2mmaI\n\tdgMbLc2a6EODuqtpFImvWKQZrPS1+lFXWvufwWKdyC1In/rVNlOhTh0t4AI9UCMwmOVM\n\tx5Kn0kb36QjITPmBmdQk0NiANi0dBdCOBM64LECfAwvNI+3VE8AG6DvI1ycuel9iy4h0\n\tkT9OOYbK4ePKlt+obk6dKJBFInb7X5VtFkbvDuIx/U//+S+2c69gbxbJ7rHYfSasiRCx\n\t+H0g==",
        "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=m4Bop6SPV6yyuW9z5uutmdjdLeI2G36dXh4pigaz9fM=;\n\tb=ZMf88lMdzmLoI+XmFs+kYx8GOzr4fzOkHS4ZT3RvHxYX4FynC0WXvdrXJK8QclLuWc\n\tF6FNyoUk9r3hPN3/H6DWjUk6fu+do78h3Us71TgTG8wYCfn9TOjJ9DfO4mowWLCskEdB\n\tKxQZ/a06ckJGcwaotp2Yci55DtsZ9Zsl6dZjGY8+MeGcPZSrcuH60l5ydjYns3roCBFf\n\tj9z3CxdHXt5Yz3d2UnPInfcW/jSiOd4B9lhiy7EwcE+ZKy4tXSI5FH675w56TXXpRiL6\n\trh37q1QO3lqMYu9TKSUe+gcn17YrZzWruDYYPpNXII6MsF8GugJrWMtcnGzWqSByBkCK\n\tforw==",
        "X-Gm-Message-State": "AKwxytcVUC0uGiO5MzrCEjQacTnO6F+xFSUgORqXDXMQpy3yj8wAdMHX\n\tfcLSIEaBKMjo3BWfxq92i+4nyw==",
        "X-Google-Smtp-Source": "AH8x2252tDlSP58lBFJVOThK4HXrZA9SbYzxz0KlUCZrpzkcvwfguSf4UH1ETqvTuiv/PVcBZ9BAvQ==",
        "X-Received": "by 10.223.192.139 with SMTP id\n\td11mr32008559wrf.260.1517589991052; \n\tFri, 02 Feb 2018 08:46:31 -0800 (PST)",
        "Date": "Fri, 2 Feb 2018 17:46:18 +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": "<20180202164050.13017-5-adrien.mazarguil@6wind.com>",
        "References": "<20180202144736.8239-1-adrien.mazarguil@6wind.com>\n\t<20180202164050.13017-1-adrien.mazarguil@6wind.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=us-ascii",
        "Content-Disposition": "inline",
        "In-Reply-To": "<20180202164050.13017-1-adrien.mazarguil@6wind.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "Subject": "[dpdk-dev] [PATCH v2 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..4016ddb7b 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, sizeof(name), \"%.*s%s\" MLX4_GLUE,\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..d1441dcba 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, sizeof(name), \"%.*s%s\" MLX5_GLUE,\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",
        "v2",
        "4/4"
    ]
}