get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 65223,
    "url": "http://patches.dpdk.org/api/patches/65223/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1580205965-21492-22-git-send-email-matan@mellanox.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": "<1580205965-21492-22-git-send-email-matan@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1580205965-21492-22-git-send-email-matan@mellanox.com",
    "date": "2020-01-28T10:06:01",
    "name": "[v2,21/25] net/mlx5: select driver by vDPA device argument",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f08818dac3fd2996153137b4302ad21de9612785",
    "submitter": {
        "id": 796,
        "url": "http://patches.dpdk.org/api/people/796/?format=api",
        "name": "Matan Azrad",
        "email": "matan@mellanox.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1580205965-21492-22-git-send-email-matan@mellanox.com/mbox/",
    "series": [
        {
            "id": 8319,
            "url": "http://patches.dpdk.org/api/series/8319/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8319",
            "date": "2020-01-28T10:05:40",
            "name": "Introduce mlx5 common library",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/8319/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/65223/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/65223/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id D1F5BA04B3;\n\tTue, 28 Jan 2020 11:10:34 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 6C7B51C1FD;\n\tTue, 28 Jan 2020 11:09:49 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 236861C1E3\n for <dev@dpdk.org>; Tue, 28 Jan 2020 11:09:48 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE2 (envelope-from\n asafp@mellanox.com)\n with ESMTPS (AES256-SHA encrypted); 28 Jan 2020 12:09:47 +0200",
            "from pegasus07.mtr.labs.mlnx (pegasus07.mtr.labs.mlnx\n [10.210.16.112])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00SA6FpO016102;\n Tue, 28 Jan 2020 12:09:47 +0200"
        ],
        "From": "Matan Azrad <matan@mellanox.com>",
        "To": "dev@dpdk.org, Viacheslav Ovsiienko <viacheslavo@mellanox.com>",
        "Cc": "Raslan Darawsheh <rasland@mellanox.com>",
        "Date": "Tue, 28 Jan 2020 10:06:01 +0000",
        "Message-Id": "<1580205965-21492-22-git-send-email-matan@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1580205965-21492-1-git-send-email-matan@mellanox.com>",
        "References": "<1579539790-3882-1-git-send-email-matan@mellanox.com>\n <1580205965-21492-1-git-send-email-matan@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v2 21/25] net/mlx5: select driver by vDPA device\n\targument",
        "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://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "There might be a case that one Mellanox device can be probed by\nmultiple mlx5 drivers.\n\nOne case is that any mlx5 vDPA device can be probed by bothe net/mlx5\nand vdpa/mlx5.\n\nAdd a new mlx5 common API to get the requested driver by devargs:\nvdpa=1.\n\nSkip net/mlx5 PMD probing while the device is selected to be probed by\nthe vDPA driver.\n\nSigned-off-by: Matan Azrad <matan@mellanox.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/common/mlx5/Makefile                    |  2 +-\n drivers/common/mlx5/meson.build                 |  2 +-\n drivers/common/mlx5/mlx5_common.c               | 36 +++++++++++++++++++++++++\n drivers/common/mlx5/mlx5_common.h               |  3 +++\n drivers/common/mlx5/rte_common_mlx5_version.map |  1 +\n drivers/net/mlx5/mlx5.c                         |  5 ++++\n 6 files changed, 47 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/common/mlx5/Makefile b/drivers/common/mlx5/Makefile\nindex d1de3ec..b9e9803 100644\n--- a/drivers/common/mlx5/Makefile\n+++ b/drivers/common/mlx5/Makefile\n@@ -41,7 +41,7 @@ else\n LDLIBS += -libverbs -lmlx5\n endif\n \n-LDLIBS += -lrte_eal -lrte_pci\n+LDLIBS += -lrte_eal -lrte_pci -lrte_kvargs\n \n # A few warnings cannot be avoided in external headers.\n CFLAGS += -Wno-error=cast-qual -DNDEBUG -UPEDANTIC\ndiff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build\nindex 34de7d1..174c64a 100644\n--- a/drivers/common/mlx5/meson.build\n+++ b/drivers/common/mlx5/meson.build\n@@ -38,7 +38,7 @@ endforeach\n \n if build\n \tallow_experimental_apis = true\n-\tdeps += ['hash', 'pci', 'net', 'eal']\n+\tdeps += ['hash', 'pci', 'net', 'eal', 'kvargs']\n \tsources = files(\n \t\t'mlx5_devx_cmds.c',\n \t\t'mlx5_common.c',\ndiff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c\nindex 9471ff3..c5af3ca 100644\n--- a/drivers/common/mlx5/mlx5_common.c\n+++ b/drivers/common/mlx5/mlx5_common.c\n@@ -71,6 +71,42 @@\n \treturn 0;\n }\n \n+static int\n+mlx5_vdpa_check_handler(__rte_unused const char *key, const char *value,\n+\t\t\t__rte_unused void *opaque)\n+{\n+\tif (strcmp(value, \"1\"))\n+\t\treturn -1;\n+\treturn 0;\n+}\n+\n+int\n+mlx5_vdpa_mode_selected(struct rte_devargs *devargs)\n+{\n+\tstruct rte_kvargs *kvlist;\n+\tconst char *key = \"vdpa\";\n+\tint ret = 0;\n+\n+\tif (devargs == NULL)\n+\t\treturn 0;\n+\n+\tkvlist = rte_kvargs_parse(devargs->args, NULL);\n+\tif (kvlist == NULL)\n+\t\treturn 0;\n+\n+\tif (!rte_kvargs_count(kvlist, key))\n+\t\tgoto exit;\n+\n+\t/* Vdpa mode selected when there's a key-value pair: vdpa=1. */\n+\tif (rte_kvargs_process(kvlist, key, mlx5_vdpa_check_handler, NULL) < 0)\n+\t\tgoto exit;\n+\tret = 1;\n+\n+exit:\n+\trte_kvargs_free(kvlist);\n+\treturn ret;\n+}\n+\n #ifdef RTE_IBVERBS_LINK_DLOPEN\n \n /**\ndiff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h\nindex 9d464d4..aeaa7b9 100644\n--- a/drivers/common/mlx5/mlx5_common.h\n+++ b/drivers/common/mlx5/mlx5_common.h\n@@ -11,6 +11,8 @@\n #include <rte_pci.h>\n #include <rte_atomic.h>\n #include <rte_log.h>\n+#include <rte_kvargs.h>\n+#include <rte_devargs.h>\n \n #include \"mlx5_prm.h\"\n \n@@ -149,5 +151,6 @@ enum mlx5_cqe_status {\n }\n \n int mlx5_dev_to_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr);\n+int mlx5_vdpa_mode_selected(struct rte_devargs *devargs);\n \n #endif /* RTE_PMD_MLX5_COMMON_H_ */\ndiff --git a/drivers/common/mlx5/rte_common_mlx5_version.map b/drivers/common/mlx5/rte_common_mlx5_version.map\nindex 95ca54a..d32d631 100644\n--- a/drivers/common/mlx5/rte_common_mlx5_version.map\n+++ b/drivers/common/mlx5/rte_common_mlx5_version.map\n@@ -26,4 +26,5 @@ DPDK_20.02 {\n \tmlx5_devx_get_out_command_status;\n \n \tmlx5_dev_to_pci_addr;\n+\tmlx5_vdpa_mode_selected;\n };\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex d0fa2da..353196b 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -2967,6 +2967,11 @@ struct mlx5_flow_id_pool *\n \tstruct mlx5_dev_config dev_config;\n \tint ret;\n \n+\tif (mlx5_vdpa_mode_selected(pci_dev->device.devargs)) {\n+\t\tDRV_LOG(DEBUG, \"Skip probing - should be probed by the vdpa\"\n+\t\t\t\" driver.\");\n+\t\treturn 1;\n+\t}\n \tif (rte_eal_process_type() == RTE_PROC_PRIMARY)\n \t\tmlx5_pmd_socket_init();\n \tret = mlx5_init_once();\n",
    "prefixes": [
        "v2",
        "21/25"
    ]
}