get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 68234,
    "url": "https://patches.dpdk.org/api/patches/68234/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1586740309-449310-9-git-send-email-suanmingm@mellanox.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": "<1586740309-449310-9-git-send-email-suanmingm@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1586740309-449310-9-git-send-email-suanmingm@mellanox.com",
    "date": "2020-04-13T01:11:47",
    "name": "[08/10] net/mlx5: convert jump resource to indexed",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8ab23c2e4fc479cde1e4021ac20b62fe6f9c6286",
    "submitter": {
        "id": 1358,
        "url": "https://patches.dpdk.org/api/people/1358/?format=api",
        "name": "Suanming Mou",
        "email": "suanmingm@mellanox.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/1586740309-449310-9-git-send-email-suanmingm@mellanox.com/mbox/",
    "series": [
        {
            "id": 9321,
            "url": "https://patches.dpdk.org/api/series/9321/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=9321",
            "date": "2020-04-13T01:11:39",
            "name": "net/mlx5: optimize flow resource allocation",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/9321/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/68234/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/68234/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 A4018A0577;\n\tMon, 13 Apr 2020 03:13:16 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id AB7701BF9D;\n\tMon, 13 Apr 2020 03:12:12 +0200 (CEST)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id EA8661BF46\n for <dev@dpdk.org>; Mon, 13 Apr 2020 03:12:10 +0200 (CEST)"
        ],
        "From": "Suanming Mou <suanmingm@mellanox.com>",
        "To": "Matan Azrad <matan@mellanox.com>, Shahaf Shuler <shahafs@mellanox.com>,\n Viacheslav Ovsiienko <viacheslavo@mellanox.com>",
        "Cc": "rasland@mellanox.com,\n\tdev@dpdk.org",
        "Date": "Mon, 13 Apr 2020 09:11:47 +0800",
        "Message-Id": "<1586740309-449310-9-git-send-email-suanmingm@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1586740309-449310-1-git-send-email-suanmingm@mellanox.com>",
        "References": "<1586740309-449310-1-git-send-email-suanmingm@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 08/10] net/mlx5: convert jump resource to indexed",
        "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": "This commit convert jump resource to indexed.\n\nThe table data struct is allocated from indexed memory. As it is add in\nthe hash list, the pointer is still used for hash list search. The index\nis added to the table struct, and the pointer in flow handle is decrease\nto uint32_t type. For flow without jump flows, it saves 4 bytes memory.\n\nSigned-off-by: Suanming Mou <suanmingm@mellanox.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/net/mlx5/mlx5.c         | 11 +++++++++++\n drivers/net/mlx5/mlx5.h         |  1 +\n drivers/net/mlx5/mlx5_flow.h    | 11 +++++++----\n drivers/net/mlx5/mlx5_flow_dv.c | 29 ++++++++++++++++++-----------\n 4 files changed, 37 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 4477755..9a66ed5 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -239,6 +239,17 @@ struct mlx5_dev_spawn_data {\n \t\t.free = rte_free,\n \t\t.type = \"mlx5_port_id_ipool\",\n \t},\n+\t{\n+\t\t.size = sizeof(struct mlx5_flow_tbl_data_entry),\n+\t\t.trunk_size = 64,\n+\t\t.grow_trunk = 3,\n+\t\t.grow_shift = 2,\n+\t\t.need_lock = 0,\n+\t\t.release_mem_en = 1,\n+\t\t.malloc = rte_malloc_socket,\n+\t\t.free = rte_free,\n+\t\t.type = \"mlx5_jump_ipool\",\n+\t},\n };\n \n \ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 5f38587..2a05c09 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -56,6 +56,7 @@ enum mlx5_ipool_index {\n \tMLX5_IPOOL_PUSH_VLAN, /* Pool for push vlan resource. */\n \tMLX5_IPOOL_TAG, /* Pool for tag resource. */\n \tMLX5_IPOOL_PORT_ID, /* Pool for port id resource. */\n+\tMLX5_IPOOL_JUMP, /* Pool for jump resource. */\n \tMLX5_IPOOL_MAX,\n };\n \ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 5cd9d67..ce7e929 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -463,6 +463,7 @@ struct mlx5_flow_tbl_data_entry {\n \t/**< matchers' header associated with the flow table. */\n \tstruct mlx5_flow_dv_jump_tbl_resource jump;\n \t/**< jump resource, at most one for each table created. */\n+\tuint32_t idx; /**< index for the indexed mempool. */\n };\n \n /* Verbs specification header. */\n@@ -487,10 +488,10 @@ struct mlx5_flow_handle_dv {\n \t/**< Index to encap/decap resource in cache. */\n \tstruct mlx5_flow_dv_modify_hdr_resource *modify_hdr;\n \t/**< Pointer to modify header resource in cache. */\n-\tstruct mlx5_flow_dv_jump_tbl_resource *jump;\n-\t/**< Pointer to the jump action resource. */\n+\tuint32_t jump;\n+\t/**< Index to the jump action resource. */\n \tuint32_t port_id_action;\n-\t/**< Pointer to port ID action resource. */\n+\t/**< Index to port ID action resource. */\n \tstruct mlx5_vf_vlan vf_vlan;\n \t/**< Structure for VF VLAN workaround. */\n \tuint32_t push_vlan_res;\n@@ -549,9 +550,11 @@ struct mlx5_flow_dv_workspace {\n \tstruct mlx5_flow_dv_push_vlan_action_resource *push_vlan_res;\n \t/**< Pointer to push VLAN action resource in cache. */\n \tstruct mlx5_flow_dv_tag_resource *tag_resource;\n+\t/**< pointer to the tag action. */\n \tstruct mlx5_flow_dv_port_id_action_resource *port_id_action;\n \t/**< Pointer to port ID action resource. */\n-\t/**< pointer to the tag action. */\n+\tstruct mlx5_flow_dv_jump_tbl_resource *jump;\n+\t/**< Pointer to the jump action resource. */\n \tstruct mlx5_flow_dv_match_params value;\n \t/**< Holds the value that the packet is compared to. */\n };\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 49c0a6d..9fe0446 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -2540,7 +2540,8 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t(void *)&tbl_data->jump, cnt);\n \t}\n \trte_atomic32_inc(&tbl_data->jump.refcnt);\n-\tdev_flow->handle->dvh.jump = &tbl_data->jump;\n+\tdev_flow->handle->dvh.jump = tbl_data->idx;\n+\tdev_flow->dv.jump = &tbl_data->jump;\n \treturn 0;\n }\n \n@@ -6856,6 +6857,7 @@ struct field_modify_info modify_tcp[] = {\n \tstruct mlx5_hlist_entry *pos = mlx5_hlist_lookup(sh->flow_tbls,\n \t\t\t\t\t\t\t table_key.v64);\n \tstruct mlx5_flow_tbl_data_entry *tbl_data;\n+\tuint32_t idx = 0;\n \tint ret;\n \tvoid *domain;\n \n@@ -6866,7 +6868,7 @@ struct field_modify_info modify_tcp[] = {\n \t\trte_atomic32_inc(&tbl->refcnt);\n \t\treturn tbl;\n \t}\n-\ttbl_data = rte_zmalloc(NULL, sizeof(*tbl_data), 0);\n+\ttbl_data = mlx5_ipool_zmalloc(sh->ipool[MLX5_IPOOL_JUMP], &idx);\n \tif (!tbl_data) {\n \t\trte_flow_error_set(error, ENOMEM,\n \t\t\t\t   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n@@ -6874,6 +6876,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t   \"cannot allocate flow table data entry\");\n \t\treturn NULL;\n \t}\n+\ttbl_data->idx = idx;\n \ttbl = &tbl_data->tbl;\n \tpos = &tbl_data->entry;\n \tif (transfer)\n@@ -6887,7 +6890,7 @@ struct field_modify_info modify_tcp[] = {\n \t\trte_flow_error_set(error, ENOMEM,\n \t\t\t\t   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n \t\t\t\t   NULL, \"cannot create flow table object\");\n-\t\trte_free(tbl_data);\n+\t\tmlx5_ipool_free(sh->ipool[MLX5_IPOOL_JUMP], idx);\n \t\treturn NULL;\n \t}\n \t/*\n@@ -6904,7 +6907,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n \t\t\t\t   \"cannot insert flow table data entry\");\n \t\tmlx5_glue->dr_destroy_flow_tbl(tbl->obj);\n-\t\trte_free(tbl_data);\n+\t\tmlx5_ipool_free(sh->ipool[MLX5_IPOOL_JUMP], idx);\n \t}\n \trte_atomic32_inc(&tbl->refcnt);\n \treturn tbl;\n@@ -6939,7 +6942,8 @@ struct field_modify_info modify_tcp[] = {\n \t\ttbl->obj = NULL;\n \t\t/* remove the entry from the hash list and free memory. */\n \t\tmlx5_hlist_remove(sh->flow_tbls, pos);\n-\t\trte_free(tbl_data);\n+\t\tmlx5_ipool_free(priv->sh->ipool[MLX5_IPOOL_JUMP],\n+\t\t\t\ttbl_data->idx);\n \t\treturn 0;\n \t}\n \treturn 1;\n@@ -7673,7 +7677,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t\t \"cannot create jump action.\");\n \t\t\t}\n \t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\t\thandle->dvh.jump->action;\n+\t\t\t\t\tdev_flow->dv.jump->action;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_JUMP;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_SET_MAC_SRC:\n@@ -8248,12 +8252,15 @@ struct field_modify_info modify_tcp[] = {\n flow_dv_jump_tbl_resource_release(struct rte_eth_dev *dev,\n \t\t\t\t  struct mlx5_flow_handle *handle)\n {\n-\tstruct mlx5_flow_dv_jump_tbl_resource *cache_resource =\n-\t\t\t\t\t\t\thandle->dvh.jump;\n-\tstruct mlx5_flow_tbl_data_entry *tbl_data =\n-\t\t\tcontainer_of(cache_resource,\n-\t\t\t\t     struct mlx5_flow_tbl_data_entry, jump);\n+\tstruct mlx5_priv *priv = dev->data->dev_private;\n+\tstruct mlx5_flow_dv_jump_tbl_resource *cache_resource;\n+\tstruct mlx5_flow_tbl_data_entry *tbl_data;\n \n+\ttbl_data = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_JUMP],\n+\t\t\t     handle->dvh.jump);\n+\tif (!tbl_data)\n+\t\treturn 0;\n+\tcache_resource = &tbl_data->jump;\n \tMLX5_ASSERT(cache_resource->action);\n \tDRV_LOG(DEBUG, \"jump table resource %p: refcnt %d--\",\n \t\t(void *)cache_resource,\n",
    "prefixes": [
        "08/10"
    ]
}