get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 90906,
    "url": "http://patches.dpdk.org/api/patches/90906/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210408204849.9543-13-shirik@nvidia.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": "<20210408204849.9543-13-shirik@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210408204849.9543-13-shirik@nvidia.com",
    "date": "2021-04-08T20:48:37",
    "name": "[12/24] common/mlx5: share get ib device match function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e7075e66093ca1dc8a8660659c396fb824e9651c",
    "submitter": {
        "id": 1894,
        "url": "http://patches.dpdk.org/api/people/1894/?format=api",
        "name": "Shiri Kuzin",
        "email": "shirik@nvidia.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210408204849.9543-13-shirik@nvidia.com/mbox/",
    "series": [
        {
            "id": 16215,
            "url": "http://patches.dpdk.org/api/series/16215/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16215",
            "date": "2021-04-08T20:48:25",
            "name": "drivers: introduce mlx5 crypto PMD",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/16215/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/90906/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/90906/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 025E3A0C46;\n\tThu,  8 Apr 2021 22:50:31 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 14148141225;\n\tThu,  8 Apr 2021 22:49:51 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id DC17A141212\n for <dev@dpdk.org>; Thu,  8 Apr 2021 22:49:45 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n shirik@nvidia.com) with SMTP; 8 Apr 2021 23:49:43 +0300",
            "from nvidia.com (c-236-0-60-063.mtl.labs.mlnx [10.236.0.63])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 138KnAJV028067;\n Thu, 8 Apr 2021 23:49:43 +0300"
        ],
        "From": "Shiri Kuzin <shirik@nvidia.com>",
        "To": "dev@dpdk.org",
        "Cc": "matan@nvidia.com, gakhil@marvell.com, suanmingm@nvidia.com",
        "Date": "Thu,  8 Apr 2021 23:48:37 +0300",
        "Message-Id": "<20210408204849.9543-13-shirik@nvidia.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20210408204849.9543-1-shirik@nvidia.com>",
        "References": "<1615447568-260965-1-git-send-email-matan@nvidia.com>\n <20210408204849.9543-1-shirik@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 12/24] common/mlx5: share get ib device match\n function",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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": "The get_ib_device_match function iterates over the list of ib devices\nreturned by the get_device_list glue function and returns the ib device\nmatching the provided address.\n\nSince this function is in use by several drivers, in this patch we\nshare the function in common part.\n\nSigned-off-by: Shiri Kuzin <shirik@nvidia.com>\nAcked-by: Matan Azrad <matan@nvidia.com>\n---\n drivers/common/mlx5/linux/mlx5_common_os.c | 28 +++++++++++++++++++\n drivers/common/mlx5/linux/mlx5_common_os.h |  5 ++++\n drivers/common/mlx5/mlx5_common.h          |  1 +\n drivers/common/mlx5/version.map            |  2 ++\n drivers/compress/mlx5/mlx5_compress.c      | 30 +-------------------\n drivers/regex/mlx5/mlx5_regex.c            | 30 ++------------------\n drivers/vdpa/mlx5/mlx5_vdpa.c              | 32 ++--------------------\n 7 files changed, 41 insertions(+), 87 deletions(-)",
    "diff": "diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c\nindex fba8245b8b..037147fe31 100644\n--- a/drivers/common/mlx5/linux/mlx5_common_os.c\n+++ b/drivers/common/mlx5/linux/mlx5_common_os.c\n@@ -16,6 +16,7 @@\n \n #include \"mlx5_common.h\"\n #include \"mlx5_common_log.h\"\n+#include \"mlx5_common_os.h\"\n #include \"mlx5_glue.h\"\n \n #ifdef MLX5_GLUE\n@@ -423,3 +424,30 @@ mlx5_glue_constructor(void)\n \tmlx5_glue = NULL;\n }\n \n+struct ibv_device *\n+mlx5_os_get_ib_device_match(struct rte_pci_addr *addr)\n+{\n+\tint n;\n+\tstruct ibv_device **ibv_list = mlx5_glue->get_device_list(&n);\n+\tstruct ibv_device *ibv_match = NULL;\n+\n+\tif (ibv_list == NULL) {\n+\t\trte_errno = ENOSYS;\n+\t\treturn NULL;\n+\t}\n+\twhile (n-- > 0) {\n+\t\tstruct rte_pci_addr paddr;\n+\n+\t\tDRV_LOG(DEBUG, \"Checking device \\\"%s\\\"..\", ibv_list[n]->name);\n+\t\tif (mlx5_dev_to_pci_addr(ibv_list[n]->ibdev_path, &paddr) != 0)\n+\t\t\tcontinue;\n+\t\tif (rte_pci_addr_cmp(addr, &paddr) != 0)\n+\t\t\tcontinue;\n+\t\tibv_match = ibv_list[n];\n+\t\tbreak;\n+\t}\n+\tif (ibv_match == NULL)\n+\t\trte_errno = ENOENT;\n+\tmlx5_glue->free_device_list(ibv_list);\n+\treturn ibv_match;\n+}\ndiff --git a/drivers/common/mlx5/linux/mlx5_common_os.h b/drivers/common/mlx5/linux/mlx5_common_os.h\nindex 63f070d9c4..0eb304e0e3 100644\n--- a/drivers/common/mlx5/linux/mlx5_common_os.h\n+++ b/drivers/common/mlx5/linux/mlx5_common_os.h\n@@ -284,4 +284,9 @@ mlx5_os_free(void *addr)\n {\n \tfree(addr);\n }\n+\n+__rte_internal\n+struct ibv_device *\n+mlx5_os_get_ib_device_match(struct rte_pci_addr *addr);\n+\n #endif /* RTE_PMD_MLX5_COMMON_OS_H_ */\ndiff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h\nindex 327374fdcf..f1ff16eb3e 100644\n--- a/drivers/common/mlx5/mlx5_common.h\n+++ b/drivers/common/mlx5/mlx5_common.h\n@@ -17,6 +17,7 @@\n \n #include \"mlx5_prm.h\"\n #include \"mlx5_devx_cmds.h\"\n+#include \"mlx5_common_os.h\"\n \n /* Reported driver name. */\n #define MLX5_PCI_DRIVER_NAME \"mlx5_pci\"\ndiff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map\nindex 5c2cc4dca9..045c0fc6fe 100644\n--- a/drivers/common/mlx5/version.map\n+++ b/drivers/common/mlx5/version.map\n@@ -99,6 +99,8 @@ INTERNAL {\n \tmlx5_nl_vlan_vmwa_create;\n \tmlx5_nl_vlan_vmwa_delete;\n \n+\tmlx5_os_get_ib_device_match;\n+\n \tmlx5_translate_port_name;\n \n \tmlx5_malloc_mem_select;\ndiff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c\nindex ec3c237512..ff988d26ef 100644\n--- a/drivers/compress/mlx5/mlx5_compress.c\n+++ b/drivers/compress/mlx5/mlx5_compress.c\n@@ -647,34 +647,6 @@ mlx5_compress_dequeue_burst(void *queue_pair, struct rte_comp_op **ops,\n \treturn i;\n }\n \n-static struct ibv_device *\n-mlx5_compress_get_ib_device_match(struct rte_pci_addr *addr)\n-{\n-\tint n;\n-\tstruct ibv_device **ibv_list = mlx5_glue->get_device_list(&n);\n-\tstruct ibv_device *ibv_match = NULL;\n-\n-\tif (ibv_list == NULL) {\n-\t\trte_errno = ENOSYS;\n-\t\treturn NULL;\n-\t}\n-\twhile (n-- > 0) {\n-\t\tstruct rte_pci_addr paddr;\n-\n-\t\tDRV_LOG(DEBUG, \"Checking device \\\"%s\\\"..\", ibv_list[n]->name);\n-\t\tif (mlx5_dev_to_pci_addr(ibv_list[n]->ibdev_path, &paddr) != 0)\n-\t\t\tcontinue;\n-\t\tif (rte_pci_addr_cmp(addr, &paddr) != 0)\n-\t\t\tcontinue;\n-\t\tibv_match = ibv_list[n];\n-\t\tbreak;\n-\t}\n-\tif (ibv_match == NULL)\n-\t\trte_errno = ENOENT;\n-\tmlx5_glue->free_device_list(ibv_list);\n-\treturn ibv_match;\n-}\n-\n static void\n mlx5_compress_hw_global_release(struct mlx5_compress_priv *priv)\n {\n@@ -774,7 +746,7 @@ mlx5_compress_pci_probe(struct rte_pci_driver *pci_drv,\n \t\trte_errno = ENOTSUP;\n \t\treturn -rte_errno;\n \t}\n-\tibv = mlx5_compress_get_ib_device_match(&pci_dev->addr);\n+\tibv = mlx5_os_get_ib_device_match(&pci_dev->addr);\n \tif (ibv == NULL) {\n \t\tDRV_LOG(ERR, \"No matching IB device for PCI slot \"\n \t\t\tPCI_PRI_FMT \".\", pci_dev->addr.domain,\ndiff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c\nindex ac5b205fa9..88221186e8 100644\n--- a/drivers/regex/mlx5/mlx5_regex.c\n+++ b/drivers/regex/mlx5/mlx5_regex.c\n@@ -11,6 +11,7 @@\n #include <rte_regexdev_driver.h>\n \n #include <mlx5_common_pci.h>\n+#include <mlx5_common.h>\n #include <mlx5_glue.h>\n #include <mlx5_devx_cmds.h>\n #include <mlx5_prm.h>\n@@ -52,33 +53,6 @@ mlx5_regex_close(struct rte_regexdev *dev __rte_unused)\n \treturn 0;\n }\n \n-static struct ibv_device *\n-mlx5_regex_get_ib_device_match(struct rte_pci_addr *addr)\n-{\n-\tint n;\n-\tstruct ibv_device **ibv_list = mlx5_glue->get_device_list(&n);\n-\tstruct ibv_device *ibv_match = NULL;\n-\n-\tif (!ibv_list) {\n-\t\trte_errno = ENOSYS;\n-\t\treturn NULL;\n-\t}\n-\twhile (n-- > 0) {\n-\t\tstruct rte_pci_addr pci_addr;\n-\n-\t\tDRV_LOG(DEBUG, \"Checking device \\\"%s\\\"..\", ibv_list[n]->name);\n-\t\tif (mlx5_dev_to_pci_addr(ibv_list[n]->ibdev_path, &pci_addr))\n-\t\t\tcontinue;\n-\t\tif (rte_pci_addr_cmp(addr, &pci_addr))\n-\t\t\tcontinue;\n-\t\tibv_match = ibv_list[n];\n-\t\tbreak;\n-\t}\n-\tif (!ibv_match)\n-\t\trte_errno = ENOENT;\n-\tmlx5_glue->free_device_list(ibv_list);\n-\treturn ibv_match;\n-}\n static int\n mlx5_regex_engines_status(struct ibv_context *ctx, int num_engines)\n {\n@@ -121,7 +95,7 @@ mlx5_regex_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \tint ret;\n \tuint32_t val;\n \n-\tibv = mlx5_regex_get_ib_device_match(&pci_dev->addr);\n+\tibv = mlx5_os_get_ib_device_match(&pci_dev->addr);\n \tif (!ibv) {\n \t\tDRV_LOG(ERR, \"No matching IB device for PCI slot \"\n \t\t\tPCI_PRI_FMT \".\", pci_dev->addr.domain,\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c\nindex 619e31d61c..9e5857205d 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa.c\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c\n@@ -472,34 +472,6 @@ static struct rte_vdpa_dev_ops mlx5_vdpa_ops = {\n \t.reset_stats = mlx5_vdpa_reset_stats,\n };\n \n-static struct ibv_device *\n-mlx5_vdpa_get_ib_device_match(struct rte_pci_addr *addr)\n-{\n-\tint n;\n-\tstruct ibv_device **ibv_list = mlx5_glue->get_device_list(&n);\n-\tstruct ibv_device *ibv_match = NULL;\n-\n-\tif (!ibv_list) {\n-\t\trte_errno = ENOSYS;\n-\t\treturn NULL;\n-\t}\n-\twhile (n-- > 0) {\n-\t\tstruct rte_pci_addr pci_addr;\n-\n-\t\tDRV_LOG(DEBUG, \"Checking device \\\"%s\\\"..\", ibv_list[n]->name);\n-\t\tif (mlx5_dev_to_pci_addr(ibv_list[n]->ibdev_path, &pci_addr))\n-\t\t\tcontinue;\n-\t\tif (rte_pci_addr_cmp(addr, &pci_addr))\n-\t\t\tcontinue;\n-\t\tibv_match = ibv_list[n];\n-\t\tbreak;\n-\t}\n-\tif (!ibv_match)\n-\t\trte_errno = ENOENT;\n-\tmlx5_glue->free_device_list(ibv_list);\n-\treturn ibv_match;\n-}\n-\n /* Try to disable ROCE by Netlink\\Devlink. */\n static int\n mlx5_vdpa_nl_roce_disable(const char *addr)\n@@ -595,7 +567,7 @@ mlx5_vdpa_roce_disable(struct rte_pci_addr *addr, struct ibv_device **ibv)\n \t\tstruct ibv_device *ibv_new;\n \n \t\tfor (r = MLX5_VDPA_MAX_RETRIES; r; r--) {\n-\t\t\tibv_new = mlx5_vdpa_get_ib_device_match(addr);\n+\t\t\tibv_new = mlx5_os_get_ib_device_match(addr);\n \t\t\tif (ibv_new) {\n \t\t\t\t*ibv = ibv_new;\n \t\t\t\treturn 0;\n@@ -698,7 +670,7 @@ mlx5_vdpa_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \tstruct mlx5_hca_attr attr;\n \tint ret;\n \n-\tibv = mlx5_vdpa_get_ib_device_match(&pci_dev->addr);\n+\tibv = mlx5_os_get_ib_device_match(&pci_dev->addr);\n \tif (!ibv) {\n \t\tDRV_LOG(ERR, \"No matching IB device for PCI slot \"\n \t\t\tPCI_PRI_FMT \".\", pci_dev->addr.domain,\n",
    "prefixes": [
        "12/24"
    ]
}