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 1B167A05A0; Tue, 21 Apr 2020 23:09:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8FAA61C12E; Tue, 21 Apr 2020 23:09:30 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id 3467B1C10F for ; Tue, 21 Apr 2020 23:09:29 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id o127so143088iof.0 for ; Tue, 21 Apr 2020 14:09:29 -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; bh=Cb/0zQGu8d3cKz8FkFB79J3k8LwbatZuKzVqv1PCYYg=; b=YFIsi/H+O5rOKLkovVdQPABOE3mGoNkSJHZKIH7mAY4gp17hNH7idYv9eu1QnKKPnO 4RNxc+q4yJDy8wDrVYt0/T/xPqMNliMGrToNN0aF/UAxSAfI593T+wdIjJpB76zeTNRY t+hGJCLPufvwYh4dNCB6moIHqUZgHkDqHpWQRGGi8hCzeLCm33Kspp+QA4KmMAqTMf/G evGVULXGu8Sj5ztdG0BTosG9L8CTDxdBggQI3fjpR05JXeCFMvh7wNkQ5qOhF+BV/C0V xMDR8fel1KDN+LrlGzhiGU7HPgiuLj1Svkn0fhVOXorK/39BZtuVLNs4Se5vTrO4OVja I4Rg== X-Gm-Message-State: AGi0PuY24sKGwMKUbh29hzFJ9x1x76aYi7PVSvGe0I9Eso4NC11vUDTz meHd0/dsLasEJ8yKPYUKG4+hFT/lAZhNcF76pfw= X-Google-Smtp-Source: APiQypK+KJNHVcTEw962B3vh0ZrZSg4m6AtIE/6m+iKCjsbJ6/w6HkhFEwvLBeF1BqSw5Df3KxLUATnjg3SZgDj5Cyw= X-Received: by 2002:a02:c891:: with SMTP id m17mr4019902jao.25.1587503368394; Tue, 21 Apr 2020 14:09:28 -0700 (PDT) MIME-Version: 1.0 References: <20200421195446.1730-1-dg@adax.com> <20200421195446.1730-3-dg@adax.com> <20200421140310.32424051@hermes.lan> In-Reply-To: <20200421140310.32424051@hermes.lan> From: Dan Gora Date: Tue, 21 Apr 2020 18:08:52 -0300 Message-ID: To: Stephen Hemminger Cc: dev@dpdk.org, =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , David Marchand , Jerin Jacob Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 2/2] eal: resolve getentropy at run time for random seed 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 Tue, Apr 21, 2020 at 6:03 PM Stephen Hemminger wrote: > > On Tue, 21 Apr 2020 16:54:45 -0300 > Dan Gora wrote: > > > The getentropy() function was introduced into glibc v2.25 and so is > > not available on all supported platforms. Previously, if DPDK was > > compiled (using meson) on a system which has getentropy(), it would > > introduce a dependency on glibc v2.25 which would prevent that binary > > from running on a system with an older glibc. Similarly if DPDK was > > compiled on a system which did not have getentropy(), getentropy() > > could not be used even if the execution system supported it. > > > > Introduce a new static function, __rte_getentropy() which will try to > > resolve the getentropy() function dynamically using dlopen()/dlsym(), > > returning failure if the getentropy() function cannot be resolved or > > if it fails. > > > > This also allows getentropy() to be used as the random seed source > > when the traditional Makefile build for DPDK is used. > > > > Signed-off-by: Dan Gora > > I don't think DPDK has a requirement that building on newer glibc > has to work when run on older version. Glibc doesn't support it. Maybe it's not a requirement, but it's nice to not have to worry about it. Plus, you can compile on a machine which doesn't have getentropy(), but still use it if it's available on the execution machine. It just removes one more requirement that has to match between the compilation and target environement. thanks dan