get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 85834,
    "url": "https://patches.dpdk.org/api/patches/85834/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201228123302.3608-28-talshn@nvidia.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20201228123302.3608-28-talshn@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201228123302.3608-28-talshn@nvidia.com",
    "date": "2020-12-28T12:32:54",
    "name": "[v2,27/35] net/mlx5/windows: create flow rule",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "22448204b8527b8136330f665169ed9a0579af0f",
    "submitter": {
        "id": 1893,
        "url": "https://patches.dpdk.org/api/people/1893/?format=api",
        "name": "Tal Shnaiderman",
        "email": "talshn@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "https://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20201228123302.3608-28-talshn@nvidia.com/mbox/",
    "series": [
        {
            "id": 14482,
            "url": "https://patches.dpdk.org/api/series/14482/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14482",
            "date": "2020-12-28T12:32:28",
            "name": "mlx5 Windows support - part #6",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/14482/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/85834/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/85834/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 C969BA09FF;\n\tMon, 28 Dec 2020 13:42:23 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8B7E0CBCD;\n\tMon, 28 Dec 2020 13:34:18 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 8F73CCA60\n for <dev@dpdk.org>; Mon, 28 Dec 2020 13:33:37 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n talshn@nvidia.com) with SMTP; 28 Dec 2020 14:33:35 +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 0BSCXWng001295;\n Mon, 28 Dec 2020 14:33:34 +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 14:32:54 +0200",
        "Message-Id": "<20201228123302.3608-28-talshn@nvidia.com>",
        "X-Mailer": "git-send-email 2.16.1.windows.4",
        "In-Reply-To": "<20201228123302.3608-1-talshn@nvidia.com>",
        "References": "<20201217173037.11396-2-talshn@nvidia.com>\n <20201228123302.3608-1-talshn@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH v2 27/35] net/mlx5/windows: create flow rule",
        "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": "From: Ophir Munk <ophirmu@nvidia.com>\n\nThis commit implements mlx5_flow_os_create_flow() API. It is equivalent\nto Linux rdma-core implementation. The API receives the matcher mask,\nmatcher value and an array of actions. They are copied into a PRM-like\nstruct devx_fs_rule_add_in. Then glue API devx_fs_rule_add() is called.\n\nSigned-off-by: Ophir Munk <ophirmu@nvidia.com>\nAcked-by: Matan Azrad <matan@nvidia.com>\n---\n drivers/common/mlx5/mlx5_prm.h          |  6 +++++\n drivers/net/mlx5/windows/mlx5_flow_os.c | 46 ++++++++++++++++++++++++++-------\n 2 files changed, 42 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h\nindex ac42238d30..8c9b53ce10 100644\n--- a/drivers/common/mlx5/mlx5_prm.h\n+++ b/drivers/common/mlx5/mlx5_prm.h\n@@ -825,6 +825,12 @@ struct mlx5_ifc_fte_match_param_bits {\n #endif\n };\n \n+struct mlx5_ifc_dest_format_struct_bits {\n+\tu8 destination_type[0x8];\n+\tu8 destination_id[0x18];\n+\tu8 reserved_0[0x20];\n+};\n+\n enum {\n \tMLX5_MATCH_CRITERIA_ENABLE_OUTER_BIT,\n \tMLX5_MATCH_CRITERIA_ENABLE_MISC_BIT,\ndiff --git a/drivers/net/mlx5/windows/mlx5_flow_os.c b/drivers/net/mlx5/windows/mlx5_flow_os.c\nindex 0c0fba3720..daf4e15ddb 100644\n--- a/drivers/net/mlx5/windows/mlx5_flow_os.c\n+++ b/drivers/net/mlx5/windows/mlx5_flow_os.c\n@@ -187,13 +187,41 @@ mlx5_flow_os_create_flow(void *matcher, void *match_value,\n \t\t\t size_t num_actions,\n \t\t\t void *actions[], void **flow)\n {\n-\tRTE_SET_USED(matcher);\n-\tRTE_SET_USED(match_value);\n-\tRTE_SET_USED(num_actions);\n-\tRTE_SET_USED(actions);\n-\t*flow = NULL;\n-\trte_errno = ENOTSUP;\n-\treturn -rte_errno;\n+\tstruct mlx5_action *action;\n+\tint i;\n+\tstruct mlx5_matcher *mlx5_matcher = matcher;\n+\tstruct mlx5_flow_dv_match_params *mlx5_match_value = match_value;\n+\tuint32_t in[MLX5_ST_SZ_DW(devx_fs_rule_add_in)] = {0};\n+\tvoid *matcher_c = MLX5_ADDR_OF(devx_fs_rule_add_in, in,\n+\t\t\t\t       match_criteria);\n+\tvoid *matcher_v = MLX5_ADDR_OF(devx_fs_rule_add_in, in,\n+\t\t\t\t       match_value);\n+\n+\tMLX5_ASSERT(mlx5_matcher->ctx);\n+\tmemcpy(matcher_c, mlx5_matcher->match_buf,\n+\t       mlx5_match_value->size);\n+\t/* Use mlx5_match_value->size for match criteria */\n+\tmemcpy(matcher_v, mlx5_match_value->buf,\n+\t       mlx5_match_value->size);\n+\tfor (i = 0; i < num_actions; i++) {\n+\t\taction = actions[i];\n+\t\tswitch (action->type) {\n+\t\tcase MLX5_FLOW_CONTEXT_DEST_TYPE_TIR:\n+\t\t\tMLX5_SET(devx_fs_rule_add_in, in,\n+\t\t\t\t dest.destination_type,\n+\t\t\t\t MLX5_FLOW_CONTEXT_DEST_TYPE_TIR);\n+\t\t\tMLX5_SET(devx_fs_rule_add_in, in,\n+\t\t\t\t dest.destination_id,\n+\t\t\t\t action->dest_tir.id);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\t\tMLX5_SET(devx_fs_rule_add_in, in, match_criteria_enable,\n+\t\t\t MLX5_MATCH_OUTER_HEADERS);\n+\t}\n+\t*flow = mlx5_glue->devx_fs_rule_add(mlx5_matcher->ctx, in, sizeof(in));\n+\treturn (*flow) ? 0 : -1;\n }\n \n /**\n@@ -208,7 +236,5 @@ mlx5_flow_os_create_flow(void *matcher, void *match_value,\n int\n mlx5_flow_os_destroy_flow(void *drv_flow_ptr)\n {\n-\tRTE_SET_USED(dev_flow_ptr);\n-\trte_errno = ENOTSUP;\n-\treturn -rte_errno;\n+\treturn mlx5_glue->devx_fs_rule_del(drv_flow_ptr);\n }\n",
    "prefixes": [
        "v2",
        "27/35"
    ]
}