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 B1D2FA046B for ; Fri, 28 Jun 2019 11:01:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 586281B9AC; Fri, 28 Jun 2019 11:01:39 +0200 (CEST) Received: from sesbmg22.ericsson.net (sesbmg22.ericsson.net [193.180.251.48]) by dpdk.org (Postfix) with ESMTP id 776724C6C for ; Fri, 28 Jun 2019 11:01:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1561712489; x=1564304489; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZvSCKu33XY4zX5GCRmiYvfrQEqWjgeXkdq+Kgw3YBws=; b=VrwT6lBb+8iKE8r6g0dRDLuVyAxGRx4yQtaUgPFMY+0rKnNgL6GIMHvU1aa62/kn 8B6xavb+RZVYKEFRi4vvxkin/GlWecAVDAj0V+nP9XluCKJz33XT/RT4rku8waER AR0eBXJHgGZcauIiFdA2Z/3jtfqO2WHiBLnW+Px1i6o=; X-AuditID: c1b4fb30-6f5ff70000001814-81-5d15d769a26c Received: from ESESBMB505.ericsson.se (Unknown_Domain [153.88.183.118]) by sesbmg22.ericsson.net (Symantec Mail Security) with SMTP id 4E.97.06164.967D51D5; Fri, 28 Jun 2019 11:01:29 +0200 (CEST) Received: from ESESSMR501.ericsson.se (153.88.183.108) by ESESBMB505.ericsson.se (153.88.183.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 28 Jun 2019 11:01:29 +0200 Received: from ESESBMB502.ericsson.se (153.88.183.169) by ESESSMR501.ericsson.se (153.88.183.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 28 Jun 2019 11:01:29 +0200 Received: from selio1a020.lmera.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.185) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Fri, 28 Jun 2019 11:01:29 +0200 Received: from breslau.lmera.ericsson.se (breslau.lmera.ericsson.se [150.132.109.241]) by selio1a020.lmera.ericsson.se (8.15.1+Sun/8.15.1) with ESMTP id x5S91SYU019342; Fri, 28 Jun 2019 11:01:28 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: , , , , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Fri, 28 Jun 2019 11:01:19 +0200 Message-ID: <20190628090124.16849-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190605104400.24484-1-mattias.ronnblom@ericsson.com> References: <20190605104400.24484-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeLIzCtJLcpLzFFi42KZGbG9TDfzumisQeNqY4sbq+wttq/oYrN4 92k7k8Wt5pNsFovvyFl8enCCxYHN49eCpawei/e8ZPI4dnMau0fPyXlMHu/3XWXzuPJ9NWMA WxSXTUpqTmZZapG+XQJXRt/Zq0wF50QrOm/OZWtg3CnQxcjJISFgIvHu3iPmLkYuDiGBo4wS R3Z1MEI43xglNv5rYoVzHhzZwQLhXGSUeP71LFTZZUaJV/MOMIIMYxPwlJj8rpsFxBYREJJY +vEyO0gRs8A1Romvl14wgySEBVwkHk39CdbAIqAqcXj1FCCbg4NXwEli06p6iKPkJVZvOABW zingLPF4+n4mEFsIqKTr/0E2EJtXQFDi5MwnYLuYBTQlWrf/Zoew5SWat85mhqjXkri/5Avz BEbhWUhaZiFpmYWkZQEj8ypG0eLU4qTcdCMjvdSizOTi4vw8vbzUkk2MwJg5uOW3wQ7Gl88d DzEKcDAq8fAu2CMaK8SaWFZcmXuIUYKDWUmEV/KcSKwQb0piZVVqUX58UWlOavEhRmkOFiVx 3vXe/2KEBNITS1KzU1MLUotgskwcnFINjAVtjWst2xdcFTYRl59uWPdBR33y7d+zn6mImx3n tuRtd19mmfnu6E8jTZXNQUXt1ZYJ/7hYOkKcLRXuREVs9ejjSN3WVhnyQP1H27KKyo8Ff/sj RK5PSAosKZt2PzzCtFFW/ZG5cuw76e+fL730U/zr8JE1rPmomqvSxKIb667vyY9U39OhxFKc kWioxVxUnAgA+o5uqJUCAAA= Subject: [dpdk-dev] [PATCH v4 0/5] Pseudo-random number generation improvements 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" Fix bugs in DPDK pseudo-random number generation, make it multi-thread safe, go faster and produce better-quality pseudo-random numbers. Thanks to Stephen Hemminger, Bruce Richardson, Keith Wiles and Neil Horman for valuable feedback. PATCH v4: * Fold the MAINTAINERS update and release notes commit into the other commits. * Add rte_rand() performance test to the meson build. PATCH v3: * Rebase PATCH v2: * Introduce the x86 rdseed machine instruction as a first fallback, in case getentropy() is unavailable * Use meson to detect getentropy() and rdseed PATCH v1: * Added performance tests * Added __experimental to rte_rand_max() declaration * Introduced a PRNG section in the MAINTAINERS file * Added missing include * Use getentropy() instead of rdtsc for seeding the internal LCG RFC v3: * Since rte_rand() and rte_srand() have been a part of the API since long, the experimental attribute was removed and the symbols were moved out of the experimental section of the version.map file. * rte_rand_max() performance improvements: * Avoid repeated rte_lcore_id() calls. * Handle a power-of-2 upper bound as a special case. * Added a Bugzilla reference to the rte_rand() MT safety bug. RFC v2: * Removed 32-bit version of rte_rand() and rte_rand_max(). * Switched from a four-sequence LFSR (producing a 32-bit number) to a five-sequence LFSR (producing a 64-bit number). * Added a note on generator not being cryptographically secure. Mattias Rönnblom (5): eal: replace libc-based random number generation with LFSR eal: add pseudo-random number generation performance test eal: improve entropy for initial PRNG seed eal: introduce random generator function with upper bound eal: add bounded PRNG performance tests MAINTAINERS | 6 + app/test/Makefile | 1 + app/test/meson.build | 2 + app/test/test_rand_perf.c | 92 +++++++++ doc/guides/rel_notes/release_19_08.rst | 14 +- lib/librte_eal/common/include/rte_random.h | 47 +++-- lib/librte_eal/common/meson.build | 1 + lib/librte_eal/common/rte_random.c | 212 +++++++++++++++++++++ lib/librte_eal/freebsd/eal/Makefile | 1 + lib/librte_eal/freebsd/eal/eal.c | 2 - lib/librte_eal/linux/eal/Makefile | 1 + lib/librte_eal/linux/eal/eal.c | 2 - lib/librte_eal/meson.build | 3 + lib/librte_eal/rte_eal_version.map | 3 + 14 files changed, 364 insertions(+), 23 deletions(-) create mode 100644 app/test/test_rand_perf.c create mode 100644 lib/librte_eal/common/rte_random.c -- 2.17.1