get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81878,
    "url": "http://patches.dpdk.org/api/patches/81878/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1603437295-119083-10-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": "<1603437295-119083-10-git-send-email-suanmingm@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1603437295-119083-10-git-send-email-suanmingm@nvidia.com",
    "date": "2020-10-23T07:14:39",
    "name": "[v2,09/25] net/mlx5: create global jump action",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "88edc9b187198517c668edbda111c34186c93af4",
    "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/1603437295-119083-10-git-send-email-suanmingm@nvidia.com/mbox/",
    "series": [
        {
            "id": 13250,
            "url": "http://patches.dpdk.org/api/series/13250/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13250",
            "date": "2020-10-23T07:14:30",
            "name": "*net/mlx5: support multiple-thread flow operations",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/13250/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/81878/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/81878/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 E4FF9A04DE;\n\tFri, 23 Oct 2020 09:19:03 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A2BD9A8F2;\n\tFri, 23 Oct 2020 09:15:52 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 5568172E3\n for <dev@dpdk.org>; Fri, 23 Oct 2020 09:15:25 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n suanmingm@nvidia.com) with SMTP; 23 Oct 2020 10:15:20 +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 09N7F2LS026736;\n Fri, 23 Oct 2020 10:15:19 +0300"
        ],
        "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": "Fri, 23 Oct 2020 15:14:39 +0800",
        "Message-Id": "<1603437295-119083-10-git-send-email-suanmingm@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1603437295-119083-1-git-send-email-suanmingm@nvidia.com>",
        "References": "<1601984948-313027-1-git-send-email-suanmingm@nvidia.com>\n <1603437295-119083-1-git-send-email-suanmingm@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH v2 09/25] net/mlx5: create global jump 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 changes the jump action in table to be created with table\ncreation in advanced. In this case, the jump action is safe to be used\nin multiple thread. The jump action will be destroyed when table is not\nused anymore and released.\n\nSigned-off-by: Suanming Mou <suanmingm@nvidia.com>\nAcked-by: Matan Azrad <matan@nvidia.com>\n---\n drivers/net/mlx5/mlx5_flow.h    |  2 --\n drivers/net/mlx5/mlx5_flow_dv.c | 54 ++++++++++++-----------------------------\n 2 files changed, 16 insertions(+), 40 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 637922e..3d325b2 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -481,8 +481,6 @@ struct mlx5_flow_dv_modify_hdr_resource {\n \n /* Jump action resource structure. */\n struct mlx5_flow_dv_jump_tbl_resource {\n-\trte_atomic32_t refcnt; /**< Reference counter. */\n-\tuint8_t ft_type; /**< Flow table type, Rx or Tx. */\n \tvoid *action; /**< Pointer to the rdma core action. */\n };\n \ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex df36a24..3f5a270 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -2936,31 +2936,13 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t(struct rte_eth_dev *dev __rte_unused,\n \t\t\t struct mlx5_flow_tbl_resource *tbl,\n \t\t\t struct mlx5_flow *dev_flow,\n-\t\t\t struct rte_flow_error *error)\n+\t\t\t struct rte_flow_error *error __rte_unused)\n {\n \tstruct mlx5_flow_tbl_data_entry *tbl_data =\n \t\tcontainer_of(tbl, struct mlx5_flow_tbl_data_entry, tbl);\n-\tint cnt, ret;\n \n \tMLX5_ASSERT(tbl);\n-\tcnt = rte_atomic32_read(&tbl_data->jump.refcnt);\n-\tif (!cnt) {\n-\t\tret = mlx5_flow_os_create_flow_action_dest_flow_tbl\n-\t\t\t\t(tbl->obj, &tbl_data->jump.action);\n-\t\tif (ret)\n-\t\t\treturn rte_flow_error_set(error, ENOMEM,\n-\t\t\t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n-\t\t\t\t\tNULL, \"cannot create jump action\");\n-\t\tDRV_LOG(DEBUG, \"new jump table resource %p: refcnt %d++\",\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\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-\t}\n-\trte_atomic32_inc(&tbl_data->jump.refcnt);\n+\tMLX5_ASSERT(tbl_data->jump.action);\n \tdev_flow->handle->rix_jump = tbl_data->idx;\n \tdev_flow->dv.jump = &tbl_data->jump;\n \treturn 0;\n@@ -7935,8 +7917,19 @@ struct field_modify_info modify_tcp[] = {\n \t * count before insert it into the hash list.\n \t */\n \trte_atomic32_init(&tbl->refcnt);\n-\t/* Jump action reference count is initialized here. */\n-\trte_atomic32_init(&tbl_data->jump.refcnt);\n+\tif (table_id) {\n+\t\tret = mlx5_flow_os_create_flow_action_dest_flow_tbl\n+\t\t\t\t\t(tbl->obj, &tbl_data->jump.action);\n+\t\tif (ret) {\n+\t\t\trte_flow_error_set(error, ENOMEM,\n+\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t\t\t   NULL,\n+\t\t\t\t\t   \"cannot create flow jump action\");\n+\t\t\tmlx5_flow_os_destroy_flow_tbl(tbl->obj);\n+\t\t\tmlx5_ipool_free(sh->ipool[MLX5_IPOOL_JUMP], idx);\n+\t\t\treturn NULL;\n+\t\t}\n+\t}\n \tpos->key = table_key.v64;\n \tret = mlx5_hlist_insert(sh->flow_tbls, pos);\n \tif (ret < 0) {\n@@ -10193,28 +10186,13 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t  struct mlx5_flow_handle *handle)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n-\tstruct mlx5_flow_dv_jump_tbl_resource *cache_resource;\n \tstruct mlx5_flow_tbl_data_entry *tbl_data;\n \n \ttbl_data = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_JUMP],\n \t\t\t     handle->rix_jump);\n \tif (!tbl_data)\n \t\treturn 0;\n-\tcache_resource = &tbl_data->jump;\n-\tMLX5_ASSERT(cache_resource->action);\n-\tDRV_LOG(DEBUG, \"jump table resource %p: refcnt %d--\",\n-\t\t(void *)cache_resource,\n-\t\trte_atomic32_read(&cache_resource->refcnt));\n-\tif (rte_atomic32_dec_and_test(&cache_resource->refcnt)) {\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\tDRV_LOG(DEBUG, \"jump table resource %p: removed\",\n-\t\t\t(void *)cache_resource);\n-\t\treturn 0;\n-\t}\n-\treturn 1;\n+\treturn flow_dv_tbl_resource_release(dev, &tbl_data->tbl);\n }\n \n /**\n",
    "prefixes": [
        "v2",
        "09/25"
    ]
}