get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74240,
    "url": "http://patches.dpdk.org/api/patches/74240/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1594907399-63329-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": "<1594907399-63329-6-git-send-email-bingz@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1594907399-63329-6-git-send-email-bingz@mellanox.com",
    "date": "2020-07-16T13:49:57",
    "name": "[v2,5/7] net/mlx5: create and destroy eCPRI flex parser",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2daf80552fe0ad149a142724bc5b01e586662380",
    "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/1594907399-63329-6-git-send-email-bingz@mellanox.com/mbox/",
    "series": [
        {
            "id": 11096,
            "url": "http://patches.dpdk.org/api/series/11096/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11096",
            "date": "2020-07-16T13:49:52",
            "name": "add eCPRI support in mlx5 driver",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/11096/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74240/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/74240/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 CE355A054B;\n\tThu, 16 Jul 2020 15:51:26 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4B1881D5ED;\n\tThu, 16 Jul 2020 15:50:25 +0200 (CEST)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id B07E81D5E1\n for <dev@dpdk.org>; Thu, 16 Jul 2020 15:50:21 +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": "Thu, 16 Jul 2020 21:49:57 +0800",
        "Message-Id": "<1594907399-63329-6-git-send-email-bingz@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1594907399-63329-1-git-send-email-bingz@mellanox.com>",
        "References": "<1594219387-240274-1-git-send-email-bingz@mellanox.com>\n <1594907399-63329-1-git-send-email-bingz@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v2 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>\n---\n drivers/net/mlx5/mlx5.c         | 55 ++++++++++++++++++++++++++++++++++++++---\n drivers/net/mlx5/mlx5.h         |  1 +\n drivers/net/mlx5/mlx5_flow_dv.c |  3 ++-\n 3 files changed, 55 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex daa9467..aec0173 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -630,8 +630,49 @@ mlx5_flex_parser_ecpri_alloc(struct rte_eth_dev *dev)\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@@ -643,9 +684,15 @@ mlx5_flex_parser_ecpri_alloc(struct rte_eth_dev *dev)\n  *   Pointer to Ethernet device structure.\n  */\n static void\n-flow_dv_flex_parser_ecpri_release(struct rte_eth_dev *dev)\n+mlx5_flex_parser_ecpri_release(struct rte_eth_dev *dev)\n {\n-\t(void)dev;\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@@ -1209,6 +1256,8 @@ mlx5_dev_close(struct rte_eth_dev *dev)\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 c1b30be..42a8bd5 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -959,4 +959,5 @@ int mlx5_os_get_stats_n(struct rte_eth_dev *dev);\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 #endif /* RTE_PMD_MLX5_H_ */\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 @@ __flow_dv_translate(struct rte_eth_dev *dev,\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": [
        "v2",
        "5/7"
    ]
}