get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 65078,
    "url": "http://patchwork.dpdk.org/api/patches/65078/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1579759262-189720-2-git-send-email-suanmingm@mellanox.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<1579759262-189720-2-git-send-email-suanmingm@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1579759262-189720-2-git-send-email-suanmingm@mellanox.com",
    "date": "2020-01-23T06:01:01",
    "name": "[1/2] net/mlx5: support maximum id in id allocate",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ad91bcdf71c24bac4aa765ae91018fc8b391d981",
    "submitter": {
        "id": 1358,
        "url": "http://patchwork.dpdk.org/api/people/1358/?format=api",
        "name": "Suanming Mou",
        "email": "suanmingm@mellanox.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patchwork.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1579759262-189720-2-git-send-email-suanmingm@mellanox.com/mbox/",
    "series": [
        {
            "id": 8273,
            "url": "http://patchwork.dpdk.org/api/series/8273/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=8273",
            "date": "2020-01-23T06:01:00",
            "name": "fix incorrect register usage in meter",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/8273/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/65078/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/65078/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 A67DFA0538;\n\tThu, 23 Jan 2020 07:01:27 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2F8223977;\n\tThu, 23 Jan 2020 07:01:18 +0100 (CET)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id DEA2AE07\n for <dev@dpdk.org>; Thu, 23 Jan 2020 07:01:15 +0100 (CET)"
        ],
        "From": "Suanming Mou <suanmingm@mellanox.com>",
        "To": "Matan Azrad <matan@mellanox.com>, Shahaf Shuler <shahafs@mellanox.com>,\n Viacheslav Ovsiienko <viacheslavo@mellanox.com>",
        "Cc": "dev@dpdk.org",
        "Date": "Thu, 23 Jan 2020 08:01:01 +0200",
        "Message-Id": "<1579759262-189720-2-git-send-email-suanmingm@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1579759262-189720-1-git-send-email-suanmingm@mellanox.com>",
        "References": "<1579759262-189720-1-git-send-email-suanmingm@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 1/2] net/mlx5: support maximum id in id allocate",
        "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": "The id allocated is for the register unique id match. Some registers may\nnot use the full 32 bits. Add the maximum id to avoid allocate id over\nthe register restriction.\n\nSigned-off-by: Suanming Mou <suanmingm@mellanox.com>\nAcked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/net/mlx5/mlx5.c      | 12 ++++++++----\n drivers/net/mlx5/mlx5.h      |  1 +\n drivers/net/mlx5/mlx5_flow.h |  2 +-\n 3 files changed, 10 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex ffee39c..2c9f705 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -196,11 +196,14 @@ struct mlx5_dev_spawn_data {\n /**\n  * Allocate ID pool structure.\n  *\n+ * @param[in] max_id\n+ *   The maximum id can be allocated from the pool.\n+ *\n  * @return\n  *   Pointer to pool object, NULL value otherwise.\n  */\n struct mlx5_flow_id_pool *\n-mlx5_flow_id_pool_alloc(void)\n+mlx5_flow_id_pool_alloc(uint32_t max_id)\n {\n \tstruct mlx5_flow_id_pool *pool;\n \tvoid *mem;\n@@ -223,6 +226,7 @@ struct mlx5_flow_id_pool *\n \tpool->curr = pool->free_arr;\n \tpool->last = pool->free_arr + MLX5_FLOW_MIN_ID_POOL_SIZE;\n \tpool->base_index = 0;\n+\tpool->max_id = max_id;\n \treturn pool;\n error:\n \trte_free(pool);\n@@ -257,7 +261,7 @@ struct mlx5_flow_id_pool *\n mlx5_flow_id_get(struct mlx5_flow_id_pool *pool, uint32_t *id)\n {\n \tif (pool->curr == pool->free_arr) {\n-\t\tif (pool->base_index == UINT32_MAX) {\n+\t\tif (pool->base_index == pool->max_id) {\n \t\t\trte_errno  = ENOMEM;\n \t\t\tDRV_LOG(ERR, \"no free id\");\n \t\t\treturn -rte_errno;\n@@ -590,7 +594,7 @@ struct mlx5_flow_id_pool *\n \t\t\tgoto error;\n \t\t}\n \t}\n-\tsh->flow_id_pool = mlx5_flow_id_pool_alloc();\n+\tsh->flow_id_pool = mlx5_flow_id_pool_alloc(UINT32_MAX);\n \tif (!sh->flow_id_pool) {\n \t\tDRV_LOG(ERR, \"can't create flow id pool\");\n \t\terr = ENOMEM;\n@@ -2680,7 +2684,7 @@ struct mlx5_flow_id_pool *\n \t\terr = mlx5_alloc_shared_dr(priv);\n \t\tif (err)\n \t\t\tgoto error;\n-\t\tpriv->qrss_id_pool = mlx5_flow_id_pool_alloc();\n+\t\tpriv->qrss_id_pool = mlx5_flow_id_pool_alloc(UINT32_MAX);\n \t\tif (!priv->qrss_id_pool) {\n \t\t\tDRV_LOG(ERR, \"can't create flow id pool\");\n \t\t\terr = ENOMEM;\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 01542e7..ac86c19 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -630,6 +630,7 @@ struct mlx5_flow_id_pool {\n \t/**< The next index that can be used without any free elements. */\n \tuint32_t *curr; /**< Pointer to the index to pop. */\n \tuint32_t *last; /**< Pointer to the last element in the empty arrray. */\n+\tuint32_t max_id; /**< Maximum id can be allocated from the pool. */\n };\n \n /*\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 9832542..d9f1761 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -749,7 +749,7 @@ struct mlx5_flow_driver_ops {\n \n /* mlx5_flow.c */\n \n-struct mlx5_flow_id_pool *mlx5_flow_id_pool_alloc(void);\n+struct mlx5_flow_id_pool *mlx5_flow_id_pool_alloc(uint32_t max_id);\n void mlx5_flow_id_pool_release(struct mlx5_flow_id_pool *pool);\n uint32_t mlx5_flow_id_get(struct mlx5_flow_id_pool *pool, uint32_t *id);\n uint32_t mlx5_flow_id_release(struct mlx5_flow_id_pool *pool,\n",
    "prefixes": [
        "1/2"
    ]
}