get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 84715,
    "url": "http://patches.dpdk.org/api/patches/84715/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1606909165-164407-3-git-send-email-suanmingm@nvidia.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": "<1606909165-164407-3-git-send-email-suanmingm@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1606909165-164407-3-git-send-email-suanmingm@nvidia.com",
    "date": "2020-12-02T11:39:25",
    "name": "[2/2] net/mlx5: optimize the hash list entry memory",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2216a32e2af562047a471f629c8eb519d2a897eb",
    "submitter": {
        "id": 1887,
        "url": "http://patches.dpdk.org/api/people/1887/?format=api",
        "name": "Suanming Mou",
        "email": "suanmingm@nvidia.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/1606909165-164407-3-git-send-email-suanmingm@nvidia.com/mbox/",
    "series": [
        {
            "id": 14170,
            "url": "http://patches.dpdk.org/api/series/14170/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=14170",
            "date": "2020-12-02T11:39:23",
            "name": "net/mlx5: hash list optimization",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/14170/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/84715/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/84715/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 9CC5EA04DB;\n\tWed,  2 Dec 2020 12:40:10 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DF6CAC9D4;\n\tWed,  2 Dec 2020 12:39:40 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id BAAB4C9C8\n for <dev@dpdk.org>; Wed,  2 Dec 2020 12:39:37 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n suanmingm@nvidia.com) with SMTP; 2 Dec 2020 13:39:33 +0200",
            "from nvidia.com (mtbc-r640-04.mtbc.labs.mlnx [10.75.70.9])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0B2BdTkW020020;\n Wed, 2 Dec 2020 13:39:32 +0200"
        ],
        "From": "Suanming Mou <suanmingm@nvidia.com>",
        "To": "viacheslavo@nvidia.com, matan@nvidia.com",
        "Cc": "rasland@nvidia.com, dev@dpdk.org",
        "Date": "Wed,  2 Dec 2020 19:39:25 +0800",
        "Message-Id": "<1606909165-164407-3-git-send-email-suanmingm@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1606909165-164407-1-git-send-email-suanmingm@nvidia.com>",
        "References": "<1606909165-164407-1-git-send-email-suanmingm@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH 2/2] net/mlx5: optimize the hash list entry memory",
        "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": "Currently, the hash list saves the hash key in the hash entry. And the\nkey is mostly used to get the bucket index only.\n\nSave the entire 64 bits key to the entry will not be a good option if\nthe key is only used to get the bucket index. Since 64 bits costs more\nmemory for the entry, mostly the signature data in the key only uses\n32 bits. And in the unregister function, the key in the entry causes\nextra bucket index calculation.\n\nThis commit saves the bucket index to the entry instead of the hash key.\nFor the hash list like table, tag and mreg_copy which save the signature\ndata in the key, the signature data is moved to the resource data struct\nitself.\n\nSigned-off-by: Suanming Mou <suanmingm@nvidia.com>\nAcked-by: Matan Azrad <matan@nvidia.com>\n---\n drivers/net/mlx5/linux/mlx5_os.c |  5 ++--\n drivers/net/mlx5/mlx5.c          |  3 ++-\n drivers/net/mlx5/mlx5_flow.c     | 43 ++++++++++++++++++++++++------\n drivers/net/mlx5/mlx5_flow.h     | 23 +++++++++++++---\n drivers/net/mlx5/mlx5_flow_dv.c  | 57 +++++++++++++++++++++++++++++-----------\n drivers/net/mlx5/mlx5_utils.c    | 21 +++------------\n drivers/net/mlx5/mlx5_utils.h    |  4 +--\n 7 files changed, 107 insertions(+), 49 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c\nindex 4c863db..6c501c0 100644\n--- a/drivers/net/mlx5/linux/mlx5_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_os.c\n@@ -264,7 +264,8 @@\n \tsnprintf(s, sizeof(s), \"%s_tags\", sh->ibdev_name);\n \tsh->tag_table = mlx5_hlist_create(s, MLX5_TAGS_HLIST_ARRAY_SIZE, 0,\n \t\t\t\t\t  MLX5_HLIST_WRITE_MOST,\n-\t\t\t\t\t  flow_dv_tag_create_cb, NULL,\n+\t\t\t\t\t  flow_dv_tag_create_cb,\n+\t\t\t\t\t  flow_dv_tag_match_cb,\n \t\t\t\t\t  flow_dv_tag_remove_cb);\n \tif (!sh->tag_table) {\n \t\tDRV_LOG(ERR, \"tags with hash creation failed.\");\n@@ -1564,7 +1565,7 @@\n \t\t\t\t\t\t      MLX5_FLOW_MREG_HTABLE_SZ,\n \t\t\t\t\t\t      0, 0,\n \t\t\t\t\t\t      flow_dv_mreg_create_cb,\n-\t\t\t\t\t\t      NULL,\n+\t\t\t\t\t\t      flow_dv_mreg_match_cb,\n \t\t\t\t\t\t      flow_dv_mreg_remove_cb);\n \t\tif (!priv->mreg_cp_tbl) {\n \t\t\terr = ENOMEM;\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex ca3667a..7d3f18c 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -1152,7 +1152,8 @@ struct mlx5_dev_ctx_shared *\n \tMLX5_ASSERT(sh);\n \tsnprintf(s, sizeof(s), \"%s_flow_table\", priv->sh->ibdev_name);\n \tsh->flow_tbls = mlx5_hlist_create(s, MLX5_FLOW_TABLE_HLIST_ARRAY_SIZE,\n-\t\t\t\t\t  0, 0, flow_dv_tbl_create_cb, NULL,\n+\t\t\t\t\t  0, 0, flow_dv_tbl_create_cb,\n+\t\t\t\t\t  flow_dv_tbl_match_cb,\n \t\t\t\t\t  flow_dv_tbl_remove_cb);\n \tif (!sh->flow_tbls) {\n \t\tDRV_LOG(ERR, \"flow tables with hash creation failed.\");\ndiff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 52ade39..82e24d7 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -3574,6 +3574,17 @@ struct mlx5_translated_shared_action {\n flow_list_destroy(struct rte_eth_dev *dev, uint32_t *list,\n \t\t  uint32_t flow_idx);\n \n+int\n+flow_dv_mreg_match_cb(struct mlx5_hlist *list __rte_unused,\n+\t\t      struct mlx5_hlist_entry *entry,\n+\t\t      uint64_t key, void *cb_ctx __rte_unused)\n+{\n+\tstruct mlx5_flow_mreg_copy_resource *mcp_res =\n+\t\tcontainer_of(entry, typeof(*mcp_res), hlist_ent);\n+\n+\treturn mcp_res->mark_id != key;\n+}\n+\n struct mlx5_hlist_entry *\n flow_dv_mreg_create_cb(struct mlx5_hlist *list, uint64_t key,\n \t\t       void *cb_ctx)\n@@ -3675,6 +3686,7 @@ struct mlx5_hlist_entry *\n \t\treturn NULL;\n \t}\n \tmcp_res->idx = idx;\n+\tmcp_res->mark_id = mark_id;\n \t/*\n \t * The copy Flows are not included in any list. There\n \t * ones are referenced from other Flows and can not\n@@ -5022,7 +5034,6 @@ struct mlx5_hlist_entry *\n \tstruct mlx5_flow_dv_sample_resource *sample_res;\n \tstruct mlx5_flow_tbl_data_entry *sfx_tbl_data;\n \tstruct mlx5_flow_tbl_resource *sfx_tbl;\n-\tunion mlx5_flow_tbl_key sfx_table_key;\n #endif\n \tsize_t act_size;\n \tsize_t item_size;\n@@ -5082,10 +5093,9 @@ struct mlx5_hlist_entry *\n \t\t\t\t\tsample_res->normal_path_tbl;\n \t\tsfx_tbl_data = container_of(sfx_tbl,\n \t\t\t\t\tstruct mlx5_flow_tbl_data_entry, tbl);\n-\t\tsfx_table_key.v64 = sfx_tbl_data->entry.key;\n \t\tsfx_attr.group = sfx_attr.transfer ?\n-\t\t\t\t\t(sfx_table_key.table_id - 1) :\n-\t\t\t\t\t sfx_table_key.table_id;\n+\t\t\t\t\t(sfx_tbl_data->table_id - 1) :\n+\t\t\t\t\t sfx_tbl_data->table_id;\n \t\tflow_split_info->prefix_layers =\n \t\t\t\tflow_get_prefix_layer_flags(dev_flow);\n \t\tflow_split_info->prefix_mark = dev_flow->handle->mark;\n@@ -7353,13 +7363,28 @@ int rte_pmd_mlx5_sync_flow(uint16_t port_id, uint32_t domains)\n \tmlx5_free(tte);\n }\n \n+static int\n+mlx5_flow_tunnel_grp2tbl_match_cb(struct mlx5_hlist *list __rte_unused,\n+\t\t\t\t  struct mlx5_hlist_entry *entry,\n+\t\t\t\t  uint64_t key, void *cb_ctx __rte_unused)\n+{\n+\tunion tunnel_tbl_key tbl = {\n+\t\t.val = key,\n+\t};\n+\tstruct tunnel_tbl_entry *tte = container_of(entry, typeof(*tte), hash);\n+\n+\treturn tbl.tunnel_id != tte->tunnel_id || tbl.group != tte->group;\n+}\n+\n static struct mlx5_hlist_entry *\n-mlx5_flow_tunnel_grp2tbl_create_cb(struct mlx5_hlist *list,\n-\t\t\t\t   uint64_t key __rte_unused,\n+mlx5_flow_tunnel_grp2tbl_create_cb(struct mlx5_hlist *list, uint64_t key,\n \t\t\t\t   void *ctx __rte_unused)\n {\n \tstruct mlx5_dev_ctx_shared *sh = list->ctx;\n \tstruct tunnel_tbl_entry *tte;\n+\tunion tunnel_tbl_key tbl = {\n+\t\t.val = key,\n+\t};\n \n \ttte = mlx5_malloc(MLX5_MEM_SYS | MLX5_MEM_ZERO,\n \t\t\t  sizeof(*tte), 0,\n@@ -7378,6 +7403,8 @@ int rte_pmd_mlx5_sync_flow(uint16_t port_id, uint32_t domains)\n \t\tgoto err;\n \t}\n \ttte->flow_table = tunnel_id_to_flow_tbl(tte->flow_table);\n+\ttte->tunnel_id = tbl.tunnel_id;\n+\ttte->group = tbl.group;\n \treturn &tte->hash;\n err:\n \tif (tte)\n@@ -7517,7 +7544,7 @@ struct tunnel_db_find_tunnel_id_ctx {\n \t}\n \ttunnel->groups = mlx5_hlist_create(\"tunnel groups\", 1024, 0, 0,\n \t\t\t\t\t   mlx5_flow_tunnel_grp2tbl_create_cb,\n-\t\t\t\t\t   NULL,\n+\t\t\t\t\t   mlx5_flow_tunnel_grp2tbl_match_cb,\n \t\t\t\t\t   mlx5_flow_tunnel_grp2tbl_remove_cb);\n \tif (!tunnel->groups) {\n \t\tmlx5_ipool_free(ipool, id);\n@@ -7623,7 +7650,7 @@ int mlx5_alloc_tunnel_hub(struct mlx5_dev_ctx_shared *sh)\n \trte_spinlock_init(&thub->sl);\n \tthub->groups = mlx5_hlist_create(\"flow groups\", MLX5_MAX_TABLES, 0,\n \t\t\t\t\t 0, mlx5_flow_tunnel_grp2tbl_create_cb,\n-\t\t\t\t\t NULL,\n+\t\t\t\t\t mlx5_flow_tunnel_grp2tbl_match_cb,\n \t\t\t\t\t mlx5_flow_tunnel_grp2tbl_remove_cb);\n \tif (!thub->groups) {\n \t\terr = -rte_errno;\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex a249c29..d85dd19 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -437,6 +437,7 @@ struct mlx5_flow_dv_tag_resource {\n \t/**< Tag action object. */\n \tuint32_t refcnt; /**< Reference counter. */\n \tuint32_t idx; /**< Index for the index memory pool. */\n+\tuint32_t tag_id; /**< Tag ID. */\n };\n \n /*\n@@ -509,6 +510,7 @@ struct mlx5_flow_mreg_copy_resource {\n \t/* List entry for device flows. */\n \tuint32_t idx;\n \tuint32_t rix_flow; /* Built flow for copy. */\n+\tuint32_t mark_id;\n };\n \n /* Table tunnel parameter. */\n@@ -532,9 +534,13 @@ struct mlx5_flow_tbl_data_entry {\n \t/**< tunnel offload */\n \tconst struct mlx5_flow_tunnel *tunnel;\n \tuint32_t group_id;\n-\tbool external;\n-\tbool tunnel_offload; /* Tunnel offlod table or not. */\n-\tbool is_egress; /**< Egress table. */\n+\tuint32_t external:1;\n+\tuint32_t tunnel_offload:1; /* Tunnel offlod table or not. */\n+\tuint32_t is_egress:1; /**< Egress table. */\n+\tuint32_t is_transfer:1; /**< Transfer table. */\n+\tuint32_t dummy:1; /**<  DR table. */\n+\tuint32_t reserve:27; /**< Reserved to future using. */\n+\tuint32_t table_id; /**< Table ID. */\n };\n \n /* Sub rdma-core actions list. */\n@@ -954,6 +960,8 @@ struct mlx5_flow_tunnel_hub {\n struct tunnel_tbl_entry {\n \tstruct mlx5_hlist_entry hash;\n \tuint32_t flow_table;\n+\tuint32_t tunnel_id;\n+\tuint32_t group;\n };\n \n static inline uint32_t\n@@ -1416,6 +1424,9 @@ int mlx5_flow_meter_flush(struct rte_eth_dev *dev,\n /* Hash list callbacks for flow tables: */\n struct mlx5_hlist_entry *flow_dv_tbl_create_cb(struct mlx5_hlist *list,\n \t\t\t\t\t       uint64_t key, void *entry_ctx);\n+int flow_dv_tbl_match_cb(struct mlx5_hlist *list,\n+\t\t\t struct mlx5_hlist_entry *entry, uint64_t key,\n+\t\t\t void *cb_ctx);\n void flow_dv_tbl_remove_cb(struct mlx5_hlist *list,\n \t\t\t   struct mlx5_hlist_entry *entry);\n struct mlx5_flow_tbl_resource *flow_dv_tbl_resource_get(struct rte_eth_dev *dev,\n@@ -1425,6 +1436,9 @@ struct mlx5_flow_tbl_resource *flow_dv_tbl_resource_get(struct rte_eth_dev *dev,\n \n struct mlx5_hlist_entry *flow_dv_tag_create_cb(struct mlx5_hlist *list,\n \t\t\t\t\t       uint64_t key, void *cb_ctx);\n+int flow_dv_tag_match_cb(struct mlx5_hlist *list,\n+\t\t\t struct mlx5_hlist_entry *entry, uint64_t key,\n+\t\t\t void *cb_ctx);\n void flow_dv_tag_remove_cb(struct mlx5_hlist *list,\n \t\t\t   struct mlx5_hlist_entry *entry);\n \n@@ -1438,6 +1452,9 @@ void flow_dv_modify_remove_cb(struct mlx5_hlist *list,\n \n struct mlx5_hlist_entry *flow_dv_mreg_create_cb(struct mlx5_hlist *list,\n \t\t\t\t\t\tuint64_t key, void *ctx);\n+int flow_dv_mreg_match_cb(struct mlx5_hlist *list,\n+\t\t\t  struct mlx5_hlist_entry *entry, uint64_t key,\n+\t\t\t  void *cb_ctx);\n void flow_dv_mreg_remove_cb(struct mlx5_hlist *list,\n \t\t\t    struct mlx5_hlist_entry *entry);\n \ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex aa21ff9..30c7441 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -2780,8 +2780,7 @@ struct field_modify_info modify_tcp[] = {\n \tcache_resource = container_of(entry,\n \t\t\t\t      struct mlx5_flow_dv_encap_decap_resource,\n \t\t\t\t      entry);\n-\tif (resource->entry.key == cache_resource->entry.key &&\n-\t    resource->reformat_type == cache_resource->reformat_type &&\n+\tif (resource->reformat_type == cache_resource->reformat_type &&\n \t    resource->ft_type == cache_resource->ft_type &&\n \t    resource->flags == cache_resource->flags &&\n \t    resource->size == cache_resource->size &&\n@@ -2899,18 +2898,16 @@ struct mlx5_hlist_entry *\n \t\t.error = error,\n \t\t.data = resource,\n \t};\n+\tuint64_t key64;\n \n \tresource->flags = dev_flow->dv.group ? 0 : 1;\n-\tresource->entry.key =  __rte_raw_cksum(&encap_decap_key.v32,\n-\t\t\t\t\t       sizeof(encap_decap_key.v32), 0);\n+\tkey64 =  __rte_raw_cksum(&encap_decap_key.v32,\n+\t\t\t\t sizeof(encap_decap_key.v32), 0);\n \tif (resource->reformat_type !=\n \t    MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2 &&\n \t    resource->size)\n-\t\tresource->entry.key = __rte_raw_cksum(resource->buf,\n-\t\t\t\t\t\t      resource->size,\n-\t\t\t\t\t\t      resource->entry.key);\n-\tentry = mlx5_hlist_register(sh->encaps_decaps, resource->entry.key,\n-\t\t\t\t    &ctx);\n+\t\tkey64 = __rte_raw_cksum(resource->buf, resource->size, key64);\n+\tentry = mlx5_hlist_register(sh->encaps_decaps, key64, &ctx);\n \tif (!entry)\n \t\treturn -rte_errno;\n \tresource = container_of(entry, typeof(*resource), entry);\n@@ -4534,6 +4531,7 @@ struct mlx5_hlist_entry *\n \t\t.error = error,\n \t\t.data = resource,\n \t};\n+\tuint64_t key64;\n \n \tresource->flags = dev_flow->dv.group ? 0 :\n \t\t\t  MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL;\n@@ -4542,8 +4540,8 @@ struct mlx5_hlist_entry *\n \t\treturn rte_flow_error_set(error, EOVERFLOW,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ACTION, NULL,\n \t\t\t\t\t  \"too many modify header items\");\n-\tresource->entry.key = __rte_raw_cksum(&resource->ft_type, key_len, 0);\n-\tentry = mlx5_hlist_register(sh->modify_cmds, resource->entry.key, &ctx);\n+\tkey64 = __rte_raw_cksum(&resource->ft_type, key_len, 0);\n+\tentry = mlx5_hlist_register(sh->modify_cmds, key64, &ctx);\n \tif (!entry)\n \t\treturn -rte_errno;\n \tresource = container_of(entry, typeof(*resource), entry);\n@@ -7989,9 +7987,12 @@ struct mlx5_hlist_entry *\n \ttbl_data->idx = idx;\n \ttbl_data->tunnel = tt_prm->tunnel;\n \ttbl_data->group_id = tt_prm->group_id;\n-\ttbl_data->external = tt_prm->external;\n+\ttbl_data->external = !!tt_prm->external;\n \ttbl_data->tunnel_offload = is_tunnel_offload_active(dev);\n \ttbl_data->is_egress = !!key.direction;\n+\ttbl_data->is_transfer = !!key.domain;\n+\ttbl_data->dummy = !!key.dummy;\n+\ttbl_data->table_id = key.table_id;\n \ttbl = &tbl_data->tbl;\n \tif (key.dummy)\n \t\treturn &tbl_data->entry;\n@@ -8032,6 +8033,21 @@ struct mlx5_hlist_entry *\n \treturn &tbl_data->entry;\n }\n \n+int\n+flow_dv_tbl_match_cb(struct mlx5_hlist *list __rte_unused,\n+\t\t     struct mlx5_hlist_entry *entry, uint64_t key64,\n+\t\t     void *cb_ctx __rte_unused)\n+{\n+\tstruct mlx5_flow_tbl_data_entry *tbl_data =\n+\t\tcontainer_of(entry, struct mlx5_flow_tbl_data_entry, entry);\n+\tunion mlx5_flow_tbl_key key = { .v64 = key64 };\n+\n+\treturn tbl_data->table_id != key.table_id ||\n+\t       tbl_data->dummy != key.dummy ||\n+\t       tbl_data->is_transfer != key.domain ||\n+\t       tbl_data->is_egress != key.direction;\n+}\n+\n /**\n  * Get a flow table.\n  *\n@@ -8117,10 +8133,7 @@ struct mlx5_flow_tbl_resource *\n \t\t\t\t\ttbl_data->tunnel->tunnel_id : 0,\n \t\t\t.group = tbl_data->group_id\n \t\t};\n-\t\tunion mlx5_flow_tbl_key table_key = {\n-\t\t\t.v64 = entry->key\n-\t\t};\n-\t\tuint32_t table_id = table_key.table_id;\n+\t\tuint32_t table_id = tbl_data->table_id;\n \n \t\ttunnel_grp_hash = tbl_data->tunnel ?\n \t\t\t\t\ttbl_data->tunnel->groups :\n@@ -8295,6 +8308,7 @@ struct mlx5_hlist_entry *\n \t\treturn NULL;\n \t}\n \tentry->idx = idx;\n+\tentry->tag_id = key;\n \tret = mlx5_flow_os_create_flow_action_tag(key,\n \t\t\t\t\t\t  &entry->action);\n \tif (ret) {\n@@ -8307,6 +8321,17 @@ struct mlx5_hlist_entry *\n \treturn &entry->entry;\n }\n \n+int\n+flow_dv_tag_match_cb(struct mlx5_hlist *list __rte_unused,\n+\t\t     struct mlx5_hlist_entry *entry, uint64_t key,\n+\t\t     void *cb_ctx __rte_unused)\n+{\n+\tstruct mlx5_flow_dv_tag_resource *tag =\n+\t\tcontainer_of(entry, struct mlx5_flow_dv_tag_resource, entry);\n+\n+\treturn key != tag->tag_id;\n+}\n+\n /**\n  * Find existing tag resource or create and register a new one.\n  *\ndiff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c\nindex 42e5d80..07373bf 100644\n--- a/drivers/net/mlx5/mlx5_utils.c\n+++ b/drivers/net/mlx5/mlx5_utils.c\n@@ -25,14 +25,6 @@\n \tmlx5_free(entry);\n }\n \n-static int\n-mlx5_hlist_default_match_cb(struct mlx5_hlist *h __rte_unused,\n-\t\t\t    struct mlx5_hlist_entry *entry,\n-\t\t\t    uint64_t key, void *ctx __rte_unused)\n-{\n-\treturn entry->key != key;\n-}\n-\n struct mlx5_hlist *\n mlx5_hlist_create(const char *name, uint32_t size, uint32_t entry_size,\n \t\t  uint32_t flags, mlx5_hlist_create_cb cb_create,\n@@ -43,7 +35,7 @@ struct mlx5_hlist *\n \tuint32_t alloc_size;\n \tuint32_t i;\n \n-\tif (!size || (!cb_create ^ !cb_remove))\n+\tif (!size || !cb_match || (!cb_create ^ !cb_remove))\n \t\treturn NULL;\n \t/* Align to the next power of 2, 32bits integer is enough now. */\n \tif (!rte_is_power_of_2(size)) {\n@@ -71,7 +63,7 @@ struct mlx5_hlist *\n \th->direct_key = !!(flags & MLX5_HLIST_DIRECT_KEY);\n \th->write_most = !!(flags & MLX5_HLIST_WRITE_MOST);\n \th->cb_create = cb_create ? cb_create : mlx5_hlist_default_create_cb;\n-\th->cb_match = cb_match ? cb_match : mlx5_hlist_default_match_cb;\n+\th->cb_match = cb_match;\n \th->cb_remove = cb_remove ? cb_remove : mlx5_hlist_default_remove_cb;\n \tfor (i = 0; i < act_size; i++)\n \t\trte_rwlock_init(&h->buckets[i].lock);\n@@ -166,7 +158,7 @@ struct mlx5_hlist_entry*\n \t\tDRV_LOG(DEBUG, \"Can't allocate hash list %s entry.\", h->name);\n \t\tgoto done;\n \t}\n-\tentry->key = key;\n+\tentry->idx = idx;\n \tentry->ref_cnt = 1;\n \tLIST_INSERT_HEAD(first, entry, next);\n \t__atomic_add_fetch(&b->gen_cnt, 1, __ATOMIC_ACQ_REL);\n@@ -180,12 +172,7 @@ struct mlx5_hlist_entry*\n int\n mlx5_hlist_unregister(struct mlx5_hlist *h, struct mlx5_hlist_entry *entry)\n {\n-\tuint32_t idx;\n-\n-\tif (h->direct_key)\n-\t\tidx = (uint32_t)(entry->key & h->mask);\n-\telse\n-\t\tidx = rte_hash_crc_8byte(entry->key, 0) & h->mask;\n+\tuint32_t idx = entry->idx;\n \n \trte_rwlock_write_lock(&h->buckets[idx].lock);\n \tMLX5_ASSERT(entry && entry->ref_cnt && entry->next.le_prev);\ndiff --git a/drivers/net/mlx5/mlx5_utils.h b/drivers/net/mlx5/mlx5_utils.h\nindex 6f25768..1971b17 100644\n--- a/drivers/net/mlx5/mlx5_utils.h\n+++ b/drivers/net/mlx5/mlx5_utils.h\n@@ -274,9 +274,9 @@ struct mlx5_indexed_pool {\n  */\n struct mlx5_hlist_entry {\n \tLIST_ENTRY(mlx5_hlist_entry) next; /* entry pointers in the list. */\n-\tuint64_t key; /* user defined 'key', could be the hash signature. */\n+\tuint32_t idx; /* Bucket index the entry belongs to. */\n \tuint32_t ref_cnt; /* Reference count. */\n-};\n+} __rte_packed;\n \n /** Structure for hash head. */\n LIST_HEAD(mlx5_hlist_head, mlx5_hlist_entry);\n",
    "prefixes": [
        "2/2"
    ]
}