get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 79776,
    "url": "http://patches.dpdk.org/api/patches/79776/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1601984948-313027-23-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-23-git-send-email-suanmingm@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1601984948-313027-23-git-send-email-suanmingm@nvidia.com",
    "date": "2020-10-06T11:49:05",
    "name": "[22/25] net/mlx5: create global drop action",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cf12f22b84cb57ecd3ecbff70aabf8f9c25f6e52",
    "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-23-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/79776/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/79776/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 289A2A04BB;\n\tTue,  6 Oct 2020 13:57:41 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DDA161BC22;\n\tTue,  6 Oct 2020 13:49:59 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 8CC6A1BBD6\n for <dev@dpdk.org>; Tue,  6 Oct 2020 13:49:55 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n suanmingm@nvidia.com) with SMTP; 6 Oct 2020 14:49:52 +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 096BnC0g028553;\n Tue, 6 Oct 2020 14:49:51 +0300"
        ],
        "From": "Suanming Mou <suanmingm@nvidia.com>",
        "To": "viacheslavo@nvidia.com, matan@nvidia.com",
        "Cc": "rasland@nvidia.com, dev@dpdk.org",
        "Date": "Tue,  6 Oct 2020 19:49:05 +0800",
        "Message-Id": "<1601984948-313027-23-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 22/25] 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 instread 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>\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    | 31 +++++++------------------------\n drivers/net/mlx5/mlx5_flow_verbs.c | 35 ++++++++++++-----------------------\n 4 files changed, 26 insertions(+), 47 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c\nindex f0470a2..c3dda27 100644\n--- a/drivers/net/mlx5/linux/mlx5_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_os.c\n@@ -1331,6 +1331,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@@ -1401,6 +1404,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 (priv->default_miss_action)\n \t\t\tmlx5_glue->destroy_flow_action\n \t\t\t\t\t(priv->default_miss_action);\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 1d57d16..d2b3cf1 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -1203,6 +1203,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->default_miss_action)\n \t\tmlx5_glue->destroy_flow_action(priv->default_miss_action);\n \tif (priv->mreg_cp_tbl)\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 80df066..ff91c8b 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -8951,9 +8951,7 @@ struct mlx5_hlist_entry *\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\tif (!priv->drop_queue.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@@ -8961,14 +8959,8 @@ struct mlx5_hlist_entry *\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\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\tstruct mlx5_hrxq *hrxq;\n@@ -9030,14 +9022,9 @@ struct mlx5_hlist_entry *\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@@ -9280,9 +9267,6 @@ struct mlx5_hlist_entry *\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@@ -9327,8 +9311,7 @@ struct mlx5_hlist_entry *\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 905da8a..e8a704b 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@@ -1890,15 +1889,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@@ -1970,8 +1964,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\thrxq = priv->drop_queue.hrxq;\n+\t\t\tif (hrxq->qp) {\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@@ -2027,15 +2021,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": [
        "22/25"
    ]
}