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 C2236A04C2; Mon, 25 Nov 2019 17:58:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 97DCC2952; Mon, 25 Nov 2019 17:58:57 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 696D528EE for ; Mon, 25 Nov 2019 17:58:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574701135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pK9UU8t6vdDJLZ3FhXlk0shyOJjSYN4mD1XMhzUeTsw=; b=OkzT5gDAUgeegn9uCtgdeg06Iamzjfh/ctOD6q4s74KqhHQ9r34U8rXw3s4geHEI8t3xFS Cdvy47pPMa81D5QrWlGYmoZdSCCi8pvja/LiJvXhZEmqT4DnIyq6cs3o2CwlO+/XUaOqTF sQltJkgyjUcJPwGmXrz8hszfOC6fGzQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-192-b0KNT4KPP0SLOVZrJTEy0w-1; Mon, 25 Nov 2019 11:58:52 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1558B1857F36; Mon, 25 Nov 2019 16:58:51 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.127]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA2285C1D4; Mon, 25 Nov 2019 16:58:49 +0000 (UTC) From: Aaron Conole To: "Amber\, Kumar" Cc: "dev\@dpdk.org" , "Wang\, Yipeng1" , "Yigit\, Ferruh" , "thomas\@monjalon.net" , "Van Haaren\, Harry" , "Thakur\, Sham Singh" , David Marchand References: <20191122182100.15631-1-kumar.amber@intel.com> <20191125110805.28187-1-kumar.amber@intel.com> Date: Mon, 25 Nov 2019 11:58:48 -0500 In-Reply-To: (Kumar Amber's message of "Mon, 25 Nov 2019 15:50:50 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: b0KNT4KPP0SLOVZrJTEy0w-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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" "Amber, Kumar" writes: > Hi all , > > I want to report random untouched unit test cases failed by Jenkins > . pls can you guys check why it is unstable ? > Every upload shows random test failed . > > http://mails.dpdk.org/archives/test-report/2019-November/109120.html=20 I think the service core code needs the following patch: --- diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rt= e_service.c index 79235c03f8..f2efb8c4a5 100644 --- a/lib/librte_eal/common/rte_service.c +++ b/lib/librte_eal/common/rte_service.c @@ -383,7 +383,7 @@ rte_service_may_be_active(uint32_t id) =09int32_t lcore_count =3D rte_service_lcore_list(ids, RTE_MAX_LCORE); =09int i; =20 -=09if (!service_valid(id)) +=09if (id >=3D RTE_SERVICE_NUM_MAX || !service_valid(id)) =09=09return -EINVAL; =20 =09for (i =3D 0; i < lcore_count; i++) { @@ -398,7 +398,7 @@ int32_t rte_service_run_iter_on_app_lcore(uint32_t id, uint32_t serialize_mt_unsaf= e) { =09/* run service on calling core, using all-ones as the service mask */ -=09if (!service_valid(id)) +=09if (id >=3D RTE_SERVICE_NUM_MAX || !service_valid(id)) =09=09return -EINVAL; =20 =09struct core_state *cs =3D &lcore_states[rte_lcore_id()]; --- Harry? > 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= id > > Adding new API function to query the maximum key ID that could possibly r= eturned by rte_hash_add_key and rte_hash_add_key_with_hash. When RTE_HASH_E= XTRA_FLAGS_MULTI_WRITER_ADD > is set, the maximum key id is larger than the entry count specified by th= e 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_cuck= oo_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 *= key) > =09return 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) { > +=09RETURN_IF_TRUE((h =3D=3D NULL), -EINVAL); > +=09if (h->use_local_cache) > +=09=09/* > +=09=09 * Increase number of slots by total number of indices > +=09=09 * that can be stored in the lcore caches > +=09=09 */ > +=09=09return (h->entries + ((RTE_MAX_LCORE - 1) * > +=09=09=09=09=09(LCORE_CACHE_SIZE - 1))); > +=09else > +=09=09return h->entries; > +} > + > int32_t > rte_hash_count(const struct rte_hash *h) { diff --git a/lib/librte_hash= /rte_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_ha= sh_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_= add_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= an > - * 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 += 275,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= an > - * 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, ha= sh_sig_t sig); diff --git a/lib/librte_hash/rte_hash_version.map b/lib/libr= te_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 { > =09global: > =20 > =09rte_hash_free_key_with_position; > + rte_hash_max_key_id; > =20 > }; > -- > 2.17.1