Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/82296/?format=api
https://patches.dpdk.org/api/patches/82296/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1603801650-442376-12-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": "<1603801650-442376-12-git-send-email-suanmingm@nvidia.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1603801650-442376-12-git-send-email-suanmingm@nvidia.com", "date": "2020-10-27T12:27:06", "name": "[v3,11/34] net/mlx5: create global drop action", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "66b416364a36a2c80c0d70840d05c19b5ff5e629", "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/1603801650-442376-12-git-send-email-suanmingm@nvidia.com/mbox/", "series": [ { "id": 13372, "url": "https://patches.dpdk.org/api/series/13372/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13372", "date": "2020-10-27T12:26:55", "name": "net/mlx5: support multiple-thread flow operations", "version": 3, "mbox": "https://patches.dpdk.org/series/13372/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/82296/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/82296/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 972BBA04B5;\n\tTue, 27 Oct 2020 13:30:56 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0083B2C55;\n\tTue, 27 Oct 2020 13:29:01 +0100 (CET)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 8BB553253\n for <dev@dpdk.org>; Tue, 27 Oct 2020 13:27:58 +0100 (CET)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n suanmingm@nvidia.com) with SMTP; 27 Oct 2020 14:27:56 +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 09RCRZ79024637;\n Tue, 27 Oct 2020 14:27:55 +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", "Date": "Tue, 27 Oct 2020 20:27:06 +0800", "Message-Id": "<1603801650-442376-12-git-send-email-suanmingm@nvidia.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1603801650-442376-1-git-send-email-suanmingm@nvidia.com>", "References": "<1601984948-313027-1-git-send-email-suanmingm@nvidia.com>\n <1603801650-442376-1-git-send-email-suanmingm@nvidia.com>", "Subject": "[dpdk-dev] [PATCH v3 11/34] net/mlx5: create global drop action", "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 creates the global drop action for flows instead of\nmaintain it in flow insertion time. The uniqueu global drop action\nmakes it thread safe.\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 | 2 ++\n drivers/net/mlx5/mlx5_flow_dv.c | 38 +++++++----------------------------\n drivers/net/mlx5/mlx5_flow_verbs.c | 41 +++++++++++---------------------------\n 4 files changed, 26 insertions(+), 60 deletions(-)", "diff": "diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c\nindex ae735a3..b12d1d5 100644\n--- a/drivers/net/mlx5/linux/mlx5_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_os.c\n@@ -1424,6 +1424,9 @@\n \t} else {\n \t\tpriv->obj_ops = ibv_obj_ops;\n \t}\n+\tpriv->drop_queue.hrxq = mlx5_drop_action_create(eth_dev);\n+\tif (!priv->drop_queue.hrxq)\n+\t\tgoto error;\n \t/* Supported Verbs flow priority number detection. */\n \terr = mlx5_flow_discover_priorities(eth_dev);\n \tif (err < 0) {\n@@ -1489,6 +1492,8 @@\n \t\t\tclose(priv->nl_socket_rdma);\n \t\tif (priv->vmwa_context)\n \t\t\tmlx5_vlan_vmwa_exit(priv->vmwa_context);\n+\t\tif (eth_dev && priv->drop_queue.hrxq)\n+\t\t\tmlx5_drop_action_destroy(eth_dev);\n \t\tif (own_domain_id)\n \t\t\tclaim_zero(rte_eth_switch_domain_free(priv->domain_id));\n \t\tmlx5_free(priv);\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex db0243f..307d279 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -1311,6 +1311,8 @@ struct mlx5_dev_ctx_shared *\n \t\tpriv->txqs = NULL;\n \t}\n \tmlx5_proc_priv_uninit(dev);\n+\tif (priv->drop_queue.hrxq)\n+\t\tmlx5_drop_action_destroy(dev);\n \tif (priv->mreg_cp_tbl)\n \t\tmlx5_hlist_destroy(priv->mreg_cp_tbl, NULL, NULL);\n \tmlx5_mprq_free_mp(dev);\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex b28cc6d..50e8ff4 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -10310,24 +10310,9 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tif (dv->transfer) {\n \t\t\t\tdv->actions[n++] = priv->sh->esw_drop_action;\n \t\t\t} else {\n-\t\t\t\tstruct mlx5_hrxq *drop_hrxq;\n-\t\t\t\tdrop_hrxq = mlx5_drop_action_create(dev);\n-\t\t\t\tif (!drop_hrxq) {\n-\t\t\t\t\trte_flow_error_set\n-\t\t\t\t\t\t(error, errno,\n-\t\t\t\t\t\t RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n-\t\t\t\t\t\t NULL,\n-\t\t\t\t\t\t \"cannot get drop hash queue\");\n-\t\t\t\t\tgoto error;\n-\t\t\t\t}\n-\t\t\t\t/*\n-\t\t\t\t * Drop queues will be released by the specify\n-\t\t\t\t * mlx5_drop_action_destroy() function. Assign\n-\t\t\t\t * the special index to hrxq to mark the queue\n-\t\t\t\t * has been allocated.\n-\t\t\t\t */\n-\t\t\t\tdh->rix_hrxq = UINT32_MAX;\n-\t\t\t\tdv->actions[n++] = drop_hrxq->action;\n+\t\t\t\tMLX5_ASSERT(priv->drop_queue.hrxq);\n+\t\t\t\tdv->actions[n++] =\n+\t\t\t\t\t\tpriv->drop_queue.hrxq->action;\n \t\t\t}\n \t\t} else if (dh->fate_action == MLX5_FLOW_FATE_QUEUE &&\n \t\t\t !dv_h->rix_sample && !dv_h->rix_dest_array) {\n@@ -10381,14 +10366,9 @@ struct field_modify_info modify_tcp[] = {\n \tSILIST_FOREACH(priv->sh->ipool[MLX5_IPOOL_MLX5_FLOW], flow->dev_handles,\n \t\t handle_idx, dh, next) {\n \t\t/* hrxq is union, don't clear it if the flag is not set. */\n-\t\tif (dh->rix_hrxq) {\n-\t\t\tif (dh->fate_action == MLX5_FLOW_FATE_DROP) {\n-\t\t\t\tmlx5_drop_action_destroy(dev);\n-\t\t\t\tdh->rix_hrxq = 0;\n-\t\t\t} else if (dh->fate_action == MLX5_FLOW_FATE_QUEUE) {\n-\t\t\t\tmlx5_hrxq_release(dev, dh->rix_hrxq);\n-\t\t\t\tdh->rix_hrxq = 0;\n-\t\t\t}\n+\t\tif (dh->fate_action == MLX5_FLOW_FATE_QUEUE && dh->rix_hrxq) {\n+\t\t\tmlx5_hrxq_release(dev, dh->rix_hrxq);\n+\t\t\tdh->rix_hrxq = 0;\n \t\t}\n \t\tif (dh->vf_vlan.tag && dh->vf_vlan.created)\n \t\t\tmlx5_vlan_vmwa_release(dev, &dh->vf_vlan);\n@@ -10630,9 +10610,6 @@ struct field_modify_info modify_tcp[] = {\n \tif (!handle->rix_fate)\n \t\treturn;\n \tswitch (handle->fate_action) {\n-\tcase MLX5_FLOW_FATE_DROP:\n-\t\tmlx5_drop_action_destroy(dev);\n-\t\tbreak;\n \tcase MLX5_FLOW_FATE_QUEUE:\n \t\tmlx5_hrxq_release(dev, handle->rix_hrxq);\n \t\tbreak;\n@@ -10812,8 +10789,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tclaim_zero(mlx5_flow_os_destroy_flow(dh->drv_flow));\n \t\t\tdh->drv_flow = NULL;\n \t\t}\n-\t\tif (dh->fate_action == MLX5_FLOW_FATE_DROP ||\n-\t\t dh->fate_action == MLX5_FLOW_FATE_QUEUE)\n+\t\tif (dh->fate_action == MLX5_FLOW_FATE_QUEUE)\n \t\t\tflow_dv_fate_resource_release(dev, dh);\n \t\tif (dh->vf_vlan.tag && dh->vf_vlan.created)\n \t\t\tmlx5_vlan_vmwa_release(dev, &dh->vf_vlan);\ndiff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c\nindex 052cfd4..ba6731a 100644\n--- a/drivers/net/mlx5/mlx5_flow_verbs.c\n+++ b/drivers/net/mlx5/mlx5_flow_verbs.c\n@@ -72,12 +72,12 @@\n \t\t},\n \t};\n \tstruct ibv_flow *flow;\n-\tstruct mlx5_hrxq *drop = mlx5_drop_action_create(dev);\n+\tstruct mlx5_hrxq *drop = priv->drop_queue.hrxq;\n \tuint16_t vprio[] = { 8, 16 };\n \tint i;\n \tint priority = 0;\n \n-\tif (!drop) {\n+\tif (!drop->qp) {\n \t\trte_errno = ENOTSUP;\n \t\treturn -rte_errno;\n \t}\n@@ -89,7 +89,6 @@\n \t\tclaim_zero(mlx5_glue->destroy_flow(flow));\n \t\tpriority = vprio[i];\n \t}\n-\tmlx5_drop_action_destroy(dev);\n \tswitch (priority) {\n \tcase 8:\n \t\tpriority = RTE_DIM(priority_map_3);\n@@ -1881,15 +1880,10 @@\n \t\t\thandle->drv_flow = NULL;\n \t\t}\n \t\t/* hrxq is union, don't touch it only the flag is set. */\n-\t\tif (handle->rix_hrxq) {\n-\t\t\tif (handle->fate_action == MLX5_FLOW_FATE_DROP) {\n-\t\t\t\tmlx5_drop_action_destroy(dev);\n-\t\t\t\thandle->rix_hrxq = 0;\n-\t\t\t} else if (handle->fate_action ==\n-\t\t\t\t MLX5_FLOW_FATE_QUEUE) {\n-\t\t\t\tmlx5_hrxq_release(dev, handle->rix_hrxq);\n-\t\t\t\thandle->rix_hrxq = 0;\n-\t\t\t}\n+\t\tif (handle->rix_hrxq &&\n+\t\t handle->fate_action == MLX5_FLOW_FATE_QUEUE) {\n+\t\t\tmlx5_hrxq_release(dev, handle->rix_hrxq);\n+\t\t\thandle->rix_hrxq = 0;\n \t\t}\n \t\tif (handle->vf_vlan.tag && handle->vf_vlan.created)\n \t\t\tmlx5_vlan_vmwa_release(dev, &handle->vf_vlan);\n@@ -1961,14 +1955,8 @@\n \t\tdev_flow = &wks->flows[idx];\n \t\thandle = dev_flow->handle;\n \t\tif (handle->fate_action == MLX5_FLOW_FATE_DROP) {\n-\t\t\thrxq = mlx5_drop_action_create(dev);\n-\t\t\tif (!hrxq) {\n-\t\t\t\trte_flow_error_set\n-\t\t\t\t\t(error, errno,\n-\t\t\t\t\t RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n-\t\t\t\t\t \"cannot get drop hash queue\");\n-\t\t\t\tgoto error;\n-\t\t\t}\n+\t\t\tMLX5_ASSERT(priv->drop_queue.hrxq);\n+\t\t\thrxq = priv->drop_queue.hrxq;\n \t\t} else {\n \t\t\tuint32_t hrxq_idx;\n \t\t\tstruct mlx5_flow_rss_desc *rss_desc =\n@@ -2028,15 +2016,10 @@\n \tSILIST_FOREACH(priv->sh->ipool[MLX5_IPOOL_MLX5_FLOW], flow->dev_handles,\n \t\t dev_handles, handle, next) {\n \t\t/* hrxq is union, don't touch it only the flag is set. */\n-\t\tif (handle->rix_hrxq) {\n-\t\t\tif (handle->fate_action == MLX5_FLOW_FATE_DROP) {\n-\t\t\t\tmlx5_drop_action_destroy(dev);\n-\t\t\t\thandle->rix_hrxq = 0;\n-\t\t\t} else if (handle->fate_action ==\n-\t\t\t\t MLX5_FLOW_FATE_QUEUE) {\n-\t\t\t\tmlx5_hrxq_release(dev, handle->rix_hrxq);\n-\t\t\t\thandle->rix_hrxq = 0;\n-\t\t\t}\n+\t\tif (handle->rix_hrxq &&\n+\t\t handle->fate_action == MLX5_FLOW_FATE_QUEUE) {\n+\t\t\tmlx5_hrxq_release(dev, handle->rix_hrxq);\n+\t\t\thandle->rix_hrxq = 0;\n \t\t}\n \t\tif (handle->vf_vlan.tag && handle->vf_vlan.created)\n \t\t\tmlx5_vlan_vmwa_release(dev, &handle->vf_vlan);\n", "prefixes": [ "v3", "11/34" ] }{ "id": 82296, "url": "