From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 23FC942DC3; Mon, 3 Jul 2023 17:00:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13F05410DC; Mon, 3 Jul 2023 17:00:36 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 9C5DC410DC for ; Mon, 3 Jul 2023 17:00:34 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 50BC25C0228; Mon, 3 Jul 2023 11:00:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 03 Jul 2023 11:00:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1688396434; x=1688482834; bh=ZZMwv+oo90x8MmKrB8cORgFxTMVMJaQxbsS /twK0oh0=; b=XsJYPVXEqI6YLLpBowEhSvaLQFbJgkUbuZX1wEaboohTP2l2N2y OrLfT1KAz+5piDhIlITMAEJKOIUwWIj5xGBvRUlKf+E62vD+mr60YLeVi2SCtVRp t4EOPWkH8unxIS3LViWTQIYJyHtg4OBRubxMYJ/q90LgXCvugjtlsO5maXdvQg3T i/VuqHQXusyLc7Eiq6DFwVKJMAJqAaafGDEv7j9Y8i8oqmq06uYMRUU/6MVo15b4 XHTqqDMGw17RAQQ5gjeM/2kFgyyE4CAzL9UiSHq0+cLWaOEG2fBTi7FR9PcalhxW l5N1UsTVWpMkkHuzQDGkAZeuOxJl7aDJ4tw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1688396434; x=1688482834; bh=ZZMwv+oo90x8MmKrB8cORgFxTMVMJaQxbsS /twK0oh0=; b=DlIHFeK7Sa8CHYcfWSH6drHy5AW+JPy5RPPxu6/PeLhx0VyiHHW XUBqbqyrqA1PTgA9ebGNv1806PWY+yrixFgkpXXLQWYPF3ZxdXiSSkcgseL73+Qx HtDw2Aeafx301SDXkOmLKYTrQfjuRbIDOs/CZtTHVNYQKLUk3Pit62yGt/9kLxsK xi5rGydn8NNpWCFeVI74ogXGBgOSpFWPGz0YMvYJMoneGK9uHfbkV9UMk9DX54sh v6MePZd+p5x+hflkAwjRH2r5fHnp78Fs10vGNsxeow6EtlpkanmY2b3H359RC3eq 49w3KUqu/DsggDnjeGq8CwzNKV9U7Ni4Meg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddvgdekudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddtieek gfekudehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 3 Jul 2023 11:00:32 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Dmitry Kozlyuk , leyi.rong@intel.com, Yipeng Wang , Sameh Gobriel , Alan Liu , Dmitry Kozlyuk Subject: Re: [PATCH] member: fix PRNG seed reset in NitroSketch mode Date: Mon, 03 Jul 2023 17:00:31 +0200 Message-ID: <10296784.nUPlyArG6x@thomas> In-Reply-To: <20230620211720.350336-1-dmitry.kozliuk@gmail.com> References: <20230620211720.350336-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Any comment? 20/06/2023 23:17, Dmitry Kozlyuk: > Sketch creation seeded the global PRNG > using the supplied seed for hashing. > The use of this seed by SKETCH set summary was not documented. > SKETCH set summary does not require two independent hash seeds, > unlike other set summary types. > Seeding the global PRNG at sketch creation > does not make the sketch operation deterministic: > it uses rte_rand() later, the PRNG may be seeded again by that point. > On the other hand, seeding the global PRNG with a hash seed, > is likely undesired, because it may be low-entropy or even constant. > Deterministic operation can be achieved by seeding the PRNG externally. > > Remove the call to rte_srand() at sketch creation. > Document that hash seeds are not used by SKETCH set summary type. > > Fixes: db354bd2e1f8 ("member: add NitroSketch mode") > Cc: leyi.rong@intel.com > > Signed-off-by: Dmitry Kozlyuk > --- > lib/member/rte_member.h | 1 + > lib/member/rte_member_sketch.c | 1 - > 2 files changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/member/rte_member.h b/lib/member/rte_member.h > index 072a253c89..d08b143e51 100644 > --- a/lib/member/rte_member.h > +++ b/lib/member/rte_member.h > @@ -314,6 +314,7 @@ struct rte_member_parameters { > * for bucket location. > * For vBF type, these two hashes and their combinations are used as > * hash locations to index the bit array. > + * For Sketch type, these seeds are not used. > */ > uint32_t prim_hash_seed; > > diff --git a/lib/member/rte_member_sketch.c b/lib/member/rte_member_sketch.c > index 524ba77620..d5f35aabe9 100644 > --- a/lib/member/rte_member_sketch.c > +++ b/lib/member/rte_member_sketch.c > @@ -227,7 +227,6 @@ rte_member_create_sketch(struct rte_member_setsum *ss, > goto error_runtime; > } > > - rte_srand(ss->prim_hash_seed); > for (i = 0; i < ss->num_row; i++) > ss->hash_seeds[i] = rte_rand(); > >