get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 85798,
    "url": "http://patches.dpdk.org/api/patches/85798/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201228095436.14996-26-talshn@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": "<20201228095436.14996-26-talshn@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201228095436.14996-26-talshn@nvidia.com",
    "date": "2020-12-28T09:54:29",
    "name": "[v5,25/32] common/mlx5/windows: add OS alloc/dealloc pd",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c5161aacf82e179001baa460b3d98228bc5c9de8",
    "submitter": {
        "id": 1893,
        "url": "http://patches.dpdk.org/api/people/1893/?format=api",
        "name": "Tal Shnaiderman",
        "email": "talshn@nvidia.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/20201228095436.14996-26-talshn@nvidia.com/mbox/",
    "series": [
        {
            "id": 14480,
            "url": "http://patches.dpdk.org/api/series/14480/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=14480",
            "date": "2020-12-28T09:54:04",
            "name": "mlx5 Windows support - part #5",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/14480/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/85798/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/85798/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 17A6AA09FF;\n\tMon, 28 Dec 2020 11:04:30 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1D123CC54;\n\tMon, 28 Dec 2020 10:55:47 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id E62CCCA45\n for <dev@dpdk.org>; Mon, 28 Dec 2020 10:54:51 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n talshn@nvidia.com) with SMTP; 28 Dec 2020 11:54:46 +0200",
            "from nvidia.com (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0BS9shDq012171;\n Mon, 28 Dec 2020 11:54:45 +0200"
        ],
        "From": "Tal Shnaiderman <talshn@nvidia.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, matan@nvidia.com, rasland@nvidia.com,\n ophirmu@nvidia.com",
        "Date": "Mon, 28 Dec 2020 11:54:29 +0200",
        "Message-Id": "<20201228095436.14996-26-talshn@nvidia.com>",
        "X-Mailer": "git-send-email 2.16.1.windows.4",
        "In-Reply-To": "<20201228095436.14996-1-talshn@nvidia.com>",
        "References": "<20201213205005.7300-2-talshn@nvidia.com>\n <20201228095436.14996-1-talshn@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH v5 25/32] common/mlx5/windows: add OS\n\talloc/dealloc pd",
        "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": "Implement Windows API mlx5_os_alloc_pd() and mlx5_os_dealloc_pd(). They\nare equivalent to the Linux implementation in [1].\n\n[1]\n(\"net/mlx5: wrap glue alloc/dealloc PD with OS calls\")\n\nSigned-off-by: Tal Shnaiderman <talshn@nvidia.com>\nAcked-by: Matan Azrad <matan@nvidia.com>\n---\n drivers/common/mlx5/rte_common_mlx5_exports.def |  3 +-\n drivers/common/mlx5/windows/mlx5_common_os.c    | 48 +++++++++++++++++++++++++\n drivers/common/mlx5/windows/mlx5_common_os.h    |  3 ++\n drivers/common/mlx5/windows/mlx5_win_ext.h      |  6 ++++\n 4 files changed, 59 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/common/mlx5/rte_common_mlx5_exports.def b/drivers/common/mlx5/rte_common_mlx5_exports.def\nindex 2f6aab133b..5db1eaa48c 100644\n--- a/drivers/common/mlx5/rte_common_mlx5_exports.def\n+++ b/drivers/common/mlx5/rte_common_mlx5_exports.def\n@@ -61,4 +61,5 @@ EXPORTS\n \tmlx5_malloc\n \tmlx5_realloc\n \tmlx5_free\n-\n+\tmlx5_os_alloc_pd\n+\tmlx5_os_dealloc_pd\ndiff --git a/drivers/common/mlx5/windows/mlx5_common_os.c b/drivers/common/mlx5/windows/mlx5_common_os.c\nindex 5707fb60c3..85537b6739 100644\n--- a/drivers/common/mlx5/windows/mlx5_common_os.c\n+++ b/drivers/common/mlx5/windows/mlx5_common_os.c\n@@ -22,3 +22,51 @@ void\n mlx5_glue_constructor(void)\n {\n }\n+\n+/**\n+ * Allocate PD. Given a devx context object\n+ * return an mlx5-pd object.\n+ *\n+ * @param[in] ctx\n+ *   Pointer to context.\n+ *\n+ * @return\n+ *    The mlx5_pd if pd is valid, NULL and errno otherwise.\n+ */\n+void *\n+mlx5_os_alloc_pd(void *ctx)\n+{\n+\tstruct mlx5_pd *ppd =  mlx5_malloc(MLX5_MEM_ZERO,\n+\t\tsizeof(struct mlx5_pd), 0, SOCKET_ID_ANY);\n+\tif (!ppd)\n+\t\treturn NULL;\n+\n+\tstruct mlx5_devx_obj *obj = mlx5_devx_cmd_alloc_pd(ctx);\n+\tif (!obj) {\n+\t\tmlx5_free(ppd);\n+\t\treturn NULL;\n+\t}\n+\tppd->obj = obj;\n+\tppd->pdn = obj->id;\n+\tppd->devx_ctx = ctx;\n+\treturn ppd;\n+}\n+\n+/**\n+ * Release PD. Releases a given mlx5_pd object\n+ *\n+ * @param[in] pd\n+ *   Pointer to mlx5_pd.\n+ *\n+ * @return\n+ *    Zero if pd is released successfully, negative number otherwise.\n+ */\n+int\n+mlx5_os_dealloc_pd(void *pd)\n+{\n+\tif (!pd)\n+\t\treturn -EINVAL;\n+\tmlx5_devx_cmd_destroy(((struct mlx5_pd *)pd)->obj);\n+\tmlx5_free(pd);\n+\treturn 0;\n+}\ndiff --git a/drivers/common/mlx5/windows/mlx5_common_os.h b/drivers/common/mlx5/windows/mlx5_common_os.h\nindex 2abdb2c3ae..f47351ec41 100644\n--- a/drivers/common/mlx5/windows/mlx5_common_os.h\n+++ b/drivers/common/mlx5/windows/mlx5_common_os.h\n@@ -139,4 +139,7 @@ mlx5_os_get_umem_id(void *umem)\n \t\treturn 0;\n \treturn ((struct mlx5_devx_umem *)umem)->umem_id;\n }\n+\n+void *mlx5_os_alloc_pd(void *ctx);\n+int mlx5_os_dealloc_pd(void *pd);\n #endif /* RTE_PMD_MLX5_COMMON_OS_H_ */\ndiff --git a/drivers/common/mlx5/windows/mlx5_win_ext.h b/drivers/common/mlx5/windows/mlx5_win_ext.h\nindex 0e74910e9d..8e697b30c1 100644\n--- a/drivers/common/mlx5/windows/mlx5_win_ext.h\n+++ b/drivers/common/mlx5/windows/mlx5_win_ext.h\n@@ -28,6 +28,12 @@ struct mlx5_devx_umem {\n \tuint32_t                umem_id;\n };\n \n+struct mlx5_pd {\n+\tvoid                   *obj;\n+\tuint32_t                pdn;\n+\tdevx_device_ctx        *devx_ctx;\n+};\n+\n #define GET_DEVX_CTX(ctx) (((mlx5_context_st *)ctx)->devx_ctx)\n #define GET_OBJ_CTX(obj)  (((mlx5_devx_obj_st *)obj)->devx_ctx)\n \n",
    "prefixes": [
        "v5",
        "25/32"
    ]
}