get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 82585,
    "url": "http://patches.dpdk.org/api/patches/82585/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1603877633-293405-12-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": "<1603877633-293405-12-git-send-email-suanmingm@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1603877633-293405-12-git-send-email-suanmingm@nvidia.com",
    "date": "2020-10-28T09:33:30",
    "name": "[v5,11/34] net/mlx5: create global drop action",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "66b416364a36a2c80c0d70840d05c19b5ff5e629",
    "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/1603877633-293405-12-git-send-email-suanmingm@nvidia.com/mbox/",
    "series": [
        {
            "id": 13413,
            "url": "http://patches.dpdk.org/api/series/13413/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13413",
            "date": "2020-10-28T09:33:20",
            "name": "[v5,01/34] net/mlx5: use thread safe index pool for flow objects",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/13413/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/82585/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/82585/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 39BDCA04DD;\n\tWed, 28 Oct 2020 10:37:40 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D2577C96E;\n\tWed, 28 Oct 2020 10:35:01 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id AC730C8E4\n for <dev@dpdk.org>; Wed, 28 Oct 2020 10:34:28 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n suanmingm@nvidia.com) with SMTP; 28 Oct 2020 11:34:24 +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 09S9Y0Rr014036;\n Wed, 28 Oct 2020 11:34:22 +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:33:30 +0800",
        "Message-Id": "<1603877633-293405-12-git-send-email-suanmingm@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1603877633-293405-1-git-send-email-suanmingm@nvidia.com>",
        "References": "<1601984948-313027-1-git-send-email-suanmingm@nvidia.com>\n <1603877633-293405-1-git-send-email-suanmingm@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH v5 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 fa00e45..2ebc179 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -1308,6 +1308,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 34f5608..4322c59 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -10319,24 +10319,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@@ -10390,14 +10375,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@@ -10643,9 +10623,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@@ -10825,8 +10802,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 0ec9acd..3c04727 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@@ -1886,15 +1885,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@@ -1966,14 +1960,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@@ -2033,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": [
        "v5",
        "11/34"
    ]
}