From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0090.outbound.protection.outlook.com [157.55.234.90]) by dpdk.org (Postfix) with ESMTP id 6C27ADE6 for ; Wed, 15 Jul 2015 10:08:08 +0200 (CEST) Received: from AM2PR05MB0995.eurprd05.prod.outlook.com (10.161.234.145) by AM2PR05MB0995.eurprd05.prod.outlook.com (10.161.234.145) with Microsoft SMTP Server (TLS) id 15.1.213.14; Wed, 15 Jul 2015 08:08:07 +0000 Received: from AM2PR05MB0995.eurprd05.prod.outlook.com ([10.161.234.145]) by AM2PR05MB0995.eurprd05.prod.outlook.com ([10.161.234.145]) with mapi id 15.01.0213.000; Wed, 15 Jul 2015 08:08:07 +0000 From: Olga Shern To: Bruce Richardson , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] hash: rename unused field to "reserved" Thread-Index: AQHQvYpyo40tDDwjnECSOx0GN9t3Gp3cLwmA Date: Wed, 15 Jul 2015 08:08:07 +0000 Message-ID: References: <1436804751-23156-1-git-send-email-bruce.richardson@intel.com> <1436805525-25916-1-git-send-email-bruce.richardson@intel.com> In-Reply-To: <1436805525-25916-1-git-send-email-bruce.richardson@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none; x-originating-ip: [193.47.165.251] x-microsoft-exchange-diagnostics: 1; AM2PR05MB0995; 5:OAGMOLPTZNMSx8q3sTmuoBrDJyYPm4qD9grLK9DfzU/NuX10FS2abRKciTU63qHX3vJR/n+8KdK6DxxNIdNK663Dk122g5v3vusNifLOX/livDXXht+/2I/ynGlz9jWm+1X7RGGc78s0V5fQzD50rQ==; 24:7F2XM6n6OGrToDutwpQlgPkBgvVL9FU7vdY6NBDHtw2zHX17K3zvB9ChpQQ3DqnNCArShVNcDRLtQmPpE/l0E79Gbqyj2zNVWFht8d2RiwM=; 20:JXR51ZQ26wbM8CEjV9FPY8I1knk0rG/Tf0+rrsgOG55GQ8W7sU4Nl54EhXXsC5XaoCDJkEcPdzQMjmxuBIJZsQ== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM2PR05MB0995; am2pr05mb0995: X-MS-Exchange-Organization-RulesExecuted x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:AM2PR05MB0995; BCL:0; PCL:0; RULEID:; SRVR:AM2PR05MB0995; x-forefront-prvs: 0638FD5066 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(377454003)(13464003)(92566002)(76176999)(74316001)(66066001)(2656002)(2950100001)(86362001)(106116001)(19580405001)(5001770100001)(77096005)(5003600100002)(33656002)(46102003)(2900100001)(50986999)(2501003)(77156002)(19580395003)(189998001)(54356999)(40100003)(87936001)(5001960100002)(107886002)(122556002)(102836002)(76576001)(62966003)(5002640100001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR05MB0995; H:AM2PR05MB0995.eurprd05.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jul 2015 08:08:07.3902 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR05MB0995 Subject: Re: [dpdk-dev] [PATCH v2] hash: rename unused field to "reserved" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2015 08:08:08 -0000 Hi,=20 I see the following compilation error : dpdk/lib/librte_hash/rte_cuckoo_hash.c:145: error: flexible array member in= otherwise empty struct when compiling on RH6.5 Best Regards, Olga -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson Sent: Monday, July 13, 2015 7:39 PM To: dev@dpdk.org Subject: [dpdk-dev] [PATCH v2] hash: rename unused field to "reserved" The cuckoo hash has a fixed number of entries per bucket, so the configurat= ion parameter for this is unused. We change this field in the parameters st= ruct to "reserved" to indicate that there is now no such parameter value, w= hile at the same time keeping ABI consistency. Fixes: 48a399119619 ("hash: replace with cuckoo hash implementation") Suggested-by: Thomas Monjalon Signed-off-by: Bruce Richardson --- app/test/test_func_reentrancy.c | 1 - app/test/test_hash_perf.c | 1 - app/test/test_hash_scaling.c | 1 - drivers/net/enic/enic_clsf.c | 2 -- examples/l3fwd-power/main.c | 2 -- examples/l3fwd-vf/main.c | 1 - examples/l3fwd/main.c | 2 -- lib/librte_hash/rte_hash.h | 2 +- 8 files changed, 1 insertion(+), 11 deletions(-) diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentranc= y.c index 85504c0..be61773 100644 --- a/app/test/test_func_reentrancy.c +++ b/app/test/test_func_reentrancy.c @@ -226,7 +226,6 @@ hash_create_free(__attribute__((unused)) void *arg) struct rte_hash_parameters hash_params =3D { .name =3D NULL, .entries =3D 16, - .bucket_entries =3D 4, .key_len =3D 4, .hash_func =3D (rte_hash_function)rte_jhash_32b, .hash_func_init_val =3D 0, diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c index e9= a522b..a87fc80 100644 --- a/app/test/test_hash_perf.c +++ b/app/test/test_hash_perf.c @@ -100,7 +100,6 @@ int32_t positions[KEYS_TO_ADD]; /* Parameters used for hash table in unit test functions. */ static struc= t rte_hash_parameters ut_params =3D { .entries =3D MAX_ENTRIES, - .bucket_entries =3D BUCKET_SIZE, .hash_func =3D rte_jhash, .hash_func_init_val =3D 0, }; diff --git a/app/test/test_hash_scaling.c b/app/test/test_hash_scaling.c in= dex 682ae94..39602cb 100644 --- a/app/test/test_hash_scaling.c +++ b/app/test/test_hash_scaling.c @@ -129,7 +129,6 @@ test_hash_scaling(int locking_mode) uint64_t i, key; struct rte_hash_parameters hash_params =3D { .entries =3D num_iterations*2, - .bucket_entries =3D 16, .key_len =3D sizeof(key), .hash_func =3D rte_hash_crc, .hash_func_init_val =3D 0, diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c in= dex ca12d2d..9c2abfb 100644 --- a/drivers/net/enic/enic_clsf.c +++ b/drivers/net/enic/enic_clsf.c @@ -63,7 +63,6 @@ =20 #define SOCKET_0 0 #define ENICPMD_CLSF_HASH_ENTRIES ENICPMD_FDIR_MAX -#define ENICPMD_CLSF_BUCKET_ENTRIES 4 =20 void enic_fdir_stats_get(struct enic *enic, struct rte_eth_fdir_stats *sta= ts) { @@ -245,7 +244,6 @@ int enic_clsf_init(struct enic *enic) struct rte_hash_parameters hash_params =3D { .name =3D "enicpmd_clsf_hash", .entries =3D ENICPMD_CLSF_HASH_ENTRIES, - .bucket_entries =3D ENICPMD_CLSF_BUCKET_ENTRIES, .key_len =3D RTE_HASH_KEY_LENGTH_MAX, .hash_func =3D DEFAULT_HASH_FUNC, .hash_func_init_val =3D 0, diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c inde= x d4eba1a..6eb459d 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1247,7 +1247,6 @@ setup_hash(int socketid) struct rte_hash_parameters ipv4_l3fwd_hash_params =3D { .name =3D NULL, .entries =3D L3FWD_HASH_ENTRIES, - .bucket_entries =3D 4, .key_len =3D sizeof(struct ipv4_5tuple), .hash_func =3D DEFAULT_HASH_FUNC, .hash_func_init_val =3D 0, @@ -1256,7 +1255,6 @@ setup_hash(int socketid) struct rte_hash_parameters ipv6_l3fwd_hash_params =3D { .name =3D NULL, .entries =3D L3FWD_HASH_ENTRIES, - .bucket_entries =3D 4, .key_len =3D sizeof(struct ipv6_5tuple), .hash_func =3D DEFAULT_HASH_FUNC, .hash_func_init_val =3D 0, diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index ccbb= 02f..01f610e 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -251,7 +251,6 @@ static lookup_struct_t *l3fwd_lookup_struct[NB_SOCKETS]= ; struct rte_hash_parameters l3fwd_hash_params =3D { .name =3D "l3fwd_hash_0", .entries =3D L3FWD_HASH_ENTRIES, - .bucket_entries =3D 4, .key_len =3D sizeof(struct ipv4_5tuple), .hash_func =3D DEFAULT_HASH_FUNC, .hash_func_init_val =3D 0, diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 5c22ed1..d= ef9594 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -2162,7 +2162,6 @@ setup_hash(int socketid) struct rte_hash_parameters ipv4_l3fwd_hash_params =3D { .name =3D NULL, .entries =3D L3FWD_HASH_ENTRIES, - .bucket_entries =3D 4, .key_len =3D sizeof(union ipv4_5tuple_host), .hash_func =3D ipv4_hash_crc, .hash_func_init_val =3D 0, @@ -2171,7 +2170,6 @@ setup_hash(int socketid) struct rte_hash_parameters ipv6_l3fwd_hash_params =3D { .name =3D NULL, .entries =3D L3FWD_HASH_ENTRIES, - .bucket_entries =3D 4, .key_len =3D sizeof(union ipv6_5tuple_host), .hash_func =3D ipv6_hash_crc, .hash_func_init_val =3D 0, diff --git a/lib/librte_hash/rte_hash.h b/lib/librte_hash/rte_hash.h index = 68109d5..1cddc07 100644 --- a/lib/librte_hash/rte_hash.h +++ b/lib/librte_hash/rte_hash.h @@ -75,7 +75,7 @@ typedef uint32_t (*rte_hash_function)(const void *key, ui= nt32_t key_len, struct rte_hash_parameters { const char *name; /**< Name of the hash. */ uint32_t entries; /**< Total hash table entries. */ - uint32_t bucket_entries; /**< Bucket entries. */ + uint32_t reserved; /**< Unused field. Should be set to 0 */ uint32_t key_len; /**< Length of hash key. */ rte_hash_function hash_func; /**< Primary Hash function used to calculate= hash. */ uint32_t hash_func_init_val; /**< Init value used by hash_func. */ -- 2.4.3