get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 138012,
    "url": "https://patches.dpdk.org/api/patches/138012/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240306101335.246097-1-aomeryamac@gmail.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": "<20240306101335.246097-1-aomeryamac@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240306101335.246097-1-aomeryamac@gmail.com",
    "date": "2024-03-06T10:13:35",
    "name": "[v3] lib/hash: add defer queue reclaim API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "7db660f8cd3951e5a906e11221c37799211f73dc",
    "submitter": {
        "id": 3080,
        "url": "https://patches.dpdk.org/api/people/3080/?format=api",
        "name": "Abdullah Ömer Yamaç",
        "email": "aomeryamac@gmail.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20240306101335.246097-1-aomeryamac@gmail.com/mbox/",
    "series": [
        {
            "id": 31395,
            "url": "https://patches.dpdk.org/api/series/31395/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31395",
            "date": "2024-03-06T10:13:35",
            "name": "[v3] lib/hash: add defer queue reclaim API",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/31395/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/138012/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/138012/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id F160443C58;\n\tWed,  6 Mar 2024 11:13:39 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D566D40276;\n\tWed,  6 Mar 2024 11:13:39 +0100 (CET)",
            "from mail-ej1-f41.google.com (mail-ej1-f41.google.com\n [209.85.218.41]) by mails.dpdk.org (Postfix) with ESMTP id 1351640275\n for <dev@dpdk.org>; Wed,  6 Mar 2024 11:13:39 +0100 (CET)",
            "by mail-ej1-f41.google.com with SMTP id\n a640c23a62f3a-a458850dbddso310193866b.0\n for <dev@dpdk.org>; Wed, 06 Mar 2024 02:13:39 -0800 (PST)",
            "from dcu.otaknetworks.com ([212.156.37.190])\n by smtp.gmail.com with ESMTPSA id\n g7-20020a170906198700b00a4503a78dd5sm4317475ejd.17.2024.03.06.02.13.37\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 06 Mar 2024 02:13:37 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1709720018; x=1710324818; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=E5PUlpR1MuBM/aZXeLUueveJ5c1JpiE8DtGVjX8r+fc=;\n b=Q9zbtt7EEvOxxJgMS3BGpw+BbSOOZgsIyKhzkX0ADefQT/eAtHj0hw62DJDaxS6sCD\n 8HX3LJItDoyEmVaFcQ04PSUk+hxpKlfE9+SiDyRCpjyRRixUIFmgQU5VJGdsUTaEBcXZ\n 5ddHsoiFC3yJhWe3k9eIaSsJrg53jbQHqsOXzRF/GVueEjbDvZ17rFzZ+SWBR8uwX+3m\n wzcdM0yIiBxBEpfKDcfE2DeKjW8hDa+f9qEUu8wcwLTqDGUv6qrWjkcvFNCIJabNtJai\n BfNtfKtr9VOFFbyE3K777NNjoaM2ZmdrNNi9EtSuTm533gmwrMqoHLYO1Mk0lSaiuAqX\n zFUg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1709720018; x=1710324818;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=E5PUlpR1MuBM/aZXeLUueveJ5c1JpiE8DtGVjX8r+fc=;\n b=cPZDYfwoOpGK90OOGAJPe4qt+jEuS7DHxOEpGTFI3y5HXztWQZi6CmwOgvduHBHgC9\n OMRwtG4jUretjjZRqy/fMe/YKngEQIrcyyzP+baby/iw6C790fi6xPgBQ47kZQUHHBuF\n 0zi9HgqYid8pSLtqetZGPsnj6W5zyz7pxqcs1EjL4oIMYVLQaCM1L6cWb33NSzEaW4TB\n /35WJ7rkV0dmaGoxlS3STiuY0gl73zo9a9rrVWwO3dhH83UPupCv/6uKYlXYflWEV0Ne\n GHYpyyXe0HT8Ea/+yB8YPnztYBQCfho6TFeX7vpzuTRgMgTICAbiuH5JVzC0yORZkHkV\n c4Vg==",
        "X-Gm-Message-State": "AOJu0YxB3t3kHC/OE8axJp/UM3NIrWvWDnI643mdyzwqf1WwfXLiXITb\n saZiMPLZ2ca3t6Tko75N0EXVMGqLc6P67Gxf9Bds3mkw7V0f1WSgqkz6ES2WVPA=",
        "X-Google-Smtp-Source": "\n AGHT+IHPgnHTTH2q9FKqHzWPP0qpITEm5VG2iCdA5BiOl+AbFhNJLlXLhT76nWR78JTdIPFSlTZkGQ==",
        "X-Received": "by 2002:a17:906:4a55:b0:a44:978b:534a with SMTP id\n a21-20020a1709064a5500b00a44978b534amr9286959ejv.64.1709720018213;\n Wed, 06 Mar 2024 02:13:38 -0800 (PST)",
        "From": "=?utf-8?b?QWJkdWxsYWggw5ZtZXIgWWFtYcOn?= <aomeryamac@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "=?utf-8?b?QWJkdWxsYWggw5ZtZXIgWWFtYcOn?= <aomeryamac@gmail.com>",
        "Subject": "[PATCH v3] lib/hash: add defer queue reclaim API",
        "Date": "Wed,  6 Mar 2024 10:13:35 +0000",
        "Message-Id": "<20240306101335.246097-1-aomeryamac@gmail.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<2EAE263E-7275-432B-B06A-C50CCFD78DE4@arm.com>",
        "References": "<2EAE263E-7275-432B-B06A-C50CCFD78DE4@arm.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "This patch adds a new feature to the hash library to allow the user to\nreclaim the defer queue. This is useful when the user wants to force\nreclaim resources that are not being used. This API is only available\nif the RCU is enabled.\n\nSigned-off-by: Abdullah Ömer Yamaç <aomeryamac@gmail.com>\n---\n lib/hash/rte_cuckoo_hash.c | 23 +++++++++++++++++++++++\n lib/hash/rte_hash.h        | 24 ++++++++++++++++++++++++\n lib/hash/version.map       |  6 ++++++\n 3 files changed, 53 insertions(+)",
    "diff": "diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c\nindex 9cf94645f6..1c360fa38b 100644\n--- a/lib/hash/rte_cuckoo_hash.c\n+++ b/lib/hash/rte_cuckoo_hash.c\n@@ -1588,6 +1588,29 @@ rte_hash_rcu_qsbr_add(struct rte_hash *h, struct rte_hash_rcu_config *cfg)\n \treturn 0;\n }\n \n+int\n+rte_hash_rcu_qsbr_dq_reclaim(struct rte_hash *h, unsigned int *freed,\n+\t\tunsigned int *pending, unsigned int *available)\n+{\n+\tint ret;\n+\n+\tif (h->hash_rcu_cfg == NULL) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n+\n+\tret = rte_rcu_qsbr_dq_reclaim(h->dq, h->hash_rcu_cfg->max_reclaim_size,\n+\t\t\t\t\t\t\tfreed, pending, available);\n+\tif (ret != 0) {\n+\t\tHASH_LOG(ERR,\n+\t\t\t\"%s: could not reclaim the defer queue in hash table\",\n+\t\t\t\t__func__);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static inline void\n remove_entry(const struct rte_hash *h, struct rte_hash_bucket *bkt,\n \t\tunsigned int i)\ndiff --git a/lib/hash/rte_hash.h b/lib/hash/rte_hash.h\nindex 7ecc021111..edfa262aca 100644\n--- a/lib/hash/rte_hash.h\n+++ b/lib/hash/rte_hash.h\n@@ -674,6 +674,30 @@ rte_hash_iterate(const struct rte_hash *h, const void **key, void **data, uint32\n  */\n int rte_hash_rcu_qsbr_add(struct rte_hash *h, struct rte_hash_rcu_config *cfg);\n \n+/**\n+ * Reclaim resources from the defer queue.\n+ * This API reclaim the resources from the defer queue if rcu is enabled.\n+ *\n+ * @param h\n+ *   The hash object to reclaim resources.\n+ * @param freed\n+ *   Number of resources that were freed.\n+ * @param pending\n+ *   Number of resources pending on the defer queue.\n+ *   This number might not be accurate if multi-thread safety is configured.\n+ * @param available\n+ *   Number of resources that can be added to the defer queue.\n+ *   This number might not be accurate if multi-thread safety is configured.\n+ * @return\n+ *   On success - 0\n+ *   On error - 1 with error code set in rte_errno.\n+ *   Possible rte_errno codes are:\n+ *   - EINVAL - invalid pointer\n+ */\n+__rte_experimental\n+int rte_hash_rcu_qsbr_dq_reclaim(struct rte_hash *h, unsigned int *freed,\n+\t\tunsigned int *pending, unsigned int *available);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/hash/version.map b/lib/hash/version.map\nindex 6b2afebf6b..fac7f81e6f 100644\n--- a/lib/hash/version.map\n+++ b/lib/hash/version.map\n@@ -48,3 +48,9 @@ DPDK_24 {\n \n \tlocal: *;\n };\n+\n+EXPERIMENTAL {\n+\tglobal:\n+\n+\trte_hash_rcu_qsbr_dq_reclaim;\n+};\n\\ No newline at end of file\n",
    "prefixes": [
        "v3"
    ]
}