From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5212DA04C2; Mon, 25 Nov 2019 16:51:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A93202952; Mon, 25 Nov 2019 16:51:19 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9CADFA3 for ; Mon, 25 Nov 2019 16:51:17 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Nov 2019 07:51:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,241,1571727600"; d="scan'208";a="216954871" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 25 Nov 2019 07:51:16 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 25 Nov 2019 07:51:16 -0800 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (104.47.49.52) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 25 Nov 2019 07:51:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=exacoI3mJbgL+VzpgHHQyNlHcauWUI9sUlRnq/ZiuHGGtqCWU3ER3j/weGXsxsc2jyX/TfXrbbD1Z+WfM2CtuKPQCGj98u2uIeDisOnCUTC3WyWANYQBWs766/st1v6YRjKvcot9fTmmPJveAPJOpubtoyuEh9otAOt7zsRVv+1Zk/A+BO30BhoFaNY9rz3gBph4KRieVtL6CoLjVLJMMaw9q5dzq23yzRc6/60aMY7xQkiH5yexJ8W2stII2tEF33hGJ21eBvnvO6WOpxBFtmz/UB4uB4Akx+1cd4arcfsuPuHmhRQ3gCKDTwBl6b87jHm2kW+MCvCZwnF82sA7ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bQO34pIE+RWbalsr8KWvJfQbtA47KUljF7O/1kY4fTY=; b=XlU+MTqElMFQSDFUMJrpQklFiJsBfpDFBqF1nHsOE5PL/a8SBm3v3d/+wQUrft0WhBE4IxYNSl3gr3MtHcqHLtS9FogyqvaRTEBLen0E5Wn3KtQ4HiACU2cBRK0yGm9olGJUvgWy8GTkRvkocnZQ8iZXMDS6KNbpRCLE1jxYdpdgKCQQweZymyRRtkPZW4a1wKj/OQZM+wTMJmRexqGyIpECUbcWj1Jtm/XinHSYsq8ICEYCzxurYY0l8AbOQp5ZWaOzSIiLYUodCkFUBVHaBJ6JfUK3NF/01th2hDZStqmkD2RgVMosArlMDuNFBvzd6lzyMwriW8aB5JnZJyIFVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bQO34pIE+RWbalsr8KWvJfQbtA47KUljF7O/1kY4fTY=; b=HnmW8HrEaojfSychyPXhA/LgSd80dmEutXEn6PYm8Qvgu8Ge8ZdVHSfQCZnTCTiKbg8qAwgLaNbRnuyGHnmu1Inz7+L8uEHGIbjug817WEBTOz3JZBFlVtBMDY/ixfZmZq4dDGNRKZhCjeTKAtoPOSwiPyz24mWK1GxXz2xFbcs= Received: from SN6PR11MB3326.namprd11.prod.outlook.com (52.135.111.76) by SN6PR11MB3118.namprd11.prod.outlook.com (52.135.126.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Mon, 25 Nov 2019 15:50:50 +0000 Received: from SN6PR11MB3326.namprd11.prod.outlook.com ([fe80::c9f5:4621:9696:f157]) by SN6PR11MB3326.namprd11.prod.outlook.com ([fe80::c9f5:4621:9696:f157%3]) with mapi id 15.20.2474.023; Mon, 25 Nov 2019 15:50:50 +0000 From: "Amber, Kumar" To: "dev@dpdk.org" CC: "Wang, Yipeng1" , "Yigit, Ferruh" , "thomas@monjalon.net" , "Van Haaren, Harry" , "aconole@redhat.com" , "Thakur, Sham Singh" Thread-Topic: [dpdk-dev] [PATCH v3] hash: added a new API to hash to query key id Thread-Index: AQHVoWHE18ouHsdrak2Xx4IeR3wB5aebvnSAgABMWVA= Date: Mon, 25 Nov 2019 15:50:50 +0000 Message-ID: References: <20191122182100.15631-1-kumar.amber@intel.com> <20191125110805.28187-1-kumar.amber@intel.com> In-Reply-To: <20191125110805.28187-1-kumar.amber@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjczZmYwODgtNTYzZi00NWMxLTk3NTctODA4OWRjOTllNWMwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUG1vMFFtbkZBVW0rZWxaYTZPOGZFU2hTTTF2bE9VOUlQcjlRQzlpakYyY1d3SXdPUlZveTlnUkV2U2w2cUtsRSJ9 dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=kumar.amber@intel.com; x-originating-ip: [192.55.79.127] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c00b80f7-9993-41bd-1336-08d771bf3ef7 x-ms-traffictypediagnostic: SN6PR11MB3118: x-ms-exchange-purlcount: 1 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0232B30BBC x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(396003)(39860400002)(136003)(366004)(13464003)(189003)(53754006)(199004)(26005)(5640700003)(256004)(966005)(33656002)(6506007)(6306002)(6916009)(107886003)(6246003)(478600001)(25786009)(305945005)(9686003)(74316002)(7696005)(102836004)(7736002)(186003)(86362001)(4326008)(76176011)(53546011)(55016002)(66476007)(71200400001)(66446008)(2906002)(2351001)(52536014)(5660300002)(8936002)(81166006)(81156014)(1730700003)(76116006)(66946007)(2501003)(446003)(6436002)(229853002)(14454004)(99286004)(11346002)(66066001)(14444005)(316002)(54906003)(71190400001)(64756008)(8676002)(6116002)(3846002)(66556008); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB3118; H:SN6PR11MB3326.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eDZ01ag4LJJ/PSRw5nPJEN6tSX8talCNgEn4vLEu3ADUtO+SI2OOaPQLaDY9Fjfnc4a9sJVFclU3jajXg7DI1NS+0pwdi/b5pi/+qDPPHd1fwqWJKSsTfmhOghU63GLW67j5u2T46Adoj/tp+wBJekWHrjJl8evTfzZhjYRs8EwTrAU3RPPPSSAsB33isrowtCvSSo4q0/pNj5Jxbnk6HbUa00MWG/fgrth0c6/TEThabL9B9nPRl/ioU6u3l9zJtPdAFasq15cKH1lg238Ay9AhMsF6GozYYOb5GQRPLGRL0rlt6ouh7qWH+nV1UvRA1slkFwdmSZ6QKIdPUyeirEbqcmi4REvgwSJoCMo1GsLWvnGhUJFbw4ftGUVbl8uJ2D5qYxh04vfgTFlD8SlHr+OgaIEu6tKzVkrobpJrdkATPTqUO5/Va6+rOEwXBTQgoBEt/GPciPwmSPrb51OQdJRSjd/9DebSPZENSBxZJZg= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c00b80f7-9993-41bd-1336-08d771bf3ef7 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2019 15:50:50.4038 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +p9z5MiTS4Rv1IMKHt7aWsoT3EPc0uTlFifTwWG4aE76u1pmX98DwmbKQnzJHB5GtFn+QnxeFnZQ6hL1WlFr/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3118 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3] hash: added a new API to hash to query key id 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi all , I want to report random untouched unit test cases failed by Jenkins . pls c= an you guys check why it is unstable ?=20 Every upload shows random test failed . http://mails.dpdk.org/archives/test-report/2019-November/109120.html=20 Regards Amber=20 -----Original Message----- From: dev On Behalf Of Kumar Amber Sent: Monday, November 25, 2019 4:38 PM To: dev@dpdk.org Cc: Wang, Yipeng1 Subject: [dpdk-dev] [PATCH v3] hash: added a new API to hash to query key i= d Adding new API function to query the maximum key ID that could possibly ret= urned by rte_hash_add_key and rte_hash_add_key_with_hash. When RTE_HASH_EXT= RA_FLAGS_MULTI_WRITER_ADD is set, the maximum key id is larger than the entry count specified by the = user. Signed-off-by: Kumar Amber --- lib/librte_hash/rte_cuckoo_hash.c | 15 +++++++++++++++ lib/librte_hash/rte_hash.h | 25 +++++++++++++++++++++++-- lib/librte_hash/rte_hash_version.map | 1 + 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo= _hash.c index 87a4c01f2..3a94f10b8 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -506,6 +506,21 @@ rte_hash_hash(const struct rte_hash *h, const void *ke= y) return h->hash_func(key, h->key_len, h->hash_func_init_val); } =20 +uint32_t +rte_hash_max_key_id(const struct rte_hash *h) { + RETURN_IF_TRUE((h =3D=3D NULL), -EINVAL); + if (h->use_local_cache) + /* + * Increase number of slots by total number of indices + * that can be stored in the lcore caches + */ + return (h->entries + ((RTE_MAX_LCORE - 1) * + (LCORE_CACHE_SIZE - 1))); + else + return h->entries; +} + int32_t rte_hash_count(const struct rte_hash *h) { diff --git a/lib/librte_hash/r= te_hash.h b/lib/librte_hash/rte_hash.h index 0d73370dc..c87861e72 100644 --- a/lib/librte_hash/rte_hash.h +++ b/lib/librte_hash/rte_hash.h @@ -164,6 +164,23 @@ rte_hash_reset(struct rte_hash *h); int32_t rte_hash= _count(const struct rte_hash *h); =20 +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * Return the maximum key value ID that could possibly be returned by + * rte_hash_add_key function. + * + * @param h + * Hash table to query from + * @return + * - -EINVAL if parameters are invalid + * - A value indicating the max key Id key slots present in the table. + */ +__rte_experimental +uint32_t +rte_hash_max_key_id(const struct rte_hash *h); + /** * Add a key-value pair to an existing hash table. * This operation is not multi-thread safe @@ -234,7 +251,9 @@ rte_hash_ad= d_key_with_hash_data(const struct rte_hash *h, const void *key, * - -EINVAL if the parameters are invalid. * - -ENOSPC if there is no space in the hash for this key. * - A positive value that can be used by the caller as an offset into a= n - * array of user data. This value is unique for this key. + * array of user data. This value is unique for this key. This + * unique key id may be larger than the user specified entry count + * when RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD flag is set. */ int32_t rte_hash_add_key(const struct rte_hash *h, const void *key); @@ -256,7 +27= 5,9 @@ rte_hash_add_key(const struct rte_hash *h, const void *key); * - -EINVAL if the parameters are invalid. * - -ENOSPC if there is no space in the hash for this key. * - A positive value that can be used by the caller as an offset into a= n - * array of user data. This value is unique for this key. + * array of user data. This value is unique for this key. This + * unique key ID may be larger than the user specified entry count + * when RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD flag is set. */ int32_t rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key, hash= _sig_t sig); diff --git a/lib/librte_hash/rte_hash_version.map b/lib/librte= _hash/rte_hash_version.map index 734ae28b0..562ceb8bc 100644 --- a/lib/librte_hash/rte_hash_version.map +++ b/lib/librte_hash/rte_hash_version.map @@ -58,5 +58,6 @@ EXPERIMENTAL { global: =20 rte_hash_free_key_with_position; + rte_hash_max_key_id; =20 }; -- 2.17.1