get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 68597,
    "url": "http://patches.dpdk.org/api/patches/68597/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1587004928-328077-7-git-send-email-suanmingm@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": "<1587004928-328077-7-git-send-email-suanmingm@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1587004928-328077-7-git-send-email-suanmingm@mellanox.com",
    "date": "2020-04-16T02:42:04",
    "name": "[v2,06/10] net/mlx5: convert tag resource to indexed",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "62d6dd7103c303fd3139f3cd5544f8a4be8e2dde",
    "submitter": {
        "id": 1358,
        "url": "http://patches.dpdk.org/api/people/1358/?format=api",
        "name": "Suanming Mou",
        "email": "suanmingm@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/1587004928-328077-7-git-send-email-suanmingm@mellanox.com/mbox/",
    "series": [
        {
            "id": 9407,
            "url": "http://patches.dpdk.org/api/series/9407/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=9407",
            "date": "2020-04-16T02:41:58",
            "name": "net/mlx5: optimize flow resource allocation",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/9407/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/68597/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/68597/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 180E8A0588;\n\tThu, 16 Apr 2020 04:43:17 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 741D91DA03;\n\tThu, 16 Apr 2020 04:42:31 +0200 (CEST)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id C50381D9D1\n for <dev@dpdk.org>; Thu, 16 Apr 2020 04:42:25 +0200 (CEST)"
        ],
        "From": "Suanming Mou <suanmingm@mellanox.com>",
        "To": "viacheslavo@mellanox.com,\n\tmatan@mellanox.com",
        "Cc": "rasland@mellanox.com,\n\tdev@dpdk.org",
        "Date": "Thu, 16 Apr 2020 10:42:04 +0800",
        "Message-Id": "<1587004928-328077-7-git-send-email-suanmingm@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1587004928-328077-1-git-send-email-suanmingm@mellanox.com>",
        "References": "<1586740309-449310-1-git-send-email-suanmingm@mellanox.com>\n <1587004928-328077-1-git-send-email-suanmingm@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v2 06/10] net/mlx5: convert tag resource to\n\tindexed",
        "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 tag resource to indexed.\n\nAs tag resources are add in the hash list, to avoid introduce performance\nissue and keep the hash list, only the tag resource memory is allocated\nfrom indexed memory. The resources is still added to the hash list. Add\nfour bytes index in the tag resource struct and change the tag resources\nin the flow handle from pointer to uint32_t seems be no benefit for tag\nresource, but it saves memory for flows without tag action. And also for\nsub flows share one tag action resource.\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    |  7 +++++--\n drivers/net/mlx5/mlx5_flow_dv.c | 27 +++++++++++++++++----------\n 4 files changed, 34 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 6a8d8f4..e18e801 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -221,6 +221,17 @@ struct mlx5_dev_spawn_data {\n \t\t.free = rte_free,\n \t\t.type = \"mlx5_push_vlan_ipool\",\n \t},\n+\t{\n+\t\t.size = sizeof(struct mlx5_flow_dv_tag_resource),\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_tag_ipool\",\n+\t},\n };\n \n \ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 86cf8ad..59ba9e2 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -47,6 +47,7 @@\n enum mlx5_ipool_index {\n \tMLX5_IPOOL_DECAP_ENCAP = 0, /* Pool for encap/decap resource. */\n \tMLX5_IPOOL_PUSH_VLAN, /* Pool for push vlan resource. */\n+\tMLX5_IPOOL_TAG, /* Pool for tag resource. */\n \tMLX5_IPOOL_MAX,\n };\n \ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 46fdab0..8f9f5e6 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -383,6 +383,7 @@ struct mlx5_flow_dv_tag_resource {\n \tvoid *action;\n \t/**< Verbs tag action object. */\n \trte_atomic32_t refcnt; /**< Reference counter. */\n+\tuint32_t idx; /**< Index for the index memory pool. */\n };\n \n /*\n@@ -494,8 +495,8 @@ struct mlx5_flow_handle_dv {\n \t/**< Structure for VF VLAN workaround. */\n \tuint32_t push_vlan_res;\n \t/**< Index to push VLAN action resource in cache. */\n-\tstruct mlx5_flow_dv_tag_resource *tag_resource;\n-\t/**< pointer to the tag action. */\n+\tuint32_t tag_resource;\n+\t/**< Index to the tag action. */\n };\n \n /** Device flow handle structure: used both for creating & destroying. */\n@@ -547,6 +548,8 @@ struct mlx5_flow_dv_workspace {\n \t/**< Pointer to encap/decap resource in cache. */\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_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 8688cab..5aa624d 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -7092,14 +7092,16 @@ struct field_modify_info modify_tcp[] = {\n \t\tcache_resource = container_of\n \t\t\t(entry, struct mlx5_flow_dv_tag_resource, entry);\n \t\trte_atomic32_inc(&cache_resource->refcnt);\n-\t\tdev_flow->handle->dvh.tag_resource = cache_resource;\n+\t\tdev_flow->handle->dvh.tag_resource = cache_resource->idx;\n+\t\tdev_flow->dv.tag_resource = cache_resource;\n \t\tDRV_LOG(DEBUG, \"cached tag resource %p: refcnt now %d++\",\n \t\t\t(void *)cache_resource,\n \t\t\trte_atomic32_read(&cache_resource->refcnt));\n \t\treturn 0;\n \t}\n \t/* Register new resource. */\n-\tcache_resource = rte_calloc(__func__, 1, sizeof(*cache_resource), 0);\n+\tcache_resource = mlx5_ipool_zmalloc(sh->ipool[MLX5_IPOOL_TAG],\n+\t\t\t\t       &dev_flow->handle->dvh.tag_resource);\n \tif (!cache_resource)\n \t\treturn rte_flow_error_set(error, ENOMEM,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n@@ -7121,7 +7123,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n \t\t\t\t\t  NULL, \"cannot insert tag\");\n \t}\n-\tdev_flow->handle->dvh.tag_resource = cache_resource;\n+\tdev_flow->dv.tag_resource = cache_resource;\n \tDRV_LOG(DEBUG, \"new tag resource %p: refcnt now %d++\",\n \t\t(void *)cache_resource,\n \t\trte_atomic32_read(&cache_resource->refcnt));\n@@ -7133,20 +7135,23 @@ struct field_modify_info modify_tcp[] = {\n  *\n  * @param dev\n  *   Pointer to Ethernet device.\n- * @param flow\n- *   Pointer to mlx5_flow.\n+ * @param tag_idx\n+ *   Tag index.\n  *\n  * @return\n  *   1 while a reference on it exists, 0 when freed.\n  */\n static int\n flow_dv_tag_release(struct rte_eth_dev *dev,\n-\t\t    struct mlx5_flow_dv_tag_resource *tag)\n+\t\t    uint32_t tag_idx)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct mlx5_ibv_shared *sh = priv->sh;\n+\tstruct mlx5_flow_dv_tag_resource *tag;\n \n-\tMLX5_ASSERT(tag);\n+\ttag = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_TAG], tag_idx);\n+\tif (!tag)\n+\t\treturn 0;\n \tDRV_LOG(DEBUG, \"port %u tag %p: refcnt %d--\",\n \t\tdev->data->port_id, (void *)tag,\n \t\trte_atomic32_read(&tag->refcnt));\n@@ -7155,7 +7160,7 @@ struct field_modify_info modify_tcp[] = {\n \t\tmlx5_hlist_remove(sh->tag_table, &tag->entry);\n \t\tDRV_LOG(DEBUG, \"port %u tag %p: removed\",\n \t\t\tdev->data->port_id, (void *)tag);\n-\t\trte_free(tag);\n+\t\tmlx5_ipool_free(priv->sh->ipool[MLX5_IPOOL_TAG], tag_idx);\n \t\treturn 0;\n \t}\n \treturn 1;\n@@ -7452,8 +7457,9 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tif (flow_dv_tag_resource_register(dev, tag_be,\n \t\t\t\t\t\t\t  dev_flow, error))\n \t\t\t\treturn -rte_errno;\n+\t\t\tMLX5_ASSERT(dev_flow->dv.tag_resource);\n \t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\t\thandle->dvh.tag_resource->action;\n+\t\t\t\t\tdev_flow->dv.tag_resource->action;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_MARK:\n \t\t\taction_flags |= MLX5_FLOW_ACTION_MARK;\n@@ -7479,8 +7485,9 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tif (flow_dv_tag_resource_register(dev, tag_be,\n \t\t\t\t\t\t\t  dev_flow, error))\n \t\t\t\treturn -rte_errno;\n+\t\t\tMLX5_ASSERT(dev_flow->dv.tag_resource);\n \t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\t\thandle->dvh.tag_resource->action;\n+\t\t\t\t\tdev_flow->dv.tag_resource->action;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_SET_META:\n \t\t\tif (flow_dv_convert_action_set_meta\n",
    "prefixes": [
        "v2",
        "06/10"
    ]
}