Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/298/?format=api
http://patches.dpdk.org/api/patches/298/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1409724351-23786-3-git-send-email-e_zhumabekov@sts.kz/", "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": "<1409724351-23786-3-git-send-email-e_zhumabekov@sts.kz>", "list_archive_url": "https://inbox.dpdk.org/dev/1409724351-23786-3-git-send-email-e_zhumabekov@sts.kz", "date": "2014-09-03T06:05:51", "name": "[dpdk-dev,2/2] hash: rte_hash_crc uses 8- and 4-byte CRC32 intrinsics", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "9b2ec3b663ba4164d2c3f059818e5b117f254ad3", "submitter": { "id": 36, "url": "http://patches.dpdk.org/api/people/36/?format=api", "name": "Yerden Zhumabekov", "email": "e_zhumabekov@sts.kz" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1409724351-23786-3-git-send-email-e_zhumabekov@sts.kz/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/298/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/298/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<E_Zhumabekov@sts.kz>", "Received": [ "from mgw.gov.kz (mgw.gov.kz [89.218.88.242])\n\tby dpdk.org (Postfix) with ESMTP id 16BC02E8B\n\tfor <dev@dpdk.org>; Wed, 3 Sep 2014 08:01:43 +0200 (CEST)", "from mgw.gov.kz (mx.ctsat.kz [178.89.4.95])\n\tby mgw.gov.kz with ESMTP id s8366HFH029984-s8366HFI029984\n\tfor <dev@dpdk.org>; Wed, 3 Sep 2014 12:06:17 +0600", "from EXCASHUB1.rgp.local (192.168.40.51) by EdgeForefront.rgp.local\n\t(192.168.40.59) with Microsoft SMTP Server (TLS) id 14.2.247.3;\n\tWed, 3 Sep 2014 12:05:13 +0600", "from r220.rgp.local (192.168.59.10) by excashub1.rgp.local\n\t(192.168.40.48) with Microsoft SMTP Server (TLS) id 14.2.247.3;\n\tWed, 3 Sep 2014 12:10:28 +0600" ], "From": "Yerden Zhumabekov <e_zhumabekov@sts.kz>", "To": "<dev@dpdk.org>", "Date": "Wed, 3 Sep 2014 12:05:51 +0600", "Message-ID": "<1409724351-23786-3-git-send-email-e_zhumabekov@sts.kz>", "X-Mailer": "git-send-email 1.7.9.5", "In-Reply-To": "<1409724351-23786-1-git-send-email-e_zhumabekov@sts.kz>", "References": "<1409724351-23786-1-git-send-email-e_zhumabekov@sts.kz>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[192.168.59.10]", "X-FEAS-SYSTEM-WL": "e_zhumabekov@sts.kz", "Subject": "[dpdk-dev] [PATCH 2/2] hash: rte_hash_crc uses 8- and 4-byte CRC32\n\tintrinsics", "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>", "X-List-Received-Date": "Wed, 03 Sep 2014 06:01:44 -0000" }, "content": "Calculating hash for data of variable length is more efficient\nwhen that data is sliced into 8-byte pieces. The rest part of data\nis hashed using either 8 and 4-byte CRC32 intrinsics.\n\nSigned-off-by: Yerden Zhumabekov <e_zhumabekov@sts.kz>\n---\n lib/librte_hash/rte_hash_crc.h | 31 +++++++++++++++++++++++--------\n 1 file changed, 23 insertions(+), 8 deletions(-)", "diff": "diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h\nindex 102b2a0..d023e5d 100644\n--- a/lib/librte_hash/rte_hash_crc.h\n+++ b/lib/librte_hash/rte_hash_crc.h\n@@ -95,23 +95,38 @@ static inline uint32_t\n rte_hash_crc(const void *data, uint32_t data_len, uint32_t init_val)\n {\n \tunsigned i;\n-\tuint32_t temp = 0;\n-\tconst uint32_t *p32 = (const uint32_t *)data;\n+\tuint64_t temp = 0;\n+\tconst uint64_t *p64 = (const uint64_t *)data;\n \n-\tfor (i = 0; i < data_len / 4; i++) {\n-\t\tinit_val = rte_hash_crc_4byte(*p32++, init_val);\n+\tfor (i = 0; i < data_len / 8; i++) {\n+\t\tinit_val = rte_hash_crc_8byte(*p64++, init_val);\n \t}\n \n-\tswitch (3 - (data_len & 0x03)) {\n+\tswitch (7 - (data_len & 0x07)) {\n \tcase 0:\n-\t\ttemp |= *((const uint8_t *)p32 + 2) << 16;\n+\t\ttemp |= (uint64_t) *((const uint8_t *)p64 + 6) << 48;\n \t\t/* Fallthrough */\n \tcase 1:\n-\t\ttemp |= *((const uint8_t *)p32 + 1) << 8;\n+\t\ttemp |= (uint64_t) *((const uint8_t *)p64 + 5) << 40;\n \t\t/* Fallthrough */\n \tcase 2:\n-\t\ttemp |= *((const uint8_t *)p32);\n+\t\ttemp |= (uint64_t) *((const uint8_t *)p64 + 4) << 32;\n+\t\ttemp |= *((const uint32_t *)p64);\n+\t\tinit_val = rte_hash_crc_8byte(temp, init_val);\n+\t\tbreak;\n+\tcase 3:\n+\t\tinit_val = rte_hash_crc_4byte(*(const uint32_t *)p64, init_val);\n+\t\tbreak;\n+\tcase 4:\n+\t\ttemp |= *((const uint8_t *)p64 + 2) << 16;\n+\t\t/* Fallthrough */\n+\tcase 5:\n+\t\ttemp |= *((const uint8_t *)p64 + 1) << 8;\n+\t\t/* Fallthrough */\n+\tcase 6:\n+\t\ttemp |= *((const uint8_t *)p64);\n \t\tinit_val = rte_hash_crc_4byte(temp, init_val);\n+\t\t/* Fallthrough */\n \tdefault:\n \t\tbreak;\n \t}\n", "prefixes": [ "dpdk-dev", "2/2" ] }{ "id": 298, "url": "