get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139453,
    "url": "https://patches.dpdk.org/api/patches/139453/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240417160807.1249480-4-yoan.picchi@arm.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": "<20240417160807.1249480-4-yoan.picchi@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240417160807.1249480-4-yoan.picchi@arm.com",
    "date": "2024-04-17T16:08:06",
    "name": "[v8,3/4] test/hash: check bulk lookup of keys after collision",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "091d1cb7420a274741149486d9eb8203e435b729",
    "submitter": {
        "id": 3196,
        "url": "https://patches.dpdk.org/api/people/3196/?format=api",
        "name": "Yoan Picchi",
        "email": "yoan.picchi@arm.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/20240417160807.1249480-4-yoan.picchi@arm.com/mbox/",
    "series": [
        {
            "id": 31772,
            "url": "https://patches.dpdk.org/api/series/31772/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31772",
            "date": "2024-04-17T16:08:03",
            "name": "hash: add SVE support for bulk key lookup",
            "version": 8,
            "mbox": "https://patches.dpdk.org/series/31772/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/139453/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/139453/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 80A6143E94;\n\tWed, 17 Apr 2024 18:08:49 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9817740E96;\n\tWed, 17 Apr 2024 18:08:34 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id A787840E78\n for <dev@dpdk.org>; Wed, 17 Apr 2024 18:08:29 +0200 (CEST)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 01E11339;\n Wed, 17 Apr 2024 09:08:57 -0700 (PDT)",
            "from octeon10-1.usa.Arm.com (unknown [10.118.91.161])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DEC393F792;\n Wed, 17 Apr 2024 09:08:28 -0700 (PDT)"
        ],
        "From": "Yoan Picchi <yoan.picchi@arm.com>",
        "To": "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>",
        "Cc": "dev@dpdk.org, nd@arm.com, Yoan Picchi <yoan.picchi@arm.com>,\n Harjot Singh <harjot.singh@arm.com>, Ruifeng Wang <ruifeng.wang@arm.com>,\n Nathan Brown <nathan.brown@arm.com>",
        "Subject": "[PATCH v8 3/4] test/hash: check bulk lookup of keys after collision",
        "Date": "Wed, 17 Apr 2024 16:08:06 +0000",
        "Message-Id": "<20240417160807.1249480-4-yoan.picchi@arm.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20240417160807.1249480-1-yoan.picchi@arm.com>",
        "References": "<20231020165159.1649282-1-yoan.picchi@arm.com>\n <20240417160807.1249480-1-yoan.picchi@arm.com>",
        "MIME-Version": "1.0",
        "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 unit test for rte_hash_lookup_bulk().\nIt also update the test_full_bucket test to the current number of entries\nin a hash bucket.\n\nSigned-off-by: Yoan Picchi <yoan.picchi@arm.com>\nSigned-off-by: Harjot Singh <harjot.singh@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\nReviewed-by: Nathan Brown <nathan.brown@arm.com>\n---\n app/test/test_hash.c | 99 ++++++++++++++++++++++++++++++++++----------\n 1 file changed, 76 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/app/test/test_hash.c b/app/test/test_hash.c\nindex d586878a22..4f871b3499 100644\n--- a/app/test/test_hash.c\n+++ b/app/test/test_hash.c\n@@ -95,7 +95,7 @@ static uint32_t pseudo_hash(__rte_unused const void *keys,\n \t\t\t    __rte_unused uint32_t key_len,\n \t\t\t    __rte_unused uint32_t init_val)\n {\n-\treturn 3;\n+\treturn 3 | (3 << 16);\n }\n \n RTE_LOG_REGISTER(hash_logtype_test, test.hash, INFO);\n@@ -115,8 +115,10 @@ static void print_key_info(const char *msg, const struct flow_key *key,\n \trte_log(RTE_LOG_DEBUG, hash_logtype_test, \" @ pos %d\\n\", pos);\n }\n \n+#define KEY_PER_BUCKET 8\n+\n /* Keys used by unit test functions */\n-static struct flow_key keys[5] = { {\n+static struct flow_key keys[KEY_PER_BUCKET+1] = { {\n \t.ip_src = RTE_IPV4(0x03, 0x02, 0x01, 0x00),\n \t.ip_dst = RTE_IPV4(0x07, 0x06, 0x05, 0x04),\n \t.port_src = 0x0908,\n@@ -146,6 +148,30 @@ static struct flow_key keys[5] = { {\n \t.port_src = 0x4948,\n \t.port_dst = 0x4b4a,\n \t.proto = 0x4c,\n+}, {\n+\t.ip_src = RTE_IPV4(0x53, 0x52, 0x51, 0x50),\n+\t.ip_dst = RTE_IPV4(0x57, 0x56, 0x55, 0x54),\n+\t.port_src = 0x5958,\n+\t.port_dst = 0x5b5a,\n+\t.proto = 0x5c,\n+}, {\n+\t.ip_src = RTE_IPV4(0x63, 0x62, 0x61, 0x60),\n+\t.ip_dst = RTE_IPV4(0x67, 0x66, 0x65, 0x64),\n+\t.port_src = 0x6968,\n+\t.port_dst = 0x6b6a,\n+\t.proto = 0x6c,\n+}, {\n+\t.ip_src = RTE_IPV4(0x73, 0x72, 0x71, 0x70),\n+\t.ip_dst = RTE_IPV4(0x77, 0x76, 0x75, 0x74),\n+\t.port_src = 0x7978,\n+\t.port_dst = 0x7b7a,\n+\t.proto = 0x7c,\n+}, {\n+\t.ip_src = RTE_IPV4(0x83, 0x82, 0x81, 0x80),\n+\t.ip_dst = RTE_IPV4(0x87, 0x86, 0x85, 0x84),\n+\t.port_src = 0x8988,\n+\t.port_dst = 0x8b8a,\n+\t.proto = 0x8c,\n } };\n \n /* Parameters used for hash table in unit test functions. Name set later. */\n@@ -783,13 +809,15 @@ static int test_five_keys(void)\n \n /*\n  * Add keys to the same bucket until bucket full.\n- *\t- add 5 keys to the same bucket (hash created with 4 keys per bucket):\n- *\t  first 4 successful, 5th successful, pushing existing item in bucket\n- *\t- lookup the 5 keys: 5 hits\n- *\t- add the 5 keys again: 5 OK\n- *\t- lookup the 5 keys: 5 hits (updated data)\n- *\t- delete the 5 keys: 5 OK\n- *\t- lookup the 5 keys: 5 misses\n+ *\t- add 9 keys to the same bucket (hash created with 8 keys per bucket):\n+ *\t  first 8 successful, 9th successful, pushing existing item in bucket\n+ *\t- lookup the 9 keys: 9 hits\n+ *\t- bulk lookup for all the 9 keys: 9 hits\n+ *\t- add the 9 keys again: 9 OK\n+ *\t- lookup the 9 keys: 9 hits (updated data)\n+ *\t- delete the 9 keys: 9 OK\n+ *\t- lookup the 9 keys: 9 misses\n+ *\t- bulk lookup for all the 9 keys: 9 misses\n  */\n static int test_full_bucket(void)\n {\n@@ -801,16 +829,17 @@ static int test_full_bucket(void)\n \t\t.hash_func_init_val = 0,\n \t\t.socket_id = 0,\n \t};\n+\tconst void *key_array[KEY_PER_BUCKET+1] = {0};\n \tstruct rte_hash *handle;\n-\tint pos[5];\n-\tint expected_pos[5];\n+\tint pos[KEY_PER_BUCKET+1];\n+\tint expected_pos[KEY_PER_BUCKET+1];\n \tunsigned i;\n-\n+\tint ret;\n \thandle = rte_hash_create(&params_pseudo_hash);\n \tRETURN_IF_ERROR(handle == NULL, \"hash creation failed\");\n \n \t/* Fill bucket */\n-\tfor (i = 0; i < 4; i++) {\n+\tfor (i = 0; i < KEY_PER_BUCKET; i++) {\n \t\tpos[i] = rte_hash_add_key(handle, &keys[i]);\n \t\tprint_key_info(\"Add\", &keys[i], pos[i]);\n \t\tRETURN_IF_ERROR(pos[i] < 0,\n@@ -821,22 +850,36 @@ static int test_full_bucket(void)\n \t * This should work and will push one of the items\n \t * in the bucket because it is full\n \t */\n-\tpos[4] = rte_hash_add_key(handle, &keys[4]);\n-\tprint_key_info(\"Add\", &keys[4], pos[4]);\n-\tRETURN_IF_ERROR(pos[4] < 0,\n-\t\t\t\"failed to add key (pos[4]=%d)\", pos[4]);\n-\texpected_pos[4] = pos[4];\n+\tpos[KEY_PER_BUCKET] = rte_hash_add_key(handle, &keys[KEY_PER_BUCKET]);\n+\tprint_key_info(\"Add\", &keys[KEY_PER_BUCKET], pos[KEY_PER_BUCKET]);\n+\tRETURN_IF_ERROR(pos[KEY_PER_BUCKET] < 0,\n+\t\t\t\"failed to add key (pos[%d]=%d)\", KEY_PER_BUCKET, pos[KEY_PER_BUCKET]);\n+\texpected_pos[KEY_PER_BUCKET] = pos[KEY_PER_BUCKET];\n \n \t/* Lookup */\n-\tfor (i = 0; i < 5; i++) {\n+\tfor (i = 0; i < KEY_PER_BUCKET+1; i++) {\n \t\tpos[i] = rte_hash_lookup(handle, &keys[i]);\n \t\tprint_key_info(\"Lkp\", &keys[i], pos[i]);\n \t\tRETURN_IF_ERROR(pos[i] != expected_pos[i],\n \t\t\t\"failed to find key (pos[%u]=%d)\", i, pos[i]);\n \t}\n \n+\tfor (i = 0; i < KEY_PER_BUCKET+1; i++)\n+\t\tkey_array[i] = &keys[i];\n+\n+\t/*Bulk lookup after add with same hash*/\n+\tret = rte_hash_lookup_bulk(handle, key_array, KEY_PER_BUCKET+1, (int32_t *)pos);\n+\tRETURN_IF_ERROR(ret, \"rte_hash_lookup_bulk returned an error: %d\\n\", ret);\n+\tfor (i = 0; i < KEY_PER_BUCKET+1; i++) {\n+\t\tprint_key_info(\"Blk_Lkp\", key_array[i], pos[i]);\n+\t\tRETURN_IF_ERROR(pos[i] != expected_pos[i],\n+\t\t\t\t\"failed to find key (pos[%u]=%d)\", i, pos[i]);\n+\t}\n+\n+\n+\n \t/* Add - update */\n-\tfor (i = 0; i < 5; i++) {\n+\tfor (i = 0; i < KEY_PER_BUCKET+1; i++) {\n \t\tpos[i] = rte_hash_add_key(handle, &keys[i]);\n \t\tprint_key_info(\"Add\", &keys[i], pos[i]);\n \t\tRETURN_IF_ERROR(pos[i] != expected_pos[i],\n@@ -844,7 +887,7 @@ static int test_full_bucket(void)\n \t}\n \n \t/* Lookup */\n-\tfor (i = 0; i < 5; i++) {\n+\tfor (i = 0; i < KEY_PER_BUCKET+1; i++) {\n \t\tpos[i] = rte_hash_lookup(handle, &keys[i]);\n \t\tprint_key_info(\"Lkp\", &keys[i], pos[i]);\n \t\tRETURN_IF_ERROR(pos[i] != expected_pos[i],\n@@ -869,7 +912,7 @@ static int test_full_bucket(void)\n \tRETURN_IF_ERROR(pos[1] < 0, \"failed to add key (pos[1]=%d)\", pos[1]);\n \n \t/* Delete */\n-\tfor (i = 0; i < 5; i++) {\n+\tfor (i = 0; i < KEY_PER_BUCKET+1; i++) {\n \t\tpos[i] = rte_hash_del_key(handle, &keys[i]);\n \t\tprint_key_info(\"Del\", &keys[i], pos[i]);\n \t\tRETURN_IF_ERROR(pos[i] != expected_pos[i],\n@@ -877,13 +920,23 @@ static int test_full_bucket(void)\n \t}\n \n \t/* Lookup */\n-\tfor (i = 0; i < 5; i++) {\n+\tfor (i = 0; i < KEY_PER_BUCKET+1; i++) {\n \t\tpos[i] = rte_hash_lookup(handle, &keys[i]);\n \t\tprint_key_info(\"Lkp\", &keys[i], pos[i]);\n \t\tRETURN_IF_ERROR(pos[i] != -ENOENT,\n \t\t\t\"fail: found non-existent key (pos[%u]=%d)\", i, pos[i]);\n \t}\n \n+\t/* Bulk Lookup on empty table*/\n+\tret = rte_hash_lookup_bulk(handle, &key_array[0], KEY_PER_BUCKET+1, (int32_t *)pos);\n+\tRETURN_IF_ERROR(ret, \"rte_hash_lookup_bulk returned an error: %d\\n\", ret);\n+\tfor (i = 0; i < KEY_PER_BUCKET+1; i++) {\n+\t\tprint_key_info(\"Blk_Lkp\", key_array[i], pos[i]);\n+\t\tRETURN_IF_ERROR(pos[i] != -ENOENT,\n+\t\t\t\t\"failed to find key (pos[%u]=%d)\", i, pos[i]);\n+\t}\n+\n+\n \trte_hash_free(handle);\n \n \t/* Cover the NULL case. */\n",
    "prefixes": [
        "v8",
        "3/4"
    ]
}