From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D7BF78DA9 for ; Tue, 22 Sep 2015 12:05:13 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 22 Sep 2015 03:05:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,572,1437462000"; d="scan'208";a="649905569" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga003.jf.intel.com with ESMTP; 22 Sep 2015 03:05:11 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.216]) by IRSMSX103.ger.corp.intel.com ([169.254.3.168]) with mapi id 14.03.0248.002; Tue, 22 Sep 2015 11:05:10 +0100 From: "Dumitrescu, Cristian" To: "Yeddula, Avinash" , "dev@dpdk.org" , "Bly, Mike" Thread-Topic: DPDK hash function related question Thread-Index: AdD0vV0EWrwqSA3rT+Ksi8qmzYCTywAYFeSg Date: Tue, 22 Sep 2015 10:05:10 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D89126478D64A1@IRSMSX108.ger.corp.intel.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] DPDK hash function related question 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: Tue, 22 Sep 2015 10:05:14 -0000 Hi Avinash, Yes, the hash function is configurable. Are you using a DPDK release older than 2.1? In DPDK we moved away from tes= t_hash to CRC-based hashes. Please take a look at DPDK release 2.1 examples= /ip_pipeline application: in pipeline_flow_classification_be.c, we use CRC-= based hash functions defined in file hash_func.h from the same folder. Regards, Cristian > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yeddula, Avinash > Sent: Tuesday, September 22, 2015 1:34 AM > To: dev@dpdk.org; Bly, Mike > Subject: [dpdk-dev] DPDK hash function related question >=20 > Hello All, >=20 > I'm DPDK extensible bucket hash in the rte_table library of packet > framework. My question is related to the actual hash function that comput= es > the hash signature. >=20 > All the available examples have initialized it to test_hash. I do not s= ee any > hash function available in rte_table library , that computes the actual > signature >=20 >=20 >=20 > struct rte_table_hash_ext_params hash_table_params =3D { >=20 > .key_size =3D TABLE_ENTRY_KEY_SIZE, >=20 > .n_keys =3D TABLE_MAX_SIZE, >=20 > .n_buckets =3D TABLE_MAX_BUCKET_COUNT, >=20 > .n_buckets_ext =3D TABLE_MAX_EXT_BUCKET_COUNT, >=20 > .f_hash =3D test_hash, >=20 > .seed =3D 0, >=20 > .signature_offset =3D 0; >=20 > .key_offset =3D __builtin_offsetof(struct metadata_t, tbl_key), >=20 > }; >=20 >=20 >=20 > So, I wanted to use hash functions from DPDK rte_hash library. This is wh= at > I'm doing and looking at the code this looks ok to me. >=20 > I'm at least a week or 2 away from testing this part of the code. I wante= d to > confirm that, there is no fundamental flaw in using the DPDK rte_hash lib= rary > and rte_table library like this. Could someone confirm this please ? >=20 >=20 >=20 > #define DEFAULT_HASH_FUNC rte_hash_crc >=20 >=20 >=20 > struct rte_table_hash_ext_params hash_table_params =3D { >=20 > .key_size =3D TABLE_ENTRY_KEY_SIZE, >=20 > .n_keys =3D TABLE_MAX_SIZE, >=20 > .n_buckets =3D TABLE_MAX_BUCKET_COUNT, >=20 > .n_buckets_ext =3D TABLE_MAX_EXT_BUCKET_COUNT, >=20 > .f_hash =3D DEFAULT_HASH_FUNC , >=20 > .seed =3D 0, >=20 > .signature_offset =3D 0; >=20 > .key_offset =3D __builtin_offsetof(struct metadata_t, tbl_key), >=20 > }; >=20 >=20 >=20 > Thanks >=20 > -Avinash >=20