From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 6A813A00E6 for ; Tue, 14 May 2019 11:21:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5B1DF5A6E; Tue, 14 May 2019 11:21:29 +0200 (CEST) Received: from sessmg23.ericsson.net (sessmg23.ericsson.net [193.180.251.45]) by dpdk.org (Postfix) with ESMTP id 3F83A5A4A for ; Tue, 14 May 2019 11:21:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1557825687; x=1560417687; 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=3l4upd3H3sULeme+9YFIvTPAKyxyvWBlFd4xquzyzFY=; b=btZ+9y174Nl0J8DG/dV+r+hk4k3B9NN9VpWPggcMpVaAT2kiHEsSKn/rGmt8jisw EkD3OThYRMDZphxqJRHcWIgJ32SpLvqrn/Qiash4cQg236ZXAJ7K+HETnQqWEcAu W0VvBQYwoC56wTCYbrARo4EqJOqy9tBAd0PC0UyZXsc=; X-AuditID: c1b4fb2d-5fccc9e000001a6d-63-5cda88974b3d Received: from ESESBMB503.ericsson.se (Unknown_Domain [153.88.183.116]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 65.A2.06765.7988ADC5; Tue, 14 May 2019 11:21:27 +0200 (CEST) Received: from ESESSMR506.ericsson.se (153.88.183.128) by ESESBMB503.ericsson.se (153.88.183.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 14 May 2019 11:21:27 +0200 Received: from ESESBMB504.ericsson.se (153.88.183.171) by ESESSMR506.ericsson.se (153.88.183.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 14 May 2019 11:21:27 +0200 Received: from selio1a020.lmera.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.187) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 14 May 2019 11:21:27 +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 x4E9LQN4027252; Tue, 14 May 2019 11:21:26 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: , , , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Tue, 14 May 2019 11:20:40 +0200 Message-ID: <20190514092046.30808-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508181014.7dde7580@xps13> References: <20190508181014.7dde7580@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRmVeSWpSXmKPExsUyM2J7ie70jlsxBh++aFrcWGVvsX1FF5vF u0/bmSxuNZ9ks1h8R86B1ePXgqWsHov3vGTy6Dk5j8nj/b6rbB5Xvq9mDGCN4rJJSc3JLEst 0rdL4MrYfmwfe8FnwYoVd7tZGhif8nYxcnJICJhIvFv5ir2LkYtDSOAoo8TTpVNYQRJCAt8Y JXb8VYFIANkzf19kgnAuMkosbv0P5VxmlFi6dx1YC5uAp8Tkd90sILaIgJDE0o+XweYyC+xl lHi1bh5YQljAUeL4/buMIDaLgKrE9/aHYDavgJPE7WeTWSGOkpdYveEAM4jNKaAj8eHxTBaI m7QlTh5oYYGoF5Q4OfMJmM0soCnRuv03O4QtL9G8dTYzRL2WxP0lX5gnMArPQtIyC0nLLCQt CxiZVzGKFqcWF+emGxnrpRZlJhcX5+fp5aWWbGIExsfBLb91dzCufu14iFGAg1GJh/dd+q0Y IdbEsuLK3EOMEhzMSiK8UYo3YoR4UxIrq1KL8uOLSnNSiw8xSnOwKInzRq/eEyMkkJ5Ykpqd mlqQWgSTZeLglGpgZHhxTevnsU8tXVfmLls92WPh72fGHpNLr9nfS9bKEzselyyvsIX3uJV5 jsWhlkuxF//ltPufYhJ2PXz0zFOXzv4yHaPy7hQN1nXXYza2iG4ydGGc4dd8ddJuA+MD27hf vT6x7pvC/x5ek/QfD391Bp04/rr6msfsxCytnYyM896vfsxU6fv8lhJLcUaioRZzUXEiAFzD G8+LAgAA Subject: [dpdk-dev] [PATCH 0/6] 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" Message-ID: <20190514092040.-fMk6KFi-NpP6WK9rwxQ8HIUEEyJmVCxzxtu9HSKgeg@z> Make DPDK pseudo-random number generation multi-thread safe, go faster and produce better-quality pseudo-random numbers. Thanks to Stephen Hemminger, Keith Wiles and Neil Horman for valuable feedback. 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 (6): 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 eal: add pseudo-random number generation to MAINTAINERS MAINTAINERS | 6 + app/test/Makefile | 1 + app/test/test_rand_perf.c | 92 ++++++++++ lib/librte_eal/common/include/rte_random.h | 47 ++++-- lib/librte_eal/common/meson.build | 1 + lib/librte_eal/common/rte_random.c | 188 +++++++++++++++++++++ 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/rte_eal_version.map | 9 + 11 files changed, 328 insertions(+), 22 deletions(-) create mode 100644 app/test/test_rand_perf.c create mode 100644 lib/librte_eal/common/rte_random.c -- 2.17.1