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 084A942DEA; Thu, 6 Jul 2023 18:20:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DFAA141101; Thu, 6 Jul 2023 18:20:25 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 8E645410FA for ; Thu, 6 Jul 2023 18:20:24 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 140E0320090E; Thu, 6 Jul 2023 12:20:22 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 06 Jul 2023 12:20:23 -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= 1688660422; x=1688746822; bh=QPv0T8YmOmuh8UsxTruQO/nQ4nN3W4P3ncx XlPP/iTk=; b=s6j7/wsyn31tyw07LY8oVZ7HbzUEt7y/mo+sb2/+w3FLovg5+Zz Ap0U0QHihXvATu1MvBvJX8i2uHyXEDZLJu+hrcrvYxOuBXJrmWZir94MFfAYypTM VESZDuACuQNlTYQQfxphUM4mHKbLELDR5rBynBatHhgUtO2tZQoFOSBg8sfmQmSl MiUl2qpSFVZ1qt/hR5IPo+yy2qx/svMIVQvYfvdFHVdDuJGElAqhyKr2CMuWoUGM L30J9E5Q5jP4PTEC5QynNUAr0lmHrcp0xUWNepah5sUs+b6YJHBBK4DxgSa2ZMml EzO9rMfAa+3VE9INqxFgdqcxbFQepc1I9Gg== 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= 1688660422; x=1688746822; bh=QPv0T8YmOmuh8UsxTruQO/nQ4nN3W4P3ncx XlPP/iTk=; b=hBeVTd9H57w0xT11ywzMt/s7VlI2FPJrEXGCSgLOG3CAQ2FrmPv c5g+mclLP1Jv2OmiSmTbbilybgr8P9b3SPp3qiPKTjbeTZaHOx+HOlgswstNFvFf zwZTybf7G5Y8HwG7tg7eLHPDqlKmyBpGbyl42ZSkiiNQ3+bmDQMJ/a3xQHwnQ6rb NtL3QuXmTilRAshFP56INoJS7n10kpGCve5DOfXKq6YhDauQ4SEb5U86DQzSrF9V cOLSpkoNYJyp9dX2NiDpT+XWTcx1AZSOMhiFzzcBvn+R3FL+hMP6RMdxf8e5S5k6 V4YZb5lBiDUdD601skPvrbFbie/BRR5hJxw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudelgdellecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddtieek gfekudehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Jul 2023 12:20:21 -0400 (EDT) From: Thomas Monjalon To: Stephen Hemminger Cc: Dmitry Kozlyuk , dev@dpdk.org, leyi.rong@intel.com, Yipeng Wang , Sameh Gobriel , Alan Liu Subject: Re: [PATCH] member: fix PRNG seed reset in NitroSketch mode Date: Thu, 06 Jul 2023 18:20:19 +0200 Message-ID: <4969062.ejJDZkT8p0@thomas> In-Reply-To: <20230703085458.23c383e6@hermes.local> References: <20230620211720.350336-1-dmitry.kozliuk@gmail.com> <20230703085458.23c383e6@hermes.local> 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 03/07/2023 17:54, Stephen Hemminger: > On Wed, 21 Jun 2023 00:17:20 +0300 > Dmitry Kozlyuk wrote: > > > 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 > > This raises a more global issue. > rte_srand() overrides the system seed which is set during startup. > This is a bad thing, it reduces the entropy in the random number generator. > > There are two possible solutions to this: > 1. Remove all all calls to rte_srand() and deprecate it. > 2. Make rte_srand() add a fixed value to existing entropy. This is what the > kernel PRNG does. It adds any user supplied additional entropy to original > state. > > Looking at current source. > - code in tests seeding PRNG with TSC. This is unnecessary and can be removed. > - this code in member library. Should be removed. > > Acked-by: Stephen Hemminger Applied, thanks. What's next regarding rte_srand?