Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/82570/?format=api
https://patches.dpdk.org/api/patches/82570/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1603875616-272798-33-git-send-email-suanmingm@nvidia.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": "<1603875616-272798-33-git-send-email-suanmingm@nvidia.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1603875616-272798-33-git-send-email-suanmingm@nvidia.com", "date": "2020-10-28T09:00:13", "name": "[v5,32/34] net/mlx5: make tunnel hub list thread safe", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "d0dd9d7b413f10265752a780dbd9903a7dfa71a6", "submitter": { "id": 1887, "url": "https://patches.dpdk.org/api/people/1887/?format=api", "name": "Suanming Mou", "email": "suanmingm@nvidia.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/1603875616-272798-33-git-send-email-suanmingm@nvidia.com/mbox/", "series": [ { "id": 13411, "url": "https://patches.dpdk.org/api/series/13411/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13411", "date": "2020-10-28T08:59:42", "name": "net/mlx5: support multiple-thread flow operations", "version": 5, "mbox": "https://patches.dpdk.org/series/13411/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/82570/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/82570/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 44002A04DD;\n\tWed, 28 Oct 2020 10:10:47 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2D793C9A2;\n\tWed, 28 Oct 2020 10:03:51 +0100 (CET)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 07ED7C7EA\n for <dev@dpdk.org>; Wed, 28 Oct 2020 10:02:20 +0100 (CET)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n suanmingm@nvidia.com) with SMTP; 28 Oct 2020 11:01:45 +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 09S90JmW024495;\n Wed, 28 Oct 2020 11:01:43 +0200" ], "From": "Suanming Mou <suanmingm@nvidia.com>", "To": "Matan Azrad <matan@nvidia.com>, Shahaf Shuler <shahafs@nvidia.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>", "Cc": "dev@dpdk.org, rasland@nvidia.com", "Date": "Wed, 28 Oct 2020 17:00:13 +0800", "Message-Id": "<1603875616-272798-33-git-send-email-suanmingm@nvidia.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1603875616-272798-1-git-send-email-suanmingm@nvidia.com>", "References": "<1601984948-313027-1-git-send-email-suanmingm@nvidia.com>\n <1603875616-272798-1-git-send-email-suanmingm@nvidia.com>", "Subject": "[dpdk-dev] [PATCH v5 32/34] net/mlx5: make tunnel hub list thread\n\tsafe", "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 uses spinlock to protect the tunnel hub list in multiple\nthread.\n\nSigned-off-by: Suanming Mou <suanmingm@nvidia.com>\nAcked-by: Matan Azrad <matan@nvidia.com>\n---\n drivers/net/mlx5/mlx5_flow.c | 20 +++++++++++++++++---\n drivers/net/mlx5/mlx5_flow.h | 1 +\n 2 files changed, 18 insertions(+), 3 deletions(-)", "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 1e82030..a6e60af 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -669,10 +669,14 @@ enum mlx5_expansion {\n \tstruct mlx5_flow_tunnel_hub *thub = mlx5_tunnel_hub(dev);\n \tstruct mlx5_flow_tunnel *tun;\n \n+\trte_spinlock_lock(&thub->sl);\n \tLIST_FOREACH(tun, &thub->tunnels, chain) {\n-\t\tif (&tun->item == pmd_items)\n+\t\tif (&tun->item == pmd_items) {\n+\t\t\tLIST_REMOVE(tun, chain);\n \t\t\tbreak;\n+\t\t}\n \t}\n+\trte_spinlock_unlock(&thub->sl);\n \tif (!tun || num_items != 1)\n \t\treturn rte_flow_error_set(err, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n@@ -690,10 +694,14 @@ enum mlx5_expansion {\n \tstruct mlx5_flow_tunnel_hub *thub = mlx5_tunnel_hub(dev);\n \tstruct mlx5_flow_tunnel *tun;\n \n+\trte_spinlock_lock(&thub->sl);\n \tLIST_FOREACH(tun, &thub->tunnels, chain) {\n-\t\tif (&tun->action == pmd_actions)\n+\t\tif (&tun->action == pmd_actions) {\n+\t\t\tLIST_REMOVE(tun, chain);\n \t\t\tbreak;\n+\t\t}\n \t}\n+\trte_spinlock_unlock(&thub->sl);\n \tif (!tun || num_actions != 1)\n \t\treturn rte_flow_error_set(err, EINVAL,\n \t\t\t\t\t RTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n@@ -5880,8 +5888,12 @@ struct rte_flow *\n \tmlx5_ipool_free(priv->sh->ipool[MLX5_IPOOL_RTE_FLOW], flow_idx);\n \tif (flow->tunnel) {\n \t\tstruct mlx5_flow_tunnel *tunnel;\n+\n+\t\trte_spinlock_lock(&mlx5_tunnel_hub(dev)->sl);\n \t\ttunnel = mlx5_find_tunnel_id(dev, flow->tunnel_id);\n \t\tRTE_VERIFY(tunnel);\n+\t\tLIST_REMOVE(tunnel, chain);\n+\t\trte_spinlock_unlock(&mlx5_tunnel_hub(dev)->sl);\n \t\tif (!__atomic_sub_fetch(&tunnel->refctn, 1, __ATOMIC_RELAXED))\n \t\t\tmlx5_flow_tunnel_free(dev, tunnel);\n \t}\n@@ -7940,7 +7952,6 @@ struct mlx5_meter_domains_infos *\n \tDRV_LOG(DEBUG, \"port %u release pmd tunnel id=0x%x\",\n \t\tdev->data->port_id, tunnel->tunnel_id);\n \tRTE_VERIFY(!__atomic_load_n(&tunnel->refctn, __ATOMIC_RELAXED));\n-\tLIST_REMOVE(tunnel, chain);\n \tmlx5_ipool_free(priv->sh->ipool[MLX5_IPOOL_TUNNEL_ID],\n \t\t\ttunnel->tunnel_id);\n \tmlx5_hlist_destroy(tunnel->groups);\n@@ -8029,6 +8040,7 @@ struct mlx5_meter_domains_infos *\n \tstruct mlx5_flow_tunnel_hub *thub = mlx5_tunnel_hub(dev);\n \tstruct mlx5_flow_tunnel *tun;\n \n+\trte_spinlock_lock(&thub->sl);\n \tLIST_FOREACH(tun, &thub->tunnels, chain) {\n \t\tif (!memcmp(app_tunnel, &tun->app_tunnel,\n \t\t\t sizeof(*app_tunnel))) {\n@@ -8046,6 +8058,7 @@ struct mlx5_meter_domains_infos *\n \t\t\tret = -ENOMEM;\n \t\t}\n \t}\n+\trte_spinlock_unlock(&thub->sl);\n \tif (tun)\n \t\t__atomic_add_fetch(&tun->refctn, 1, __ATOMIC_RELAXED);\n \n@@ -8074,6 +8087,7 @@ int mlx5_alloc_tunnel_hub(struct mlx5_dev_ctx_shared *sh)\n \tif (!thub)\n \t\treturn -ENOMEM;\n \tLIST_INIT(&thub->tunnels);\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,\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 4a8c2bf..8ef2a85 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -945,6 +945,7 @@ struct mlx5_flow_tunnel {\n /** PMD tunnel related context */\n struct mlx5_flow_tunnel_hub {\n \tLIST_HEAD(, mlx5_flow_tunnel) tunnels;\n+\trte_spinlock_t sl;\t\t\t/* Tunnel list spinlock. */\n \tstruct mlx5_hlist *groups;\t\t/** non tunnel groups */\n };\n \n", "prefixes": [ "v5", "32/34" ] }{ "id": 82570, "url": "