get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52767,
    "url": "http://patches.dpdk.org/api/patches/52767/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1555276357-4892-6-git-send-email-orika@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": "<1555276357-4892-6-git-send-email-orika@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1555276357-4892-6-git-send-email-orika@mellanox.com",
    "date": "2019-04-14T21:12:33",
    "name": "[5/9] net/mlx5: add port ID item to Direct Verbs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b8e51d558d264604ad133fe7fecd9381631a350f",
    "submitter": {
        "id": 795,
        "url": "http://patches.dpdk.org/api/people/795/?format=api",
        "name": "Ori Kam",
        "email": "orika@mellanox.com"
    },
    "delegate": {
        "id": 6624,
        "url": "http://patches.dpdk.org/api/users/6624/?format=api",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1555276357-4892-6-git-send-email-orika@mellanox.com/mbox/",
    "series": [
        {
            "id": 4308,
            "url": "http://patches.dpdk.org/api/series/4308/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4308",
            "date": "2019-04-14T21:12:28",
            "name": "net/mlx5: add Direct Verbs E-Switch support",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4308/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52767/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/52767/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 2E51A5F2A;\n\tSun, 14 Apr 2019 23:13:28 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id 07B2B5B38\n\tfor <dev@dpdk.org>; Sun, 14 Apr 2019 23:13:08 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\torika@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 15 Apr 2019 00:13:02 +0300",
            "from pegasus03.mtr.labs.mlnx (pegasus03.mtr.labs.mlnx\n\t[10.210.16.124])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x3ELD10p027116;\n\tMon, 15 Apr 2019 00:13:02 +0300"
        ],
        "From": "Ori Kam <orika@mellanox.com>",
        "To": "yskoh@mellanox.com, shahafs@mellanox.com, matan@mellanox.com,\n\tviacheslavo@mellanox.com, motih@mellanox.com",
        "Cc": "dev@dpdk.org, orika@mellanox.com",
        "Date": "Sun, 14 Apr 2019 21:12:33 +0000",
        "Message-Id": "<1555276357-4892-6-git-send-email-orika@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1555276357-4892-1-git-send-email-orika@mellanox.com>",
        "References": "<1555276357-4892-1-git-send-email-orika@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 5/9] net/mlx5: add port ID item to Direct Verbs",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Adds the port ID item to the DV steering code.\n\nSigned-off-by: Ori Kam <orika@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow_dv.c | 86 ++++++++++++++++++++++++++++++-----------\n 1 file changed, 63 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex fedc6cb..e66ee34 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -3095,6 +3095,64 @@ struct field_modify_info modify_tcp[] = {\n \t}\n }\n \n+/**\n+ * Add source vport match to the specified matcher.\n+ *\n+ * @param[in, out] matcher\n+ *   Flow matcher.\n+ * @param[in, out] key\n+ *   Flow matcher value.\n+ * @param[in] port\n+ *   Source vport value to match\n+ * @param[in] mask\n+ *   Mask\n+ */\n+static void\n+flow_dv_translate_item_source_vport(void *matcher, void *key,\n+\t\t\t\t    int16_t port, uint16_t mask)\n+{\n+\tvoid *misc_m = MLX5_ADDR_OF(fte_match_param, matcher, misc_parameters);\n+\tvoid *misc_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters);\n+\n+\tMLX5_SET(fte_match_set_misc, misc_m, source_port, mask);\n+\tMLX5_SET(fte_match_set_misc, misc_v, source_port, port);\n+}\n+\n+/**\n+ * Translate port-id item to eswitch match on  port-id.\n+ *\n+ * @param[in] dev\n+ *   The devich to configure through.\n+ * @param[in, out] matcher\n+ *   Flow matcher.\n+ * @param[in, out] key\n+ *   Flow matcher value.\n+ * @param[in] item\n+ *   Flow pattern to translate.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise.\n+ */\n+static int\n+flow_dv_eswitch_translate_item_port_id(struct rte_eth_dev *dev,\n+\t\t\t\t       void *matcher, void *key,\n+\t\t\t\t       const struct rte_flow_item *item)\n+{\n+\tconst struct rte_flow_item_port_id *pid_m = item ? item->mask : NULL;\n+\tconst struct rte_flow_item_port_id *pid_v = item ? item->spec : NULL;\n+\tuint16_t mask, val, id;\n+\tint ret;\n+\n+\tmask = pid_m ? pid_m->id : 0xffff;\n+\tid = pid_v ? pid_v->id : dev->data->port_id;\n+\tid = mask ? id : dev->data->port_id;\n+\tret = mlx5_port_to_eswitch_info(id, NULL, &val);\n+\tif (ret)\n+\t\treturn ret;\n+\tflow_dv_translate_item_source_vport(matcher, key, val, mask);\n+\treturn 0;\n+}\n+\n static uint32_t matcher_zero[MLX5_ST_SZ_DW(fte_match_param)] = { 0 };\n \n #define HEADER_IS_ZERO(match_criteria, headers)\t\t\t\t     \\\n@@ -3305,29 +3363,6 @@ struct field_modify_info modify_tcp[] = {\n }\n \n /**\n- * Add source vport match to the specified matcher.\n- *\n- * @param[in, out] matcher\n- *   Flow matcher.\n- * @param[in, out] key\n- *   Flow matcher value.\n- * @param[in] port\n- *   Source vport value to match\n- * @param[in] mask\n- *   Mask\n- */\n-static void\n-flow_dv_translate_item_source_vport(void *matcher, void *key,\n-\t\t\t\t    int16_t port, uint16_t mask)\n-{\n-\tvoid *misc_m = MLX5_ADDR_OF(fte_match_param, matcher, misc_parameters);\n-\tvoid *misc_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters);\n-\n-\tMLX5_SET(fte_match_set_misc, misc_m, source_port, mask);\n-\tMLX5_SET(fte_match_set_misc, misc_v, source_port, port);\n-}\n-\n-/**\n  * Find existing tag resource or create and register a new one.\n  *\n  * @param dev[in, out]\n@@ -3733,6 +3768,11 @@ struct field_modify_info modify_tcp[] = {\n \t\tvoid *match_value = dev_flow->dv.value.buf;\n \n \t\tswitch (items->type) {\n+\t\tcase RTE_FLOW_ITEM_TYPE_PORT_ID:\n+\t\t\tflow_dv_eswitch_translate_item_port_id\n+\t\t\t\t\t(dev, match_mask, match_value, items);\n+\t\t\tlast_item = MLX5_FLOW_ITEM_PORT_ID;\n+\t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_ETH:\n \t\t\tflow_dv_translate_item_eth(match_mask, match_value,\n \t\t\t\t\t\t   items, tunnel);\n",
    "prefixes": [
        "5/9"
    ]
}