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 93764A0350; Mon, 29 Jun 2020 20:01:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 305C91BF82; Mon, 29 Jun 2020 20:01:52 +0200 (CEST) Received: from mail-il1-f196.google.com (mail-il1-f196.google.com [209.85.166.196]) by dpdk.org (Postfix) with ESMTP id 6F5F31BF81 for ; Mon, 29 Jun 2020 20:01:50 +0200 (CEST) Received: by mail-il1-f196.google.com with SMTP id k6so15263466ili.6 for ; Mon, 29 Jun 2020 11:01:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=05M+BcoBpHHmnMGh3UUybxTZrHz3Bw8Nq4b8H0DdA54=; b=fyzwnctlFO8U25t9OPUHTs126cn66zxen6OLF0sEp12f7KOEf73FoWuGPkTp4g3K/r wtXlI7mwUN1lXkpXWtMyUSNxSfktbJeN69PWcPf9ROKjEfLAh5O7frH+SI10cj0ZudQd Z7rc4b9TU8QeDahYt+w7KBLHC5pqzlsBD5GeMpeoiHymNjmWZc+GjOGzk2JP9kJTsyyi ilap2VnbCVue+hQWqx16V+4P5yGb2UO3ctqo4ldC1j8K5GqaQgXnvsG+wrlFrJJHBCIA Jk8YX29JlVeExfRNaiU5Oq/pBB2ipj1rjEKB/Pgqxg0+/BfVSJ4jlp369TrCD0v5y5aQ POsA== X-Gm-Message-State: AOAM530wZ0qD2jJpFLZ9FO6vfs6aFMeltrJ6UvSsoT/G0kHzmjdF1FgP E8F+na/7nWcjsObBwkAXQZndRDFqUBtZmLwtfbM= X-Google-Smtp-Source: ABdhPJxZOYF//Kz00NUPlc5s5YkrMK3KmyT6Ad+J/wjFNhiKOoMIly2ej7pAkQmZ+/Tt6fq18xp4D6VO/u4shS7D9Yw= X-Received: by 2002:a92:cc41:: with SMTP id t1mr17929533ilq.132.1593453709760; Mon, 29 Jun 2020 11:01:49 -0700 (PDT) MIME-Version: 1.0 References: <20200421195446.1730-1-dg@adax.com> <20200422234255.7066-1-dg@adax.com> <7c4c38bb-ecec-8cad-1220-c6a057574e0e@ericsson.com> In-Reply-To: <7c4c38bb-ecec-8cad-1220-c6a057574e0e@ericsson.com> From: Dan Gora Date: Mon, 29 Jun 2020 15:01:13 -0300 Message-ID: To: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= Cc: "dev@dpdk.org" , David Marchand , Jerin Jacob Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v4 0/2] eal: choose initial PRNG seed source at runtime 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" On Mon, Jun 29, 2020 at 6:32 AM Mattias R=C3=B6nnblom wrote: > > On 2020-04-23 01:42, Dan Gora wrote: > > Hi All, > > > > The following patches updates the rte_random subsystem to dynamically f= ind > > the best source of the initial seed to the PRNG at run time. > > > > The first patch enables dynamic checking for the rdseed instruction and > > removes the requirement for it on the execution system. It also ensure= s > > that the code to use the rdseed instruction is generated, even if the h= ost > > compilation system does not support it (on x86 systems). > > > > The second patch emulates the getentropy() glibc function by reading by= tes > > from /dev/urandom. This removes an unnecessary dependency on glibc 2.2= 5. > > > > v4: Note that emulating getentropy by reading from /dev/urandom should > > never fail, so now the question is if we should just remove the rdseed > > method entirely since it's x86 only? Should we remove the fallback to > > rte_get_tsc_cycles()? > > > > Thanks > > Dan > > > > ----- > > v2: > > * Fix patch apply issue. > > * dlclose() handle if dlsym() fails in __rte_getentropy(). > > > > v3: > > * Fix error checking of dlsym() in __rte_getentropy(). > > * Style changes recommended by Mattias. > > > > v4: > > * Replace dlopen/dlsym method with reading from /dev/urandom. > > * Try rdseed method before getentropy() method since the > > latter should never fail. > > > I see no reason to prefer rdseed over the kernel. Let me give you a good reason. The reason that this change was done... Since rte_getentropy() is now available on all systems (with these patches) and cannot fail. rdseed can either 1) go before rte_getentropy() or 2) be completely removed. What do you recommend? thanks dan