From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50083.outbound.protection.outlook.com [40.107.5.83]) by dpdk.org (Postfix) with ESMTP id DB39C3256 for ; Fri, 7 Sep 2018 12:20:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=usuGRlmPlJbNJYWvceh3OKkbbyxlTm//FQOmaGEbLIQ=; b=jJdDZIHDaSfsHuyhuzas3D3eeNAxfGNfvlABZ+2OTogL9UZ6oSjoQfQ6o9Z81bWUXTvCumcJdPAKE465DQBDLxQQztcuRI4iBCYDVkNjDzngSwwOQdmP+3MJVyG8aLxAFC1jSJRvksfLgPh1H8y9JF6lbxnmTl6zQoVYBXKu2II= Received: from VI1PR08MB3167.eurprd08.prod.outlook.com (52.133.15.142) by VI1PR08MB0736.eurprd08.prod.outlook.com (10.163.169.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Fri, 7 Sep 2018 10:20:15 +0000 Received: from VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::b91d:e285:4647:f3e8]) by VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::b91d:e285:4647:f3e8%2]) with mapi id 15.20.1101.019; Fri, 7 Sep 2018 10:20:15 +0000 From: "Gavin Hu (Arm Technology China)" To: Kevin Laatz , "dev@dpdk.org" CC: "cristian.dumitrescu@intel.com" , Jianbo Liu , "jerin.jacob@caviumnetworks.com" Thread-Topic: [PATCH v3 2/3] examples/ip_pipeline: modify application to use librte_table headers Thread-Index: AQHURpJ42TFZnoe/mECIiNzjI1IAO6Tkm4dQ Date: Fri, 7 Sep 2018 10:20:15 +0000 Message-ID: References: <20180907100626.8165-1-kevin.laatz@intel.com> <20180907100626.8165-2-kevin.laatz@intel.com> In-Reply-To: <20180907100626.8165-2-kevin.laatz@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR08MB0736; 6:yygbH8QVwoEjpxzQsQD5UjoUTOC6rA1ZyYkox/lyntNMwE6C+4hodPqZVjLC0rhRCXbXA+wELZDSR6ORvyOsPaFhWRK+EtnJGN0OHE+7zMe4owKmNJ/J/2+ZO/0Xn8cSSRCGeciKmoaWHzHjY9ocfhF72d0Z4EkMyDhNcQcpCRJyKWLmaTCFBKyKYI/u3DuzXs/LLzwb0arUx0BVzQpwYewCEEWm5lPAp9/lb9Y8F55Krxz1nhG2zW2qLZecljDipG2XRaoNJMlVsHRH0UeMSl7Hpx0zpMg7pcgrH2Nn4oVbaPt3vPkEcsfViquABt1IX8i0YnvuWcgjdZgHQkoOqqFLoV+T65dIA+WdTZV6XLYVEg62T/ia/OD2lWgAP22GTpuNJIi1o65uDKTWhmGuN5Gkq6B2WZHY3xtDU//YdC9pJNcE40amWihrWDeeVc9dKNqDjJ3Hnbdp/7zENpFNDw==; 5:211O8HGmNVaK1xPosT5QN/K1gtxOp0A59qY8Bmz0KeXhd/tAwsmrqKVOiZuxWj8V9I2sY0sz7NdzwP2rW6uZeMIvdToOQCixi4IHxqTBR/IJ/gY8mHk3btuTrm2bGZIKAApfHMOqEZdOXNQXZbsce/EynHFQYTvP3qsjGmF7cqY=; 7:z68CyTQjA3cHwwGbnHW3RS1Xktuxbr3KTZGIhE9LizTCkZaRz76LJOGvUWoLM9fvPp0jkpXk0YrQfXgCiAPX904LVfXcCjEKQKsxp6pbXlUaDmsMU/KdzdQObQBdCPUc6NEc9ZuyKuvQWt2oC0O/cE3xBsAVuJRKickm8lBg2xXR3MdR84ikfJceBY+iy7mNZ9GxmAtX56Pq5aQgwghAkhuAVJROiSKfrUosueKOa3ZIUGIUhpiMTiB1IYxz5pPQ x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-correlation-id: af2e35b8-a77a-4e2c-dc45-08d614ab80fe x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR08MB0736; x-ms-traffictypediagnostic: VI1PR08MB0736: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(103651359005742)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:VI1PR08MB0736; BCL:0; PCL:0; RULEID:; SRVR:VI1PR08MB0736; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(396003)(376002)(346002)(39860400002)(40434004)(199004)(189003)(13464003)(81166006)(305945005)(7736002)(6436002)(229853002)(97736004)(2900100001)(66066001)(2906002)(14454004)(5660300001)(3846002)(6116002)(256004)(5024004)(14444005)(25786009)(486006)(9686003)(4326008)(55016002)(68736007)(53936002)(55236004)(8676002)(72206003)(102836004)(33656002)(2501003)(186003)(110136005)(478600001)(105586002)(99286004)(6506007)(53546011)(54906003)(11346002)(53946003)(26005)(316002)(446003)(8936002)(7696005)(5250100002)(74316002)(81156014)(76176011)(86362001)(476003)(106356001)(6246003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB0736; H:VI1PR08MB3167.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: wWuRnrhiU9QrpvVjZoco2KVSeh9NG9J/77OBl4MLtWbw1R1MiQv70yayCCO9sRzon/u0DkwxKi8jZc8uYyoz+RmwUnGLtxcGU6iX9cdtX1a+C6SYnby0YNZBhjsiv8+/EcTVjrAvT05V1/cCovSCioOXb15X9mUBAsr+ub7QUTCBNvXPY0Qm30r10KZRHLrPvYM/ZMElklTWRl+dDTWY7XpEn/JyajDX1jiXrEfjGkhboluW/C6xAcEshvrpJf14JwiiVP8k/1soIDCVeprh3H+PoKzid+no4pgfFTmVTvxzI2VeBkMw3cmR5nqWk4wZ0xMsuJRup1XO2Fkqzs+7ffBGBsNJkGutUIbJITbvgz8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: af2e35b8-a77a-4e2c-dc45-08d614ab80fe X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 10:20:15.4559 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB0736 Subject: Re: [dpdk-dev] [PATCH v3 2/3] examples/ip_pipeline: modify application to use librte_table headers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2018 10:20:18 -0000 > -----Original Message----- > From: Kevin Laatz > Sent: Friday, September 7, 2018 6:06 PM > To: dev@dpdk.org > Cc: cristian.dumitrescu@intel.com; Jianbo Liu ; Gavin > Hu (Arm Technology China) ; > jerin.jacob@caviumnetworks.com; Kevin Laatz > Subject: [PATCH v3 2/3] examples/ip_pipeline: modify application to use > librte_table headers > > This commit modifies the IP Pipeline application to use the new header fi= les > in librte_table. > > As we are now using the new header files, we can remove the old ones from > the application directory. > > Signed-off-by: Cristian Dumitrescu > Signed-off-by: Kevin Laatz Acked-by: Gavin Hu > --- > examples/ip_pipeline/action.c | 34 ++-- > examples/ip_pipeline/hash_func.h | 357 ---------------------------= ------ > examples/ip_pipeline/hash_func_arm64.h | 232 --------------------- > examples/ip_pipeline/pipeline.c | 19 +- > 4 files changed, 26 insertions(+), 616 deletions(-) delete mode 100644 > examples/ip_pipeline/hash_func.h delete mode 100644 > examples/ip_pipeline/hash_func_arm64.h > > diff --git a/examples/ip_pipeline/action.c b/examples/ip_pipeline/action.= c > index a29c2b3..20497c3 100644 > --- a/examples/ip_pipeline/action.c > +++ b/examples/ip_pipeline/action.c > @@ -7,9 +7,9 @@ > #include > > #include > +#include > > #include "action.h" > -#include "hash_func.h" > > /** > * Input port > @@ -57,35 +57,35 @@ port_in_action_profile_create(const char *name, > (params->lb.f_hash =3D=3D NULL)) { > switch (params->lb.key_size) { > case 8: > -params->lb.f_hash =3D hash_default_key8; > +params->lb.f_hash =3D rte_table_hash_crc_key8; > break; > > case 16: > -params->lb.f_hash =3D hash_default_key16; > +params->lb.f_hash =3D rte_table_hash_crc_key16; > break; > > case 24: > -params->lb.f_hash =3D hash_default_key24; > +params->lb.f_hash =3D rte_table_hash_crc_key24; > break; > > case 32: > -params->lb.f_hash =3D hash_default_key32; > +params->lb.f_hash =3D rte_table_hash_crc_key32; > break; > > case 40: > -params->lb.f_hash =3D hash_default_key40; > +params->lb.f_hash =3D rte_table_hash_crc_key40; > break; > > case 48: > -params->lb.f_hash =3D hash_default_key48; > +params->lb.f_hash =3D rte_table_hash_crc_key48; > break; > > case 56: > -params->lb.f_hash =3D hash_default_key56; > +params->lb.f_hash =3D rte_table_hash_crc_key56; > break; > > case 64: > -params->lb.f_hash =3D hash_default_key64; > +params->lb.f_hash =3D rte_table_hash_crc_key64; > break; > > default: > @@ -192,35 +192,35 @@ table_action_profile_create(const char *name, > (params->lb.f_hash =3D=3D NULL)) { > switch (params->lb.key_size) { > case 8: > -params->lb.f_hash =3D hash_default_key8; > +params->lb.f_hash =3D rte_table_hash_crc_key8; > break; > > case 16: > -params->lb.f_hash =3D hash_default_key16; > +params->lb.f_hash =3D rte_table_hash_crc_key16; > break; > > case 24: > -params->lb.f_hash =3D hash_default_key24; > +params->lb.f_hash =3D rte_table_hash_crc_key24; > break; > > case 32: > -params->lb.f_hash =3D hash_default_key32; > +params->lb.f_hash =3D rte_table_hash_crc_key32; > break; > > case 40: > -params->lb.f_hash =3D hash_default_key40; > +params->lb.f_hash =3D rte_table_hash_crc_key40; > break; > > case 48: > -params->lb.f_hash =3D hash_default_key48; > +params->lb.f_hash =3D rte_table_hash_crc_key48; > break; > > case 56: > -params->lb.f_hash =3D hash_default_key56; > +params->lb.f_hash =3D rte_table_hash_crc_key56; > break; > > case 64: > -params->lb.f_hash =3D hash_default_key64; > +params->lb.f_hash =3D rte_table_hash_crc_key64; > break; > > default: > diff --git a/examples/ip_pipeline/hash_func.h > b/examples/ip_pipeline/hash_func.h > deleted file mode 100644 > index f1b9d94..0000000 > --- a/examples/ip_pipeline/hash_func.h > +++ /dev/null > @@ -1,357 +0,0 @@ > -/* SPDX-License-Identifier: BSD-3-Clause > - * Copyright(c) 2010-2018 Intel Corporation > - */ > - > -#ifndef __INCLUDE_HASH_FUNC_H__ > -#define __INCLUDE_HASH_FUNC_H__ > - > -static inline uint64_t > -hash_xor_key8(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0; > - > -xor0 =3D seed ^ (k[0] & m[0]); > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key16(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key24(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > - > -xor0 ^=3D k[2] & m[2]; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key32(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0, xor1; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > -xor1 =3D (k[2] & m[2]) ^ (k[3] & m[3]); > - > -xor0 ^=3D xor1; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key40(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0, xor1; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > -xor1 =3D (k[2] & m[2]) ^ (k[3] & m[3]); > - > -xor0 ^=3D xor1; > - > -xor0 ^=3D k[4] & m[4]; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key48(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0, xor1, xor2; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > -xor1 =3D (k[2] & m[2]) ^ (k[3] & m[3]); > -xor2 =3D (k[4] & m[4]) ^ (k[5] & m[5]); > - > -xor0 ^=3D xor1; > - > -xor0 ^=3D xor2; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key56(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0, xor1, xor2; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > -xor1 =3D (k[2] & m[2]) ^ (k[3] & m[3]); > -xor2 =3D (k[4] & m[4]) ^ (k[5] & m[5]); > - > -xor0 ^=3D xor1; > -xor2 ^=3D k[6] & m[6]; > - > -xor0 ^=3D xor2; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -static inline uint64_t > -hash_xor_key64(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t xor0, xor1, xor2, xor3; > - > -xor0 =3D ((k[0] & m[0]) ^ seed) ^ (k[1] & m[1]); > -xor1 =3D (k[2] & m[2]) ^ (k[3] & m[3]); > -xor2 =3D (k[4] & m[4]) ^ (k[5] & m[5]); > -xor3 =3D (k[6] & m[6]) ^ (k[7] & m[7]); > - > -xor0 ^=3D xor1; > -xor2 ^=3D xor3; > - > -xor0 ^=3D xor2; > - > -return (xor0 >> 32) ^ xor0; > -} > - > -#if defined(RTE_ARCH_X86_64) > - > -#include > - > -static inline uint64_t > -hash_crc_key8(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t crc0; > - > -crc0 =3D _mm_crc32_u64(seed, k[0] & m[0]); > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key16(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, crc0, crc1; > - > -k0 =3D k[0] & m[0]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key24(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, crc0, crc1; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc0 =3D _mm_crc32_u64(crc0, k2); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key32(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc2 =3D _mm_crc32_u64(k2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > - > -crc0 =3D _mm_crc32_u64(crc0, crc1); > -crc1 =3D _mm_crc32_u64(crc2, crc3); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key40(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc2 =3D _mm_crc32_u64(k2, k[3] & m[3]); > -crc3 =3D _mm_crc32_u64(k2 >> 32, k[4] & m[4]); > - > -crc0 =3D _mm_crc32_u64(crc0, crc1); > -crc1 =3D _mm_crc32_u64(crc2, crc3); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key48(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, k5, crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc2 =3D _mm_crc32_u64(k2, k[3] & m[3]); > -crc3 =3D _mm_crc32_u64(k2 >> 32, k[4] & m[4]); > - > -crc0 =3D _mm_crc32_u64(crc0, (crc1 << 32) ^ crc2); > -crc1 =3D _mm_crc32_u64(crc3, k5); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key56(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, k5, crc0, crc1, crc2, crc3, crc4, crc5; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc2 =3D _mm_crc32_u64(k2, k[3] & m[3]); > -crc3 =3D _mm_crc32_u64(k2 >> 32, k[4] & m[4]); > - > -crc4 =3D _mm_crc32_u64(k5, k[6] & m[6]); > -crc5 =3D k5 >> 32; > - > -crc0 =3D _mm_crc32_u64(crc0, (crc1 << 32) ^ crc2); > -crc1 =3D _mm_crc32_u64(crc3, (crc4 << 32) ^ crc5); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key64(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint64_t k0, k2, k5, crc0, crc1, crc2, crc3, crc4, crc5; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D _mm_crc32_u64(k0, seed); > -crc1 =3D _mm_crc32_u64(k0 >> 32, k[1] & m[1]); > - > -crc2 =3D _mm_crc32_u64(k2, k[3] & m[3]); > -crc3 =3D _mm_crc32_u64(k2 >> 32, k[4] & m[4]); > - > -crc4 =3D _mm_crc32_u64(k5, k[6] & m[6]); > -crc5 =3D _mm_crc32_u64(k5 >> 32, k[7] & m[7]); > - > -crc0 =3D _mm_crc32_u64(crc0, (crc1 << 32) ^ crc2); > -crc1 =3D _mm_crc32_u64(crc3, (crc4 << 32) ^ crc5); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -#define hash_default_key8hash_crc_key8 > -#define hash_default_key16hash_crc_key16 > -#define hash_default_key24hash_crc_key24 > -#define hash_default_key32hash_crc_key32 > -#define hash_default_key40hash_crc_key40 > -#define hash_default_key48hash_crc_key48 > -#define hash_default_key56hash_crc_key56 > -#define hash_default_key64hash_crc_key64 > - > -#elif defined(RTE_ARCH_ARM64) > -#include "hash_func_arm64.h" > -#else > - > -#define hash_default_key8hash_xor_key8 > -#define hash_default_key16hash_xor_key16 > -#define hash_default_key24hash_xor_key24 > -#define hash_default_key32hash_xor_key32 > -#define hash_default_key40hash_xor_key40 > -#define hash_default_key48hash_xor_key48 > -#define hash_default_key56hash_xor_key56 > -#define hash_default_key64hash_xor_key64 > - > -#endif > - > -#endif > diff --git a/examples/ip_pipeline/hash_func_arm64.h > b/examples/ip_pipeline/hash_func_arm64.h > deleted file mode 100644 > index 50df816..0000000 > --- a/examples/ip_pipeline/hash_func_arm64.h > +++ /dev/null > @@ -1,232 +0,0 @@ > -/* SPDX-License-Identifier: BSD-3-Clause > - * Copyright(c) 2017-2018 Linaro Limited. > - */ > -#ifndef __HASH_FUNC_ARM64_H__ > -#define __HASH_FUNC_ARM64_H__ > - > -#define _CRC32CX(crc, val)\ > -__asm__("crc32cx %w[c], %w[c], %x[v]":[c] "+r" (crc):[v] "r" (val)) > - > -static inline uint64_t > -hash_crc_key8(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key; > -uint64_t *m =3D mask; > -uint32_t crc0; > - > -crc0 =3D seed; > -_CRC32CX(crc0, k[0] & m[0]); > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key16(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1; > - > -k0 =3D k[0] & m[0]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key24(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -_CRC32CX(crc0, k2); > - > -crc0 ^=3D crc1; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key32(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc2 =3D k2; > -_CRC32CX(crc2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > - > -_CRC32CX(crc0, crc1); > -_CRC32CX(crc2, crc3); > - > -crc0 ^=3D crc2; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key40(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc2 =3D k2; > -_CRC32CX(crc2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > -_CRC32CX(crc3, k[4] & m[4]); > - > -_CRC32CX(crc0, crc1); > -_CRC32CX(crc2, crc3); > - > -crc0 ^=3D crc2; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key48(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2, k5; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1, crc2, crc3; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc2 =3D k2; > -_CRC32CX(crc2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > -_CRC32CX(crc3, k[4] & m[4]); > - > -_CRC32CX(crc0, ((uint64_t)crc1 << 32) ^ crc2); > -_CRC32CX(crc3, k5); > - > -crc0 ^=3D crc3; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key56(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2, k5; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1, crc2, crc3, crc4, crc5; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc2 =3D k2; > -_CRC32CX(crc2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > -_CRC32CX(crc3, k[4] & m[4]); > - > -crc4 =3D k5; > - _CRC32CX(crc4, k[6] & m[6]); > -crc5 =3D k5 >> 32; > - > -_CRC32CX(crc0, ((uint64_t)crc1 << 32) ^ crc2); > -_CRC32CX(crc3, ((uint64_t)crc4 << 32) ^ crc5); > - > -crc0 ^=3D crc3; > - > -return crc0; > -} > - > -static inline uint64_t > -hash_crc_key64(void *key, void *mask, __rte_unused uint32_t key_size, > -uint64_t seed) > -{ > -uint64_t *k =3D key, k0, k2, k5; > -uint64_t *m =3D mask; > -uint32_t crc0, crc1, crc2, crc3, crc4, crc5; > - > -k0 =3D k[0] & m[0]; > -k2 =3D k[2] & m[2]; > -k5 =3D k[5] & m[5]; > - > -crc0 =3D k0; > -_CRC32CX(crc0, seed); > -crc1 =3D k0 >> 32; > -_CRC32CX(crc1, k[1] & m[1]); > - > -crc2 =3D k2; > -_CRC32CX(crc2, k[3] & m[3]); > -crc3 =3D k2 >> 32; > -_CRC32CX(crc3, k[4] & m[4]); > - > -crc4 =3D k5; > - _CRC32CX(crc4, k[6] & m[6]); > -crc5 =3D k5 >> 32; > -_CRC32CX(crc5, k[7] & m[7]); > - > -_CRC32CX(crc0, ((uint64_t)crc1 << 32) ^ crc2); > -_CRC32CX(crc3, ((uint64_t)crc4 << 32) ^ crc5); > - > -crc0 ^=3D crc3; > - > -return crc0; > -} > - > -#define hash_default_key8hash_crc_key8 > -#define hash_default_key16hash_crc_key16 > -#define hash_default_key24hash_crc_key24 > -#define hash_default_key32hash_crc_key32 > -#define hash_default_key40hash_crc_key40 > -#define hash_default_key48hash_crc_key48 > -#define hash_default_key56hash_crc_key56 > -#define hash_default_key64hash_crc_key64 > - > -#endif > diff --git a/examples/ip_pipeline/pipeline.c > b/examples/ip_pipeline/pipeline.c index 43fe867..b2fd215 100644 > --- a/examples/ip_pipeline/pipeline.c > +++ b/examples/ip_pipeline/pipeline.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -36,8 +37,6 @@ > #include "tmgr.h" > #include "swq.h" > > -#include "hash_func.h" > - > #ifndef PIPELINE_MSGQ_SIZE > #define PIPELINE_MSGQ_SIZE 64 > #endif > @@ -818,28 +817,28 @@ pipeline_table_create(const char *pipeline_name, > > switch (params->match.hash.key_size) { > case 8: > -f_hash =3D hash_default_key8; > +f_hash =3D rte_table_hash_crc_key8; > break; > case 16: > -f_hash =3D hash_default_key16; > +f_hash =3D rte_table_hash_crc_key16; > break; > case 24: > -f_hash =3D hash_default_key24; > +f_hash =3D rte_table_hash_crc_key24; > break; > case 32: > -f_hash =3D hash_default_key32; > +f_hash =3D rte_table_hash_crc_key32; > break; > case 40: > -f_hash =3D hash_default_key40; > +f_hash =3D rte_table_hash_crc_key40; > break; > case 48: > -f_hash =3D hash_default_key48; > +f_hash =3D rte_table_hash_crc_key48; > break; > case 56: > -f_hash =3D hash_default_key56; > +f_hash =3D rte_table_hash_crc_key56; > break; > case 64: > -f_hash =3D hash_default_key64; > +f_hash =3D rte_table_hash_crc_key64; > break; > default: > return -1; > -- > 2.9.5 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.