get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74287,
    "url": "http://patches.dpdk.org/api/patches/74287/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1594969911-105341-6-git-send-email-bingz@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": "<1594969911-105341-6-git-send-email-bingz@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1594969911-105341-6-git-send-email-bingz@mellanox.com",
    "date": "2020-07-17T07:11:49",
    "name": "[v4,5/7] net/mlx5: create and destroy eCPRI flex parser",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ee19fea76da71815855d1b5ac8d0a2af81a47314",
    "submitter": {
        "id": 1357,
        "url": "http://patches.dpdk.org/api/people/1357/?format=api",
        "name": "Bing Zhao",
        "email": "bingz@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/1594969911-105341-6-git-send-email-bingz@mellanox.com/mbox/",
    "series": [
        {
            "id": 11119,
            "url": "http://patches.dpdk.org/api/series/11119/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11119",
            "date": "2020-07-17T07:11:44",
            "name": "add eCPRI support in mlx5 driver",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/11119/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74287/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/74287/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 3B35AA0528;\n\tFri, 17 Jul 2020 09:12:52 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0977F1BF7B;\n\tFri, 17 Jul 2020 09:12:15 +0200 (CEST)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id 7BF021BF6D\n for <dev@dpdk.org>; Fri, 17 Jul 2020 09:12:08 +0200 (CEST)"
        ],
        "From": "Bing Zhao <bingz@mellanox.com>",
        "To": "orika@mellanox.com,\n\tviacheslavo@mellanox.com",
        "Cc": "rasland@mellanox.com, matan@mellanox.com, dev@dpdk.org,\n netanelg@mellanox.com",
        "Date": "Fri, 17 Jul 2020 15:11:49 +0800",
        "Message-Id": "<1594969911-105341-6-git-send-email-bingz@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1594969911-105341-1-git-send-email-bingz@mellanox.com>",
        "References": "<1594909426-64843-1-git-send-email-bingz@mellanox.com>\n <1594969911-105341-1-git-send-email-bingz@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v4 5/7] net/mlx5: create and destroy eCPRI flex\n\tparser",
        "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": "eCPRI protocol has unified format layout for the variants, over\nETH layer (including .1Q) and UDP layer.\n\nThe common header of the message has 4 bytes fixed length, and the\nmessage payload layers are different based on the type field. Now\nonly type #0, #2 and #5 will be supported, and 2 bytes are needed.\n\nWhen creating the flex parser, the header will be extended to 8\nbytes and 2 DW samples are needed. The 1st DW starts from offset 0\nand will be used for the type field of the common header. The 2nd\nDW starts from offset 4 and will be used for the physical channel\nID, real-time control ID or measurement ID fields.\n\nThe parser will be created once a flow with eCPRI item is observed\nfor the first time. After creating, it will remain in the system\nand HW until the device is stopped. Right now, there is no need to\ndestroy the eCPRI flex parser after the last flow with eCPRI item\nis destroyed. This is to get rid of the alternate states of creating\nand destroying eCPRI flex parser with a single eCPRI flow.\n\nSigned-off-by: Bing Zhao <bingz@mellanox.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/net/mlx5/mlx5.c         | 64 ++++++++++++++++++++++++++++++++++++++++-\n drivers/net/mlx5/mlx5.h         |  1 +\n drivers/net/mlx5/mlx5_flow_dv.c |  3 +-\n 3 files changed, 66 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 1ba5e0c..8fcb78a 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -643,11 +643,71 @@ struct mlx5_flow_id_pool *\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct mlx5_flex_parser_profiles *prf =\n \t\t\t\t&priv->sh->fp[MLX5_FLEX_PARSER_ECPRI_0];\n+\tstruct mlx5_devx_graph_node_attr node = {\n+\t\t.modify_field_select = 0,\n+\t};\n+\tuint32_t ids[8];\n+\tint ret;\n \n-\t(void)prf;\n+\tnode.header_length_mode = MLX5_GRAPH_NODE_LEN_FIXED;\n+\t/* 8 bytes now: 4B common header + 4B message body header. */\n+\tnode.header_length_base_value = 0x8;\n+\t/* After MAC layer: Ether / VLAN. */\n+\tnode.in[0].arc_parse_graph_node = MLX5_GRAPH_ARC_NODE_MAC;\n+\t/* Type of compared condition should be 0xAEFE in the L2 layer. */\n+\tnode.in[0].compare_condition_value = RTE_ETHER_TYPE_ECPRI;\n+\t/* Sample #0: type in common header. */\n+\tnode.sample[0].flow_match_sample_en = 1;\n+\t/* Fixed offset. */\n+\tnode.sample[0].flow_match_sample_offset_mode = 0x0;\n+\t/* Only the 2nd byte will be used. */\n+\tnode.sample[0].flow_match_sample_field_base_offset = 0x0;\n+\t/* Sample #1: message payload. */\n+\tnode.sample[1].flow_match_sample_en = 1;\n+\t/* Fixed offset. */\n+\tnode.sample[1].flow_match_sample_offset_mode = 0x0;\n+\t/*\n+\t * Only the first two bytes will be used right now, and its offset will\n+\t * start after the common header that with the length of a DW(u32).\n+\t */\n+\tnode.sample[1].flow_match_sample_field_base_offset = sizeof(uint32_t);\n+\tprf->obj = mlx5_devx_cmd_create_flex_parser(priv->sh->ctx, &node);\n+\tif (!prf->obj) {\n+\t\tDRV_LOG(ERR, \"Failed to create flex parser node object.\");\n+\t\treturn (rte_errno == 0) ? -ENODEV : -rte_errno;\n+\t}\n+\tprf->num = 2;\n+\tret = mlx5_devx_cmd_query_parse_samples(prf->obj, ids, prf->num);\n+\tif (ret) {\n+\t\tDRV_LOG(ERR, \"Failed to query sample IDs.\");\n+\t\treturn (rte_errno == 0) ? -ENODEV : -rte_errno;\n+\t}\n+\tprf->offset[0] = 0x0;\n+\tprf->offset[1] = sizeof(uint32_t);\n+\tprf->ids[0] = ids[0];\n+\tprf->ids[1] = ids[1];\n \treturn 0;\n }\n \n+/*\n+ * Destroy the flex parser node, including the parser itself, input / output\n+ * arcs and DW samples. Resources could be reused then.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ */\n+static void\n+mlx5_flex_parser_ecpri_release(struct rte_eth_dev *dev)\n+{\n+\tstruct mlx5_priv *priv = dev->data->dev_private;\n+\tstruct mlx5_flex_parser_profiles *prf =\n+\t\t\t\t&priv->sh->fp[MLX5_FLEX_PARSER_ECPRI_0];\n+\n+\tif (prf->obj)\n+\t\tmlx5_devx_cmd_destroy(prf->obj);\n+\tprf->obj = NULL;\n+}\n+\n /**\n  * Allocate shared device context. If there is multiport device the\n  * master and representors will share this context, if there is single\n@@ -1231,6 +1291,8 @@ struct mlx5_dev_ctx_shared *\n \trte_wmb();\n \t/* Disable datapath on secondary process. */\n \tmlx5_mp_req_stop_rxtx(dev);\n+\t/* Free the eCPRI flex parser resource. */\n+\tmlx5_flex_parser_ecpri_release(dev);\n \tif (priv->rxqs != NULL) {\n \t\t/* XXX race condition if mlx5_rx_burst() is still running. */\n \t\tusleep(1000);\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 61abe4a..2e61d0c 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -1025,6 +1025,7 @@ int mlx5_os_read_dev_stat(struct mlx5_priv *priv,\n void mlx5_os_stats_init(struct rte_eth_dev *dev);\n void mlx5_os_set_reg_mr_cb(mlx5_reg_mr_t *reg_mr_cb,\n \t\t\t   mlx5_dereg_mr_t *dereg_mr_cb);\n+\n /* mlx5_txpp.c */\n \n int mlx5_txpp_start(struct rte_eth_dev *dev);\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex cd2b0f0..ceb585d 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -8662,10 +8662,11 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_ECPRI:\n \t\t\tif (!mlx5_flex_parser_ecpri_exist(dev)) {\n+\t\t\t\t/* Create it only the first time to be used. */\n \t\t\t\tret = mlx5_flex_parser_ecpri_alloc(dev);\n \t\t\t\tif (ret)\n \t\t\t\t\treturn rte_flow_error_set\n-\t\t\t\t\t\t(error, ret,\n+\t\t\t\t\t\t(error, -ret,\n \t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n \t\t\t\t\t\tNULL,\n \t\t\t\t\t\t\"cannot create eCPRI parser\");\n",
    "prefixes": [
        "v4",
        "5/7"
    ]
}