get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 15443,
    "url": "http://patches.dpdk.org/api/patches/15443/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1472247287-167011-3-git-send-email-pablo.de.lara.guarch@intel.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": "<1472247287-167011-3-git-send-email-pablo.de.lara.guarch@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1472247287-167011-3-git-send-email-pablo.de.lara.guarch@intel.com",
    "date": "2016-08-26T21:34:46",
    "name": "[dpdk-dev,2/3] hash: add vectorized comparison",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "57f7bb532dae6baab030550928c4e591506c0cc4",
    "submitter": {
        "id": 9,
        "url": "http://patches.dpdk.org/api/people/9/?format=api",
        "name": "De Lara Guarch, Pablo",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1472247287-167011-3-git-send-email-pablo.de.lara.guarch@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/15443/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/15443/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 40A2C5908;\n\tFri, 26 Aug 2016 23:34:03 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id AF63558DD\n\tfor <dev@dpdk.org>; Fri, 26 Aug 2016 23:33:59 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga103.fm.intel.com with ESMTP; 26 Aug 2016 14:33:58 -0700",
            "from sie-lab-214-036.ir.intel.com (HELO\n\tsilpixa00394365.ir.intel.com) ([10.237.214.36])\n\tby fmsmga001.fm.intel.com with ESMTP; 26 Aug 2016 14:33:57 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.28,582,1464678000\"; d=\"scan'208\";\n\ta=\"1031835899\"",
        "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "bruce.richardson@intel.com, Byron Marohn <byron.marohn@intel.com>,\n\tSaikrishna Edupuganti <saikrishna.edupuganti@intel.com>,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "Date": "Fri, 26 Aug 2016 22:34:46 +0100",
        "Message-Id": "<1472247287-167011-3-git-send-email-pablo.de.lara.guarch@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1472247287-167011-1-git-send-email-pablo.de.lara.guarch@intel.com>",
        "References": "<1472247287-167011-1-git-send-email-pablo.de.lara.guarch@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 2/3] hash: add vectorized comparison",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Byron Marohn <byron.marohn@intel.com>\n\nIn lookup bulk function, the signatures of all entries\nare compared against the signature of the key that is being looked up.\nNow that all the signatures are together, they can be compared\nwith vector instructions (SSE, AVX2), achieving higher lookup performance.\n\nAlso, entries per bucket are increased to 8 when using processors\nwith AVX2, as 256 bits can be compared at once, which is the size of\n8x32-bit signatures.\n\nSigned-off-by: Byron Marohn <byron.marohn@intel.com>\nSigned-off-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n lib/librte_hash/rte_cuckoo_hash.c | 41 ++++++++++++++++++++++++++++++++++-----\n lib/librte_hash/rte_cuckoo_hash.h |  4 ++++\n 2 files changed, 40 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c\nindex 9d507b6..98713d3 100644\n--- a/lib/librte_hash/rte_cuckoo_hash.c\n+++ b/lib/librte_hash/rte_cuckoo_hash.c\n@@ -939,6 +939,38 @@ lookup_stage1(unsigned idx, hash_sig_t *prim_hash, hash_sig_t *sec_hash,\n \trte_prefetch0(*secondary_bkt);\n }\n \n+static inline void\n+compare_signatures(unsigned *prim_hash_matches, unsigned *sec_hash_matches,\n+\t\t\t\tconst struct rte_hash_bucket *prim_bkt,\n+\t\t\t\tconst struct rte_hash_bucket *sec_bkt,\n+\t\t\t\thash_sig_t prim_hash, hash_sig_t sec_hash)\n+{\n+/* 8 entries per bucket */\n+#if defined(__AVX2__)\n+\t*prim_hash_matches |= _mm256_movemask_ps((__m256)_mm256_cmpeq_epi32(\n+\t\t\t_mm256_load_si256((__m256i const *)prim_bkt->sig_current),\n+\t\t\t_mm256_set1_epi32(prim_hash)));\n+\t*sec_hash_matches |= _mm256_movemask_ps((__m256)_mm256_cmpeq_epi32(\n+\t\t\t_mm256_load_si256((__m256i const *)sec_bkt->sig_current),\n+\t\t\t_mm256_set1_epi32(sec_hash)));\n+/* 4 entries per bucket */\n+#elif defined(__SSE2__)\n+\t*prim_hash_matches |= _mm_movemask_ps((__m128)_mm_cmpeq_epi16(\n+\t\t\t_mm_load_si128((__m128i const *)prim_bkt->sig_current),\n+\t\t\t_mm_set1_epi32(prim_hash)));\n+\t*sec_hash_matches |= _mm_movemask_ps((__m128)_mm_cmpeq_epi16(\n+\t\t\t_mm_load_si128((__m128i const *)sec_bkt->sig_current),\n+\t\t\t_mm_set1_epi32(sec_hash)));\n+#else\n+\tunsigned i;\n+\n+\tfor (i = 0; i < RTE_HASH_BUCKET_ENTRIES; i++) {\n+\t\t*prim_hash_matches |= ((prim_hash == prim_bkt->sig_current[i]) << i);\n+\t\t*sec_hash_matches |= ((sec_hash == sec_bkt->sig_current[i]) << i);\n+\t}\n+#endif\n+}\n+\n /*\n  * Lookup bulk stage 2:  Search for match hashes in primary/secondary locations\n  * and prefetch first key slot\n@@ -951,15 +983,14 @@ lookup_stage2(unsigned idx, hash_sig_t prim_hash, hash_sig_t sec_hash,\n \t\tuint64_t *extra_hits_mask, const void *keys,\n \t\tconst struct rte_hash *h)\n {\n-\tunsigned prim_hash_matches, sec_hash_matches, key_idx, i;\n+\tunsigned prim_hash_matches, sec_hash_matches, key_idx;\n \tunsigned total_hash_matches;\n \n \tprim_hash_matches = 1 << RTE_HASH_BUCKET_ENTRIES;\n \tsec_hash_matches = 1 << RTE_HASH_BUCKET_ENTRIES;\n-\tfor (i = 0; i < RTE_HASH_BUCKET_ENTRIES; i++) {\n-\t\tprim_hash_matches |= ((prim_hash == prim_bkt->sig_current[i]) << i);\n-\t\tsec_hash_matches |= ((sec_hash == sec_bkt->sig_current[i]) << i);\n-\t}\n+\n+\tcompare_signatures(&prim_hash_matches, &sec_hash_matches, prim_bkt,\n+\t\t\t\t\t\tsec_bkt, prim_hash, sec_hash);\n \n \tkey_idx = prim_bkt->key_idx[__builtin_ctzl(prim_hash_matches)];\n \tif (key_idx == 0)\ndiff --git a/lib/librte_hash/rte_cuckoo_hash.h b/lib/librte_hash/rte_cuckoo_hash.h\nindex fe0654f..eb57d7e 100644\n--- a/lib/librte_hash/rte_cuckoo_hash.h\n+++ b/lib/librte_hash/rte_cuckoo_hash.h\n@@ -130,7 +130,11 @@ enum add_key_case {\n };\n \n /** Number of items per bucket. */\n+#if defined(__AVX2__)\n+#define RTE_HASH_BUCKET_ENTRIES\t\t8\n+#else\n #define RTE_HASH_BUCKET_ENTRIES\t\t4\n+#endif\n \n #define NULL_SIGNATURE\t\t\t0\n \n",
    "prefixes": [
        "dpdk-dev",
        "2/3"
    ]
}