get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 82560,
    "url": "https://patches.dpdk.org/api/patches/82560/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1603875616-272798-10-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-10-git-send-email-suanmingm@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1603875616-272798-10-git-send-email-suanmingm@nvidia.com",
    "date": "2020-10-28T08:59:50",
    "name": "[v5,09/34] net/mlx5: create global jump action",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "779d7b94643f4c74ce69e554926554f04f3f2aad",
    "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-10-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/82560/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/82560/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 D2F5FA04DD;\n\tWed, 28 Oct 2020 10:07:45 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2661FC8F8;\n\tWed, 28 Oct 2020 10:03:36 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 7B32BBE67\n for <dev@dpdk.org>; Wed, 28 Oct 2020 10:02:19 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n suanmingm@nvidia.com) with SMTP; 28 Oct 2020 11:00:49 +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 09S90Jm9024495;\n Wed, 28 Oct 2020 11:00:41 +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 16:59:50 +0800",
        "Message-Id": "<1603875616-272798-10-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 09/34] 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 | 56 +++++++++++++----------------------------\n 2 files changed, 17 insertions(+), 41 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex fde5007..cc64792 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -484,8 +484,6 @@ struct mlx5_flow_dv_modify_hdr_resource {\n \n /* Jump action resource structure. */\n struct mlx5_flow_dv_jump_tbl_resource {\n-\tuint32_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 bfcba45..d343e42 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -2939,31 +2939,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 = __atomic_load_n(&tbl_data->jump.refcnt, __ATOMIC_ACQUIRE);\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-\t__atomic_fetch_add(&tbl_data->jump.refcnt, 1, __ATOMIC_RELEASE);\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@@ -8064,8 +8046,20 @@ struct field_modify_info modify_tcp[] = {\n \t * count before insert it into the hash list.\n \t */\n \t__atomic_store_n(&tbl->refcnt, 0, __ATOMIC_RELAXED);\n-\t/* Jump action reference count is initialized here. */\n-\t__atomic_store_n(&tbl_data->jump.refcnt, 0, __ATOMIC_RELAXED);\n+\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@@ -10548,29 +10542,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\t__atomic_load_n(&cache_resource->refcnt, __ATOMIC_RELAXED));\n-\tif (__atomic_sub_fetch(&cache_resource->refcnt, 1,\n-\t\t\t       __ATOMIC_RELAXED) == 0) {\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": [
        "v5",
        "09/34"
    ]
}