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 586D6A04A4; Thu, 30 Apr 2020 22:44:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 369CE1DBE8; Thu, 30 Apr 2020 22:44:29 +0200 (CEST) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by dpdk.org (Postfix) with ESMTP id CAE181DBC8 for ; Thu, 30 Apr 2020 22:44:27 +0200 (CEST) Received: by mail-io1-f66.google.com with SMTP id z2so2950022iol.11 for ; Thu, 30 Apr 2020 13:44:27 -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=1/9FH7weyLdJHJOeCZH+fojvQ3A2Ga1Z8kh7qcvcYUc=; b=fJ1MwWzujg/yR/7BFu0khXAlLEztOXDhJcyyDZsQVCjwEEabhb63ZHTGpK7Hdx8HzN utYqH2o2vk3NawGrKO/tHjV/tiq4UOPpIZSwfqppNKAzknpczLDOLR2Pi6uTZEVE/P2T 7zFZeDwkfvYl6+e4G9lhqjKWZ4Taf0rTicWjoczATlbgzwiQu1kSjOQG5wYRHwPJkQy6 ul9sJXB50g3nrp9EJ02JLIOCgUSK5L9YL/La7Mz9buRIjMjdA+4QGjJqCeBExjBVOTo3 cfteHCn4vYt/Bm4zcO0F/jgmTnUMQ9xRju8eU9AR2zzGr/F3X+qH7imX3h1+s6MDPIjh InLQ== X-Gm-Message-State: AGi0PuZfW1J/9bjBlu8ZGY+zZAu8FQWntuNCJrc0H1q8rp9UwEFvvYTo lBdqA+Rp1ePUSYP4o084jaWhyM4+XUjrn5fF7zg= X-Google-Smtp-Source: APiQypLTxGLaN15dxbCJEZhkeONLI608g1MAPXSdjB7X+d5Ez6tmVBM9IP7zzLmzCJfkXL5CA+IwW9s06i2UIXJDZ70= X-Received: by 2002:a02:cbba:: with SMTP id v26mr250587jap.14.1588279467001; Thu, 30 Apr 2020 13:44:27 -0700 (PDT) MIME-Version: 1.0 References: <20200421195446.1730-1-dg@adax.com> <20200421195446.1730-3-dg@adax.com> <5df15087-781e-d27f-b7d8-50b1b8cb0c94@ericsson.com> <80e5cf97-feae-c753-5c65-4f3b121729f3@ericsson.com> <9782db5b1e5d2dfdcfa8e52410fd166df5db938d.camel@debian.org> In-Reply-To: From: Dan Gora Date: Thu, 30 Apr 2020 17:43:51 -0300 Message-ID: To: Luca Boccassi Cc: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , "dev@dpdk.org" , 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 Thu, Apr 30, 2020 at 5:29 PM Luca Boccassi wrote: > > > Adding a new dependecy happens only when building with the new version > > > of the library. If it's not available, then there's no new dependency. > > > > But you also do not get to use the new getentropy() if you happen to > > compile on a system which does not have the latest glibc, or if you > > use the makefile system.. > > And that's perfectly fine - backward compatibility workarounds are not > a problem to me. > > > > It sounds to me like you are trying to add workarounds for issues in > > > your downstream build/deployment model, where your build dependencies > > > are newer than your runtime dependencies. This in general is rarely > > > well supported. > > > > I am fully aware of that. I am not adding "workarounds", I am > > eliminating unnecessary dependencies which probably never should have > > been introduced in the first place. > > It's not unnecessary. It's a better interface, and worth using if > available. "if available" is the key phrase here.. It not only has to be available on the execution machine, it has to be available on the compilation machine as well... > > > > Now I'm fine with adding workarounds as _fallbacks_ - what I am > > > explicitly NACKing is forcibly restricting to the least common > > > denominator because of issues in a third party build/deployment system > > > that doesn't follow the common norm. > > > > ugh.. this is the exact _opposite_ of what this patch does. It is not > > restricting anything to a least common denominator. It is allowing > > the DPDK to use the "best" available function, regardless of the build > > system. > > > > Restricting to the least common denominator is what the original patch did... > > This is restricting to the least common denominator of /dev/urandom, > which is a bad interface, frail with issues that everybody is moving > away from, in favour of the programmatic API that this patch is > removing, in order to fix a corner case with a non-standard, third- > party build system that downgrades dependencies at runtime vs build > time. Well, no, because rdseed is used first if available and /dev/urandom is used next.. And this is not a corner case at all.. There are lots of linux distributions which DPDK claims to support which do not support getentropy(). This is hardly a non-standard build system. You really compile and support a separate binary for every possible system that your customers will use? And what is this about third parties? Last I checked DPDK was an API framework, not a proprietary standalone application. It is designed, by definition, to be used by "third parties". Or does it only have to work in Intel's toolchains? > > > > This is especially true when dealing with RNG APIs, where the tiniest > > > and most innocent-looking mistake could have disastrous consequences. > > > > This does not change the functionality of the RNG at all. It just > > makes it work in the way that it was intended. These changes were > > only introduced into 19.08, so they are not historical artifacts or > > anything. > > It's reimplementing a syscall using a different interface which has > different semantics. A small mistake there is going to cost us dearly. The code was copied almost verbatim from the getentropy() function in glibc, it's hard to see it going that wrong there. The code can be tested using the same test cases that the original patch used. I don't see how there is a difference in test coverage here. If it's such a big deal to use /dev/urandom, then what about my v3 patch which used dlopen()/dlsym() to try to find getentropy()? Is that not then acceptable? dlopen/dlsym() are used in several placed in DPDK. thanks dan