get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 136486,
    "url": "http://patches.dpdk.org/api/patches/136486/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240207153340.34146-1-aomeryamac@gmail.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": "<20240207153340.34146-1-aomeryamac@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240207153340.34146-1-aomeryamac@gmail.com",
    "date": "2024-02-07T15:33:40",
    "name": "lib/hash,lib/rcu: feature hidden key count in hash",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "254e1ff4176840d352cbd36cc1caa5ab34f35660",
    "submitter": {
        "id": 3080,
        "url": "http://patches.dpdk.org/api/people/3080/?format=api",
        "name": "Abdullah Ömer Yamaç",
        "email": "aomeryamac@gmail.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240207153340.34146-1-aomeryamac@gmail.com/mbox/",
    "series": [
        {
            "id": 31038,
            "url": "http://patches.dpdk.org/api/series/31038/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31038",
            "date": "2024-02-07T15:33:40",
            "name": "lib/hash,lib/rcu: feature hidden key count in hash",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/31038/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/136486/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/136486/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 494E243AA0;\n\tWed,  7 Feb 2024 16:33:48 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C2DA5402A9;\n\tWed,  7 Feb 2024 16:33:47 +0100 (CET)",
            "from mail-wr1-f53.google.com (mail-wr1-f53.google.com\n [209.85.221.53]) by mails.dpdk.org (Postfix) with ESMTP id B21C440295\n for <dev@dpdk.org>; Wed,  7 Feb 2024 16:33:46 +0100 (CET)",
            "by mail-wr1-f53.google.com with SMTP id\n ffacd0b85a97d-33929364bdaso523386f8f.2\n for <dev@dpdk.org>; Wed, 07 Feb 2024 07:33:46 -0800 (PST)",
            "from dcu.otaknetworks.com ([212.156.37.190])\n by smtp.gmail.com with ESMTPSA id\n d15-20020a5d644f000000b0033b44a349e1sm1749987wrw.38.2024.02.07.07.33.44\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 07 Feb 2024 07:33:44 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1707320026; x=1707924826; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=OzYi8SFv+Y94QV8kbj5umgrZgmdYndYLW3AhItw/zxE=;\n b=Wyn73YeYFgIrYWIjQWectAaIV6YHPWYphucASpoWwucnc3cCyE8g2C3+yA40W1iX5s\n BSuz8LeQ38PdANy5DOJ7t+xUMJInqTqMfIXa0yFEZtVXF68crEqLldqun49wnGCfuOOO\n 6Oh/6x4i8VJIvjUsmW/oSPqocGUjZOVmGY/nNQAVRpHgziCJAA3L7f0Vo1LUNhSfHaJC\n QZ2a3EhJM7PB1VtqkPQa0pLDP4D1wddL6+4SawRj9V6aPSl+2q7+LtH/bnFrzPUYgMh3\n 2LebyJHZXitf/usMGuawEHCZx+l+2A88Pv+g6u4c1yIRJWS132j7r90A+5zbDxmlCpB0\n FHYw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1707320026; x=1707924826;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=OzYi8SFv+Y94QV8kbj5umgrZgmdYndYLW3AhItw/zxE=;\n b=gbKR0MJaP88Pqq46M5+OlkS6GCw0M/+gHT4shLZddg2e8m5tysDUF+xi1cHP49oAy4\n OajVAtV+iIvFiXtzqxOU1m7CkPPOSA6hCZ3Zf2ROhKOPFqfBqMn2bllZkWZHUbTIRnZJ\n L+Sw84XQxI9/+YVbZYz7mwioblxzMAzyKZE6h9RWMay6mMrd/Sa9qnj5p0S+34guCCXU\n dYeNA/kgVqYAG0oddjmZTqovgI8EqQTPDDtABL6Rwek46vbxyCkHptqDrs1m7cwMwuvf\n S0WwVtLfa40Vewf1Xj0zyomCG8iUOZGb8iILaNzL9HlWkGqJlXbrRsU46MvWNfXIqj2w\n vjoA==",
        "X-Gm-Message-State": "AOJu0Yxh75ql21wHG8i/nQ8HynL7JvKr1GKhr0KSS/OOQgr0KDA3BRL6\n SpTFi7NYHY5VluGaPQLCzALPYHvdHde69WktnC5xfWuhFOHi6U6q4MLxbVNDocU=",
        "X-Google-Smtp-Source": "\n AGHT+IGh5CQJfe3x+SS7FVEGQNu0JSq2AjIGAhAMS332ImRx/1Q+dlm/Wl7Wyt0OIqEIztHc9nhUOg==",
        "X-Received": "by 2002:a5d:558e:0:b0:33a:fe3b:b2ae with SMTP id\n i14-20020a5d558e000000b0033afe3bb2aemr3457567wrv.66.1707320025183;\n Wed, 07 Feb 2024 07:33:45 -0800 (PST)",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCW+HawI+dsRCL8Cqt6dFZJOhkAcdAl1K6hVuBrM8jk1lVNXJNnPpYp+J3TqascmKpOPnL+a1p77YF4ssEQIrCx/5c7YrZjzdr5iFcBIhGcO5Rtyt3KQZClY7Zt07egmCSHH2yQQ63Tdl5GT+f/F9cf2BOcbOc9cLJJK9+ylDNPQPqBZEBO2yVGDEMkY+DCG3bHewZ0ppSNg/pqXJknQsk9eBKHESu/+J445CujRnh6CyeJOwZoA28c=",
        "From": "=?utf-8?b?QWJkdWxsYWggw5ZtZXIgWWFtYcOn?= <aomeryamac@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "=?utf-8?b?QWJkdWxsYWggw5ZtZXIgWWFtYcOn?= <aomeryamac@gmail.com>,\n Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,\n Yipeng Wang <yipeng1.wang@intel.com>,\n Sameh Gobriel <sameh.gobriel@intel.com>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>",
        "Subject": "[PATCH] lib/hash,lib/rcu: feature hidden key count in hash",
        "Date": "Wed,  7 Feb 2024 15:33:40 +0000",
        "Message-Id": "<20240207153340.34146-1-aomeryamac@gmail.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "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 introduce a new API to get the hidden key count in the hash\ntable if the rcu qsbr is enabled. When using rte_hash_count with rcu\nqsbr enabled, it will return the number of elements that are not in the\nfree queue. Unless rte_rcu_qsbr_dq_reclaim is called, the number of\nelements in the defer queue will not be counted and freed. Therefore I\nadded a new API to get the number of hidden (defer queue) elements\nin the hash table. Then the user can calculate the total number of\nelements that are available in the hash table.\n\nSigned-off-by: Abdullah Ömer Yamaç <aomeryamac@gmail.com>\n\n---\nCc: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nCc: Yipeng Wang <yipeng1.wang@intel.com>\nCc: Sameh Gobriel <sameh.gobriel@intel.com>\nCc: Bruce Richardson <bruce.richardson@intel.com>\nCc: Vladimir Medvedkin <vladimir.medvedkin@intel.com>\n---\n lib/hash/rte_cuckoo_hash.c |  9 +++++++++\n lib/hash/rte_hash.h        | 13 +++++++++++++\n lib/hash/version.map       |  1 +\n lib/rcu/rte_rcu_qsbr.c     |  8 ++++++++\n lib/rcu/rte_rcu_qsbr.h     | 11 +++++++++++\n lib/rcu/version.map        |  1 +\n 6 files changed, 43 insertions(+)",
    "diff": "diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c\nindex 70456754c4..3553f3efc7 100644\n--- a/lib/hash/rte_cuckoo_hash.c\n+++ b/lib/hash/rte_cuckoo_hash.c\n@@ -555,6 +555,15 @@ rte_hash_max_key_id(const struct rte_hash *h)\n \t\treturn h->entries;\n }\n \n+int32_t\n+rte_hash_dq_count(const struct rte_hash *h)\n+{\n+\tif (h->dq == NULL)\n+\t\treturn -EINVAL;\n+\n+\treturn rte_rcu_qsbr_dq_count(h->dq);\n+}\n+\n int32_t\n rte_hash_count(const struct rte_hash *h)\n {\ndiff --git a/lib/hash/rte_hash.h b/lib/hash/rte_hash.h\nindex 7ecc021111..8ea97e297d 100644\n--- a/lib/hash/rte_hash.h\n+++ b/lib/hash/rte_hash.h\n@@ -193,6 +193,19 @@ rte_hash_free(struct rte_hash *h);\n void\n rte_hash_reset(struct rte_hash *h);\n \n+\n+/**\n+ * Return the number of records in the defer queue of the hash table \n+ * if RCU is enabled.\n+ * @param h\n+ *  Hash table to query from\n+ * @return\n+ *   - -EINVAL if parameters are invalid\n+ *   - A value indicating how many records were inserted in the table.\n+ */\n+int32_t\n+rte_hash_dq_count(const struct rte_hash *h);\n+\n /**\n  * Return the number of keys in the hash table\n  * @param h\ndiff --git a/lib/hash/version.map b/lib/hash/version.map\nindex 6b2afebf6b..7f7b158cf1 100644\n--- a/lib/hash/version.map\n+++ b/lib/hash/version.map\n@@ -9,6 +9,7 @@ DPDK_24 {\n \trte_hash_add_key_with_hash;\n \trte_hash_add_key_with_hash_data;\n \trte_hash_count;\n+\trte_hash_dq_count;\n \trte_hash_crc32_alg;\n \trte_hash_crc_set_alg;\n \trte_hash_create;\ndiff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c\nindex bd0b83be0c..89f8da4c4c 100644\n--- a/lib/rcu/rte_rcu_qsbr.c\n+++ b/lib/rcu/rte_rcu_qsbr.c\n@@ -450,6 +450,14 @@ rte_rcu_qsbr_dq_reclaim(struct rte_rcu_qsbr_dq *dq, unsigned int n,\n \treturn 0;\n }\n \n+/**\n+ * Return the number of entries in a defer queue.\n+ */\n+unsigned int rte_rcu_qsbr_dq_count(struct rte_rcu_qsbr_dq *dq)\n+{\n+\treturn rte_ring_count(dq->r);\n+}\n+\n /* Delete a defer queue. */\n int\n rte_rcu_qsbr_dq_delete(struct rte_rcu_qsbr_dq *dq)\ndiff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h\nindex 23c9f89805..ed5a590edd 100644\n--- a/lib/rcu/rte_rcu_qsbr.h\n+++ b/lib/rcu/rte_rcu_qsbr.h\n@@ -794,6 +794,17 @@ int\n rte_rcu_qsbr_dq_reclaim(struct rte_rcu_qsbr_dq *dq, unsigned int n,\n \tunsigned int *freed, unsigned int *pending, unsigned int *available);\n \n+/**\n+ * Return the number of entries in a defer queue.\n+ *\n+ * @param dq\n+ *   Defer queue.\n+ * @return\n+ *   The number of entries in the defer queue.\n+ */\n+unsigned int\n+rte_rcu_qsbr_dq_count(struct rte_rcu_qsbr_dq *dq);\n+\n /**\n  * Delete a defer queue.\n  *\ndiff --git a/lib/rcu/version.map b/lib/rcu/version.map\nindex 982ffd59d9..f410ab41e7 100644\n--- a/lib/rcu/version.map\n+++ b/lib/rcu/version.map\n@@ -5,6 +5,7 @@ DPDK_24 {\n \trte_rcu_qsbr_dq_create;\n \trte_rcu_qsbr_dq_delete;\n \trte_rcu_qsbr_dq_enqueue;\n+\trte_rcu_qsbr_dq_count;\n \trte_rcu_qsbr_dq_reclaim;\n \trte_rcu_qsbr_dump;\n \trte_rcu_qsbr_get_memsize;\n",
    "prefixes": []
}