get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 79773,
    "url": "http://patches.dpdk.org/api/patches/79773/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1601984948-313027-18-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": "<1601984948-313027-18-git-send-email-suanmingm@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1601984948-313027-18-git-send-email-suanmingm@nvidia.com",
    "date": "2020-10-06T11:49:00",
    "name": "[17/25] net/mlx5: make matcher list thread safe",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "10bd35d303661c817ffc35344430f455b1817527",
    "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/1601984948-313027-18-git-send-email-suanmingm@nvidia.com/mbox/",
    "series": [
        {
            "id": 12718,
            "url": "http://patches.dpdk.org/api/series/12718/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12718",
            "date": "2020-10-06T11:48:45",
            "name": "net/mlx5: support multiple-thread flow operations",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12718/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/79773/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/79773/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 555FDA04BB;\n\tTue,  6 Oct 2020 13:56:33 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 457F31BB6F;\n\tTue,  6 Oct 2020 13:49:54 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 4689F1BAC5\n for <dev@dpdk.org>; Tue,  6 Oct 2020 13:49:50 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n suanmingm@nvidia.com) with SMTP; 6 Oct 2020 14:49:44 +0300",
            "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 096BnC0b028553;\n Tue, 6 Oct 2020 14:49:42 +0300"
        ],
        "From": "Suanming Mou <suanmingm@nvidia.com>",
        "To": "viacheslavo@nvidia.com, matan@nvidia.com",
        "Cc": "rasland@nvidia.com, dev@dpdk.org, Xueming Li <xuemingl@nvidia.com>",
        "Date": "Tue,  6 Oct 2020 19:49:00 +0800",
        "Message-Id": "<1601984948-313027-18-git-send-email-suanmingm@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1601984948-313027-1-git-send-email-suanmingm@nvidia.com>",
        "References": "<1601984948-313027-1-git-send-email-suanmingm@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH 17/25] net/mlx5: make matcher list thread safe",
        "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": "From: Xueming Li <xuemingl@nvidia.com>\n\nTo support multi-thread flow insertion, this path converts matcher list\nto use thread safe cache list API.\n\nSigned-off-by: Xueming Li <xuemingl@nvidia.com>\n---\n drivers/net/mlx5/mlx5.h         |   3 +\n drivers/net/mlx5/mlx5_flow.h    |  15 ++-\n drivers/net/mlx5/mlx5_flow_dv.c | 209 +++++++++++++++++++++-------------------\n 3 files changed, 126 insertions(+), 101 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 97729a8..ee2211b 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -32,6 +32,9 @@\n #include \"mlx5_os.h\"\n #include \"mlx5_autoconf.h\"\n \n+\n+#define MLX5_SH(dev) (((struct mlx5_priv *)(dev)->data->dev_private)->sh)\n+\n enum mlx5_ipool_index {\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n \tMLX5_IPOOL_DECAP_ENCAP = 0, /* Pool for encap/decap resource. */\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 6ec0e72..fe9b6a6 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -378,11 +378,9 @@ struct mlx5_flow_dv_match_params {\n \n /* Matcher structure. */\n struct mlx5_flow_dv_matcher {\n-\tLIST_ENTRY(mlx5_flow_dv_matcher) next;\n-\t/**< Pointer to the next element. */\n+\tstruct mlx5_cache_entry entry; /**< Pointer to the next element. */\n \tstruct mlx5_flow_tbl_resource *tbl;\n \t/**< Pointer to the table(group) the matcher associated with. */\n-\trte_atomic32_t refcnt; /**< Reference counter. */\n \tvoid *matcher_object; /**< Pointer to DV matcher */\n \tuint16_t crc; /**< CRC of key. */\n \tuint16_t priority; /**< Priority of matcher. */\n@@ -512,11 +510,12 @@ struct mlx5_flow_tbl_data_entry {\n \t/**< hash list entry, 64-bits key inside. */\n \tstruct mlx5_flow_tbl_resource tbl;\n \t/**< flow table resource. */\n-\tLIST_HEAD(matchers, mlx5_flow_dv_matcher) matchers;\n+\tstruct mlx5_cache_list matchers;\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+\tuint8_t direction; /**< table direction, 0: ingress, 1: egress. */\n };\n \n /* Verbs specification header. */\n@@ -1095,4 +1094,12 @@ struct mlx5_hlist_entry *flow_dv_encap_decap_create_cb(struct mlx5_hlist *list,\n \t\t\t\tuint64_t key, void *cb_ctx);\n void flow_dv_encap_decap_remove_cb(struct mlx5_hlist *list,\n \t\t\t\t   struct mlx5_hlist_entry *entry);\n+\n+int flow_dv_matcher_match_cb(struct mlx5_cache_list *list,\n+\t\t\t     struct mlx5_cache_entry *entry, void *ctx);\n+struct mlx5_cache_entry *flow_dv_matcher_create_cb(struct mlx5_cache_list *list,\n+\t\tstruct mlx5_cache_entry *entry, void *ctx);\n+void flow_dv_matcher_remove_cb(struct mlx5_cache_list *list,\n+\t\t\t       struct mlx5_cache_entry *entry);\n+\n #endif /* RTE_PMD_MLX5_FLOW_H_ */\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 5092130..3774e46 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -70,7 +70,7 @@\n };\n \n static int\n-flow_dv_tbl_resource_release(struct rte_eth_dev *dev,\n+flow_dv_tbl_resource_release(struct mlx5_dev_ctx_shared *sh,\n \t\t\t     struct mlx5_flow_tbl_resource *tbl);\n \n static int\n@@ -2730,7 +2730,7 @@ struct mlx5_hlist_entry *\n \t\t\t(void *)&tbl_data->jump, cnt);\n \t} else {\n \t\t/* old jump should not make the table ref++. */\n-\t\tflow_dv_tbl_resource_release(dev, &tbl_data->tbl);\n+\t\tflow_dv_tbl_resource_release(MLX5_SH(dev), &tbl_data->tbl);\n \t\tMLX5_ASSERT(tbl_data->jump.action);\n \t\tDRV_LOG(DEBUG, \"existed jump table resource %p: refcnt %d++\",\n \t\t\t(void *)&tbl_data->jump, cnt);\n@@ -7608,6 +7608,7 @@ struct mlx5_hlist_entry *\n \t\treturn NULL;\n \t}\n \ttbl_data->idx = idx;\n+\ttbl_data->direction = key.direction;\n \ttbl = &tbl_data->tbl;\n \tif (key.dummy)\n \t\treturn &tbl_data->entry;\n@@ -7625,6 +7626,13 @@ struct mlx5_hlist_entry *\n \t\tmlx5_ipool_free(sh->ipool[MLX5_IPOOL_JUMP], idx);\n \t\treturn NULL;\n \t}\n+\tMKSTR(matcher_name, \"%s_%s_%u_matcher_cache\",\n+\t      key.domain ? \"FDB\" : \"NIC\", key.direction ? \"egress\" : \"ingress\",\n+\t      key.table_id);\n+\tmlx5_cache_list_init(&tbl_data->matchers, matcher_name, 0, sh,\n+\t\t\t     flow_dv_matcher_create_cb,\n+\t\t\t     flow_dv_matcher_match_cb,\n+\t\t\t     flow_dv_matcher_remove_cb);\n \trte_atomic32_init(&tbl_data->jump.refcnt);\n \treturn &tbl_data->entry;\n }\n@@ -7684,14 +7692,15 @@ struct mlx5_flow_tbl_resource *\n \tMLX5_ASSERT(entry && sh);\n \tif (tbl_data->tbl.obj)\n \t\tmlx5_flow_os_destroy_flow_tbl(tbl_data->tbl.obj);\n+\tmlx5_cache_list_destroy(&tbl_data->matchers);\n \tmlx5_ipool_free(sh->ipool[MLX5_IPOOL_JUMP], tbl_data->idx);\n }\n \n /**\n  * Release a flow table.\n  *\n- * @param[in] dev\n- *   Pointer to rte_eth_dev structure.\n+ * @param[in] sh\n+ *   Pointer to device shared structure.\n  * @param[in] tbl\n  *   Table resource to be released.\n  *\n@@ -7699,11 +7708,9 @@ struct mlx5_flow_tbl_resource *\n  *   Returns 0 if table was released, else return 1;\n  */\n static int\n-flow_dv_tbl_resource_release(struct rte_eth_dev *dev,\n+flow_dv_tbl_resource_release(struct mlx5_dev_ctx_shared *sh,\n \t\t\t     struct mlx5_flow_tbl_resource *tbl)\n {\n-\tstruct mlx5_priv *priv = dev->data->dev_private;\n-\tstruct mlx5_dev_ctx_shared *sh = priv->sh;\n \tstruct mlx5_flow_tbl_data_entry *tbl_data =\n \t\tcontainer_of(tbl, struct mlx5_flow_tbl_data_entry, tbl);\n \n@@ -7712,6 +7719,63 @@ struct mlx5_flow_tbl_resource *\n \treturn mlx5_hlist_unregister(sh->flow_tbls, &tbl_data->entry);\n }\n \n+int\n+flow_dv_matcher_match_cb(struct mlx5_cache_list *list __rte_unused,\n+\t\t\t struct mlx5_cache_entry *entry, void *cb_ctx)\n+{\n+\tstruct mlx5_flow_cb_ctx *ctx = cb_ctx;\n+\tstruct mlx5_flow_dv_matcher *ref = ctx->data;\n+\tstruct mlx5_flow_dv_matcher *cur = container_of(entry, typeof(*cur),\n+\t\t\t\t\t\t\tentry);\n+\n+\treturn cur->crc != ref->crc ||\n+\t       cur->priority != ref->priority ||\n+\t       memcmp((const void *)cur->mask.buf,\n+\t\t      (const void *)ref->mask.buf, ref->mask.size);\n+}\n+\n+struct mlx5_cache_entry *\n+flow_dv_matcher_create_cb(struct mlx5_cache_list *list,\n+\t\t\t  struct mlx5_cache_entry *entry __rte_unused,\n+\t\t\t  void *cb_ctx)\n+{\n+\tstruct mlx5_dev_ctx_shared *sh = list->ctx;\n+\tstruct mlx5_flow_cb_ctx *ctx = cb_ctx;\n+\tstruct mlx5_flow_dv_matcher *ref = ctx->data;\n+\tstruct mlx5_flow_dv_matcher *cache;\n+\tstruct mlx5dv_flow_matcher_attr dv_attr = {\n+\t\t.type = IBV_FLOW_ATTR_NORMAL,\n+\t\t.match_mask = (void *)&ref->mask,\n+\t};\n+\tstruct mlx5_flow_tbl_data_entry *tbl = container_of(ref->tbl,\n+\t\t\t\t\t\t\t    typeof(*tbl), tbl);\n+\tint ret;\n+\n+\tcache = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*cache), 0, SOCKET_ID_ANY);\n+\tif (!cache) {\n+\t\trte_flow_error_set(ctx->error, ENOMEM,\n+\t\t\t\t   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n+\t\t\t\t   \"cannot create matcher\");\n+\t\treturn NULL;\n+\t}\n+\t*cache = *ref;\n+\tdv_attr.match_criteria_enable =\n+\t\tflow_dv_matcher_enable(cache->mask.buf);\n+\tdv_attr.priority = ref->priority;\n+\tif (tbl->direction)\n+\t\tdv_attr.flags |= IBV_FLOW_ATTR_FLAGS_EGRESS;\n+\tret = mlx5_flow_os_create_flow_matcher(sh->ctx, &dv_attr, tbl->tbl.obj,\n+\t\t\t\t\t       &cache->matcher_object);\n+\tif (ret) {\n+\t\tmlx5_free(cache);\n+\t\trte_flow_error_set(ctx->error, ENOMEM,\n+\t\t\t\t   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n+\t\t\t\t   \"cannot create matcher\");\n+\t\treturn NULL;\n+\t}\n+\treturn &cache->entry;\n+}\n+\n /**\n  * Register the flow matcher.\n  *\n@@ -7731,87 +7795,35 @@ struct mlx5_flow_tbl_resource *\n  */\n static int\n flow_dv_matcher_register(struct rte_eth_dev *dev,\n-\t\t\t struct mlx5_flow_dv_matcher *matcher,\n+\t\t\t struct mlx5_flow_dv_matcher *ref,\n \t\t\t union mlx5_flow_tbl_key *key,\n \t\t\t struct mlx5_flow *dev_flow,\n \t\t\t struct rte_flow_error *error)\n {\n-\tstruct mlx5_priv *priv = dev->data->dev_private;\n-\tstruct mlx5_dev_ctx_shared *sh = priv->sh;\n-\tstruct mlx5_flow_dv_matcher *cache_matcher;\n-\tstruct mlx5dv_flow_matcher_attr dv_attr = {\n-\t\t.type = IBV_FLOW_ATTR_NORMAL,\n-\t\t.match_mask = (void *)&matcher->mask,\n-\t};\n+\tstruct mlx5_cache_entry *entry;\n+\tstruct mlx5_flow_dv_matcher *cache;\n \tstruct mlx5_flow_tbl_resource *tbl;\n \tstruct mlx5_flow_tbl_data_entry *tbl_data;\n-\tint ret;\n+\tstruct mlx5_flow_cb_ctx ctx = {\n+\t\t.error = error,\n+\t\t.data = ref,\n+\t};\n \n \ttbl = flow_dv_tbl_resource_get(dev, key->table_id, key->direction,\n \t\t\t\t       key->domain, 0, error);\n \tif (!tbl)\n \t\treturn -rte_errno;\t/* No need to refill the error info */\n \ttbl_data = container_of(tbl, struct mlx5_flow_tbl_data_entry, tbl);\n-\t/* Lookup from cache. */\n-\tLIST_FOREACH(cache_matcher, &tbl_data->matchers, next) {\n-\t\tif (matcher->crc == cache_matcher->crc &&\n-\t\t    matcher->priority == cache_matcher->priority &&\n-\t\t    !memcmp((const void *)matcher->mask.buf,\n-\t\t\t    (const void *)cache_matcher->mask.buf,\n-\t\t\t    cache_matcher->mask.size)) {\n-\t\t\tDRV_LOG(DEBUG,\n-\t\t\t\t\"%s group %u priority %hd use %s \"\n-\t\t\t\t\"matcher %p: refcnt %d++\",\n-\t\t\t\tkey->domain ? \"FDB\" : \"NIC\", key->table_id,\n-\t\t\t\tcache_matcher->priority,\n-\t\t\t\tkey->direction ? \"tx\" : \"rx\",\n-\t\t\t\t(void *)cache_matcher,\n-\t\t\t\trte_atomic32_read(&cache_matcher->refcnt));\n-\t\t\trte_atomic32_inc(&cache_matcher->refcnt);\n-\t\t\tdev_flow->handle->dvh.matcher = cache_matcher;\n-\t\t\t/* old matcher should not make the table ref++. */\n-\t\t\tflow_dv_tbl_resource_release(dev, tbl);\n-\t\t\treturn 0;\n-\t\t}\n-\t}\n-\t/* Register new matcher. */\n-\tcache_matcher = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*cache_matcher), 0,\n-\t\t\t\t    SOCKET_ID_ANY);\n-\tif (!cache_matcher) {\n-\t\tflow_dv_tbl_resource_release(dev, tbl);\n+\tref->tbl = tbl;\n+\tentry = mlx5_cache_register(&tbl_data->matchers, &ctx);\n+\tif (!entry) {\n+\t\tflow_dv_tbl_resource_release(MLX5_SH(dev), tbl);\n \t\treturn rte_flow_error_set(error, ENOMEM,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n-\t\t\t\t\t  \"cannot allocate matcher memory\");\n+\t\t\t\t\t  \"cannot allocate ref memory\");\n \t}\n-\t*cache_matcher = *matcher;\n-\tdv_attr.match_criteria_enable =\n-\t\tflow_dv_matcher_enable(cache_matcher->mask.buf);\n-\tdv_attr.priority = matcher->priority;\n-\tif (key->direction)\n-\t\tdv_attr.flags |= IBV_FLOW_ATTR_FLAGS_EGRESS;\n-\tret = mlx5_flow_os_create_flow_matcher(sh->ctx, &dv_attr, tbl->obj,\n-\t\t\t\t\t       &cache_matcher->matcher_object);\n-\tif (ret) {\n-\t\tmlx5_free(cache_matcher);\n-#ifdef HAVE_MLX5DV_DR\n-\t\tflow_dv_tbl_resource_release(dev, tbl);\n-#endif\n-\t\treturn rte_flow_error_set(error, ENOMEM,\n-\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n-\t\t\t\t\t  NULL, \"cannot create matcher\");\n-\t}\n-\t/* Save the table information */\n-\tcache_matcher->tbl = tbl;\n-\trte_atomic32_init(&cache_matcher->refcnt);\n-\t/* only matcher ref++, table ref++ already done above in get API. */\n-\trte_atomic32_inc(&cache_matcher->refcnt);\n-\tLIST_INSERT_HEAD(&tbl_data->matchers, cache_matcher, next);\n-\tdev_flow->handle->dvh.matcher = cache_matcher;\n-\tDRV_LOG(DEBUG, \"%s group %u priority %hd new %s matcher %p: refcnt %d\",\n-\t\tkey->domain ? \"FDB\" : \"NIC\", key->table_id,\n-\t\tcache_matcher->priority,\n-\t\tkey->direction ? \"tx\" : \"rx\", (void *)cache_matcher,\n-\t\trte_atomic32_read(&cache_matcher->refcnt));\n+\tcache = container_of(entry, typeof(*cache), entry);\n+\tdev_flow->handle->dvh.matcher = cache;\n \treturn 0;\n }\n \n@@ -8485,7 +8497,7 @@ struct mlx5_hlist_entry *\n \t\t\t\t\t\t \"cannot create jump action.\");\n \t\t\tif (flow_dv_jump_tbl_resource_register\n \t\t\t    (dev, tbl, dev_flow, error)) {\n-\t\t\t\tflow_dv_tbl_resource_release(dev, tbl);\n+\t\t\t\tflow_dv_tbl_resource_release(MLX5_SH(dev), tbl);\n \t\t\t\treturn rte_flow_error_set\n \t\t\t\t\t\t(error, errno,\n \t\t\t\t\t\t RTE_FLOW_ERROR_TYPE_ACTION,\n@@ -9055,6 +9067,19 @@ struct mlx5_hlist_entry *\n \treturn -rte_errno;\n }\n \n+void\n+flow_dv_matcher_remove_cb(struct mlx5_cache_list *list,\n+\t\t\t  struct mlx5_cache_entry *entry)\n+{\n+\tstruct mlx5_dev_ctx_shared *sh = list->ctx;\n+\tstruct mlx5_flow_dv_matcher *cache = container_of(entry, typeof(*cache),\n+\t\t\t\t\t\t\t  entry);\n+\n+\tclaim_zero(mlx5_flow_os_destroy_flow_matcher(cache->matcher_object));\n+\tflow_dv_tbl_resource_release(sh, cache->tbl);\n+\tmlx5_free(cache);\n+}\n+\n /**\n  * Release the flow matcher.\n  *\n@@ -9067,27 +9092,15 @@ struct mlx5_hlist_entry *\n  *   1 while a reference on it exists, 0 when freed.\n  */\n static int\n-flow_dv_matcher_release(struct rte_eth_dev *dev,\n+flow_dv_matcher_release(struct rte_eth_dev *dev __rte_unused,\n \t\t\tstruct mlx5_flow_handle *handle)\n {\n \tstruct mlx5_flow_dv_matcher *matcher = handle->dvh.matcher;\n+\tstruct mlx5_flow_tbl_data_entry *tbl = container_of(matcher->tbl,\n+\t\t\t\t\t\t\t    typeof(*tbl), tbl);\n \n \tMLX5_ASSERT(matcher->matcher_object);\n-\tDRV_LOG(DEBUG, \"port %u matcher %p: refcnt %d--\",\n-\t\tdev->data->port_id, (void *)matcher,\n-\t\trte_atomic32_read(&matcher->refcnt));\n-\tif (rte_atomic32_dec_and_test(&matcher->refcnt)) {\n-\t\tclaim_zero(mlx5_flow_os_destroy_flow_matcher\n-\t\t\t   (matcher->matcher_object));\n-\t\tLIST_REMOVE(matcher, next);\n-\t\t/* table ref-- in release interface. */\n-\t\tflow_dv_tbl_resource_release(dev, matcher->tbl);\n-\t\tmlx5_free(matcher);\n-\t\tDRV_LOG(DEBUG, \"port %u matcher %p: removed\",\n-\t\t\tdev->data->port_id, (void *)matcher);\n-\t\treturn 0;\n-\t}\n-\treturn 1;\n+\treturn mlx5_cache_unregister(&tbl->matchers, &matcher->entry);\n }\n \n /**\n@@ -9169,7 +9182,7 @@ struct mlx5_hlist_entry *\n \t\tclaim_zero(mlx5_flow_os_destroy_flow_action\n \t\t\t\t\t\t(cache_resource->action));\n \t\t/* jump action memory free is inside the table release. */\n-\t\tflow_dv_tbl_resource_release(dev, &tbl_data->tbl);\n+\t\tflow_dv_tbl_resource_release(MLX5_SH(dev), &tbl_data->tbl);\n \t\tDRV_LOG(DEBUG, \"jump table resource %p: removed\",\n \t\t\t(void *)cache_resource);\n \t\treturn 0;\n@@ -9580,9 +9593,9 @@ struct mlx5_hlist_entry *\n \t\tclaim_zero(mlx5_flow_os_destroy_flow_matcher\n \t\t\t   (mtd->egress.any_matcher));\n \tif (mtd->egress.tbl)\n-\t\tflow_dv_tbl_resource_release(dev, mtd->egress.tbl);\n+\t\tflow_dv_tbl_resource_release(MLX5_SH(dev), mtd->egress.tbl);\n \tif (mtd->egress.sfx_tbl)\n-\t\tflow_dv_tbl_resource_release(dev, mtd->egress.sfx_tbl);\n+\t\tflow_dv_tbl_resource_release(MLX5_SH(dev), mtd->egress.sfx_tbl);\n \tif (mtd->ingress.color_matcher)\n \t\tclaim_zero(mlx5_flow_os_destroy_flow_matcher\n \t\t\t   (mtd->ingress.color_matcher));\n@@ -9590,9 +9603,10 @@ struct mlx5_hlist_entry *\n \t\tclaim_zero(mlx5_flow_os_destroy_flow_matcher\n \t\t\t   (mtd->ingress.any_matcher));\n \tif (mtd->ingress.tbl)\n-\t\tflow_dv_tbl_resource_release(dev, mtd->ingress.tbl);\n+\t\tflow_dv_tbl_resource_release(MLX5_SH(dev), mtd->ingress.tbl);\n \tif (mtd->ingress.sfx_tbl)\n-\t\tflow_dv_tbl_resource_release(dev, mtd->ingress.sfx_tbl);\n+\t\tflow_dv_tbl_resource_release(MLX5_SH(dev),\n+\t\t\t\t\t     mtd->ingress.sfx_tbl);\n \tif (mtd->transfer.color_matcher)\n \t\tclaim_zero(mlx5_flow_os_destroy_flow_matcher\n \t\t\t   (mtd->transfer.color_matcher));\n@@ -9600,9 +9614,10 @@ struct mlx5_hlist_entry *\n \t\tclaim_zero(mlx5_flow_os_destroy_flow_matcher\n \t\t\t   (mtd->transfer.any_matcher));\n \tif (mtd->transfer.tbl)\n-\t\tflow_dv_tbl_resource_release(dev, mtd->transfer.tbl);\n+\t\tflow_dv_tbl_resource_release(MLX5_SH(dev), mtd->transfer.tbl);\n \tif (mtd->transfer.sfx_tbl)\n-\t\tflow_dv_tbl_resource_release(dev, mtd->transfer.sfx_tbl);\n+\t\tflow_dv_tbl_resource_release(MLX5_SH(dev),\n+\t\t\t\t\t     mtd->transfer.sfx_tbl);\n \tif (mtd->drop_actn)\n \t\tclaim_zero(mlx5_flow_os_destroy_flow_action(mtd->drop_actn));\n \tmlx5_free(mtd);\n",
    "prefixes": [
        "17/25"
    ]
}