get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 133167,
    "url": "http://patchwork.dpdk.org/api/patches/133167/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20231023081155.255711-1-omer.yamac@ceng.metu.edu.tr/",
    "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": "<20231023081155.255711-1-omer.yamac@ceng.metu.edu.tr>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231023081155.255711-1-omer.yamac@ceng.metu.edu.tr",
    "date": "2023-10-23T08:11:55",
    "name": "[v2] lib/hash: new feature adding existing key",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "bbb51af10959c2fcb8f4f2903fc78cdaad50ae0e",
    "submitter": {
        "id": 2668,
        "url": "http://patchwork.dpdk.org/api/people/2668/?format=api",
        "name": "Abdullah Ömer Yamaç",
        "email": "omer.yamac@ceng.metu.edu.tr"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20231023081155.255711-1-omer.yamac@ceng.metu.edu.tr/mbox/",
    "series": [
        {
            "id": 29948,
            "url": "http://patchwork.dpdk.org/api/series/29948/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29948",
            "date": "2023-10-23T08:11:55",
            "name": "[v2] lib/hash: new feature adding existing key",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/29948/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/133167/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/133167/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 6744A431E0;\n\tMon, 23 Oct 2023 10:55:36 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E078940EDC;\n\tMon, 23 Oct 2023 10:55:09 +0200 (CEST)",
            "from guvercin.ceng.metu.edu.tr (guvercin.ceng.metu.edu.tr\n [144.122.171.43])\n by mails.dpdk.org (Postfix) with ESMTP id 1E6A140262\n for <dev@dpdk.org>; Mon, 23 Oct 2023 10:12:07 +0200 (CEST)",
            "from localhost (localhost [127.0.0.1])\n by guvercin.ceng.metu.edu.tr (Postfix) with ESMTP id 5E2F12C35A;\n Mon, 23 Oct 2023 11:12:02 +0300 (+03)",
            "from guvercin.ceng.metu.edu.tr ([127.0.0.1])\n by localhost (guvercin.ceng.metu.edu.tr [127.0.0.1]) (amavisd-new,\n port 10024)\n with ESMTP id HcvTCUKOHuNV; Mon, 23 Oct 2023 11:11:58 +0300 (+03)",
            "from dcu.otaknetworks.com (unknown [212.156.37.190])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested) (Authenticated sender: e1885458)\n by guvercin.ceng.metu.edu.tr (Postfix) with ESMTPSA id D10B72C1DD;\n Mon, 23 Oct 2023 11:11:57 +0300 (+03)"
        ],
        "X-Virus-Scanned": "Debian amavisd-new at ceng.metu.edu.tr",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ceng.metu.edu.tr;\n s=mail; t=1698048718;\n bh=VgyYzKzGZ4PXPsJHP/rVzNII0meYE87XzrFplaBYzNM=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=FdGGSA8WFWsPqXf9r+tEqpjYpKThLiQOzs19buW98Wx/ylWXa3IOMGaU65ZWB93Ag\n ld4iT6f4LDHFqiIYrYiG/sFoo/D7IbZL7evItPMsCGmQdvPfxCfwDR7+Zd9rRrvLjP\n Lr2CwyCwMKNLzCnCuKF4gXDCZK0DktEgMYnjvXzA=",
        "From": "=?utf-8?b?QWJkdWxsYWggw5ZtZXIgWWFtYcOn?= <omer.yamac@ceng.metu.edu.tr>",
        "To": "dev@dpdk.org",
        "Cc": "=?utf-8?b?QWJkdWxsYWggw5ZtZXIgWWFtYcOn?= <omer.yamac@ceng.metu.edu.tr>,\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>,\n David Marchand <david.marchand@redhat.com>",
        "Subject": "[PATCH v2] lib/hash: new feature adding existing key",
        "Date": "Mon, 23 Oct 2023 08:11:55 +0000",
        "Message-Id": "<20231023081155.255711-1-omer.yamac@ceng.metu.edu.tr>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "\n <CAJFAV8z-+CWhUeOf7ieo82EqZcvTKuqPczfWuEGok6UcPAxm2A@mail.gmail.com>",
        "References": "\n <CAJFAV8z-+CWhUeOf7ieo82EqZcvTKuqPczfWuEGok6UcPAxm2A@mail.gmail.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Mon, 23 Oct 2023 10:55:02 +0200",
        "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": "In some use cases inserting data with the same key shouldn't be\noverwritten. We use a new flag in this patch to disable overwriting\ndata for the same key.\n\nSigned-off-by: Abdullah Ömer Yamaç <omer.yamac@ceng.metu.edu.tr>\n\n---\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>\nCc: David Marchand <david.marchand@redhat.com>\n---\n lib/hash/rte_cuckoo_hash.c | 10 +++++++++-\n lib/hash/rte_cuckoo_hash.h |  2 ++\n lib/hash/rte_hash.h        |  4 ++++\n 3 files changed, 15 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c\nindex 19b23f2a97..fe8f21bee4 100644\n--- a/lib/hash/rte_cuckoo_hash.c\n+++ b/lib/hash/rte_cuckoo_hash.c\n@@ -32,7 +32,8 @@\n \t\t\t\t   RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY | \\\n \t\t\t\t   RTE_HASH_EXTRA_FLAGS_EXT_TABLE |\t\\\n \t\t\t\t   RTE_HASH_EXTRA_FLAGS_NO_FREE_ON_DEL | \\\n-\t\t\t\t   RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF)\n+\t\t\t\t   RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF | \\\n+\t\t\t\t   RTE_HASH_EXTRA_FLAGS_DISABLE_UPDATE_EXISTING_KEY)\n \n #define FOR_EACH_BUCKET(CURRENT_BKT, START_BUCKET)                            \\\n \tfor (CURRENT_BKT = START_BUCKET;                                      \\\n@@ -148,6 +149,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \tunsigned int readwrite_concur_support = 0;\n \tunsigned int writer_takes_lock = 0;\n \tunsigned int no_free_on_del = 0;\n+\tunsigned int no_update_data = 0;\n \tuint32_t *ext_bkt_to_free = NULL;\n \tuint32_t *tbl_chng_cnt = NULL;\n \tstruct lcore_cache *local_free_slots = NULL;\n@@ -216,6 +218,9 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \t\tno_free_on_del = 1;\n \t}\n \n+\tif (params->extra_flag & RTE_HASH_EXTRA_FLAGS_DISABLE_UPDATE_EXISTING_KEY)\n+\t\tno_update_data = 1;\n+\n \t/* Store all keys and leave the first entry as a dummy entry for lookup_bulk */\n \tif (use_local_cache)\n \t\t/*\n@@ -428,6 +433,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \th->ext_table_support = ext_table_support;\n \th->writer_takes_lock = writer_takes_lock;\n \th->no_free_on_del = no_free_on_del;\n+\th->no_update_data = no_update_data;\n \th->readwrite_concur_lf_support = readwrite_concur_lf_support;\n \n #if defined(RTE_ARCH_X86)\n@@ -707,6 +713,8 @@ search_and_update(const struct rte_hash *h, void *data, const void *key,\n \t\t\tk = (struct rte_hash_key *) ((char *)keys +\n \t\t\t\t\tbkt->key_idx[i] * h->key_entry_size);\n \t\t\tif (rte_hash_cmp_eq(key, k->key, h) == 0) {\n+\t\t\t\tif (h->no_update_data == 1)\n+\t\t\t\t\treturn -EINVAL;\n \t\t\t\t/* The store to application data at *data\n \t\t\t\t * should not leak after the store to pdata\n \t\t\t\t * in the key store. i.e. pdata is the guard\ndiff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h\nindex eb2644f74b..e8b7283ec2 100644\n--- a/lib/hash/rte_cuckoo_hash.h\n+++ b/lib/hash/rte_cuckoo_hash.h\n@@ -193,6 +193,8 @@ struct rte_hash {\n \t/**< If read-write concurrency support is enabled */\n \tuint8_t ext_table_support;     /**< Enable extendable bucket table */\n \tuint8_t no_free_on_del;\n+\t/**< If update is prohibited on adding same key */\n+\tuint8_t no_update_data;\n \t/**< If key index should be freed on calling rte_hash_del_xxx APIs.\n \t * If this is set, rte_hash_free_key_with_position must be called to\n \t * free the key index associated with the deleted entry.\ndiff --git a/lib/hash/rte_hash.h b/lib/hash/rte_hash.h\nindex 7ecc021111..ca5b4841d2 100644\n--- a/lib/hash/rte_hash.h\n+++ b/lib/hash/rte_hash.h\n@@ -55,6 +55,10 @@ extern \"C\" {\n  */\n #define RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF 0x20\n \n+/** Flag to disable updating data of existing key\n+ */\n+#define RTE_HASH_EXTRA_FLAGS_DISABLE_UPDATE_EXISTING_KEY 0x40\n+\n /**\n  * The type of hash value of a key.\n  * It should be a value of at least 32bit with fully random pattern.\n",
    "prefixes": [
        "v2"
    ]
}