From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 8EA682C2B for ; Thu, 9 May 2019 03:10:18 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id w22so279442pgi.6 for ; Wed, 08 May 2019 18:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IpUiESqG/pmINZmtHGUVCgmlzN42wcygvuPx1cJrFbw=; b=rDD2P2dH+jN306ceuzcBuwjD7GLZGGYXCqSUBGzDyZCISqi3aTMVBRvaXFaiwnVqcs 8hlwo2FaFps7OTLpm+o/dioHKxoLRlu84Ck8q2If+YNXI34bBffuKqkj1ND3PLZnzxV/ /LlptqNSil2Ta8e8gAlGVRKdh2JGKPbDEXDtQPvlEJrxHQbWRSFY7DZmXuaj8wLImGyS P8u5uAjfLfHEI4qtG+gMAa/mnyrHwJSULzE6nCpVG3b5PLej7lRNuXKBkVgkAdQUd4jL BAwL5lFg4dTP9LXSTLhWxE8ZVjJB8eN07MfVakKLXY+esEOgG9dwEN+itxrkgeg59ILp 2vOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IpUiESqG/pmINZmtHGUVCgmlzN42wcygvuPx1cJrFbw=; b=m4c3Me436++agsOAYcXi99UyxcNHqt9KN2UzMCYvQyq0DHUq5ZfUydtL0hR8Ge6hKg haQq76KYRlxeRgTb6j4DNCY9UaEv/Iakc1HmFso3P0xTHGMIZy8ux3dm8XRBanPuy5tG b8nO4jf6MuK1zxt1+k+SfKd2tr6Md4XvGAHRWRP+fdS+JoiV4SFLp1RNKPHtizo7vTy7 bR6BBMax7n7Y71svqb0rVmiS3lH9Ci6ADYeZ/ZS94qF9ftPs7QuDAw7MFVuirwtA8/p5 Rdz4Nbq4qtuqdVhBOX2ls7H1AOWxuP6UuO1pS8pqwvM6UvmVt5aa5YCajUNkVnzRWafb +9zQ== X-Gm-Message-State: APjAAAXUUtxptyF34hXvlmN4X0m/GQe+55eXMPKoG2k+R0C9VccBvG/L y6TBQ/QrMwkdW/Gs+RAleLWMZQ== X-Google-Smtp-Source: APXvYqz4OcOiPYYwjykWDnoionD8KfdcwkF41Fxgsv0zfkdOe3lMXkeR3og+bs8app0rRHUyhYfxeA== X-Received: by 2002:a62:4595:: with SMTP id n21mr1013984pfi.79.1557364217329; Wed, 08 May 2019 18:10:17 -0700 (PDT) Received: from xps13 ([167.220.63.181]) by smtp.gmail.com with ESMTPSA id 10sm486579pgm.0.2019.05.08.18.10.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2019 18:10:17 -0700 (PDT) Date: Wed, 8 May 2019 18:10:14 -0700 From: Stephen Hemminger To: Mattias =?UTF-8?B?UsO2bm5ibG9t?= Cc: dev@dpdk.org, nhorman@tuxdriver.com, "Richardson, Bruce" Message-ID: <20190508181014.7dde7580@xps13> In-Reply-To: <576fb266-0163-9c4c-261c-2ce3261d7258@ericsson.com> References: <20190424123320.19610-1-mattias.ronnblom@ericsson.com> <20190424123320.19610-2-mattias.ronnblom@ericsson.com> <20190508131239.07e06092@xps13> <576fb266-0163-9c4c-261c-2ce3261d7258@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [RFC v3 1/2] eal: replace libc-based random number generation with LFSR 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: , X-List-Received-Date: Thu, 09 May 2019 01:10:18 -0000 On Wed, 8 May 2019 22:30:00 +0200 Mattias R=C3=B6nnblom wrote: > On 2019-05-08 22:12, Stephen Hemminger wrote: > > On Wed, 24 Apr 2019 14:33:19 +0200 > > Mattias R=C3=B6nnblom wrote: > > =20 > >> diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal= /eal.c > >> index 161399619..d6bf0e89e 100644 > >> --- a/lib/librte_eal/linux/eal/eal.c > >> +++ b/lib/librte_eal/linux/eal/eal.c > >> @@ -1083,8 +1083,6 @@ rte_eal_init(int argc, char **argv) > >> #endif > >> } > >> =20 > >> - rte_srand(rte_rdtsc()); =20 > >=20 > > The current model of seeding with TSC will have problems at scale. > > If a whole rack of machines reboots at the same time because of power c= ycle, > > it would not be surprising if several had the same TSC value. > >=20 > > A better solution would be to use the get_random() system call to get > > seed, the kernel can get entropy from more sources. > > =20 >=20 > Sounds reasonable. >=20 > What version of FreeBSD is DPDK supposed to support? getrandom(2) (and=20 > its cousin getentropy(3)) seem not be available until FreeBSD 12. Linux has had it since 3.17 but you often need a syscall wrapper. Or just read /dev/urandom. 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 13334A0096 for ; Thu, 9 May 2019 03:10:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CC24034F0; Thu, 9 May 2019 03:10:19 +0200 (CEST) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 8EA682C2B for ; Thu, 9 May 2019 03:10:18 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id w22so279442pgi.6 for ; Wed, 08 May 2019 18:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IpUiESqG/pmINZmtHGUVCgmlzN42wcygvuPx1cJrFbw=; b=rDD2P2dH+jN306ceuzcBuwjD7GLZGGYXCqSUBGzDyZCISqi3aTMVBRvaXFaiwnVqcs 8hlwo2FaFps7OTLpm+o/dioHKxoLRlu84Ck8q2If+YNXI34bBffuKqkj1ND3PLZnzxV/ /LlptqNSil2Ta8e8gAlGVRKdh2JGKPbDEXDtQPvlEJrxHQbWRSFY7DZmXuaj8wLImGyS P8u5uAjfLfHEI4qtG+gMAa/mnyrHwJSULzE6nCpVG3b5PLej7lRNuXKBkVgkAdQUd4jL BAwL5lFg4dTP9LXSTLhWxE8ZVjJB8eN07MfVakKLXY+esEOgG9dwEN+itxrkgeg59ILp 2vOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IpUiESqG/pmINZmtHGUVCgmlzN42wcygvuPx1cJrFbw=; b=m4c3Me436++agsOAYcXi99UyxcNHqt9KN2UzMCYvQyq0DHUq5ZfUydtL0hR8Ge6hKg haQq76KYRlxeRgTb6j4DNCY9UaEv/Iakc1HmFso3P0xTHGMIZy8ux3dm8XRBanPuy5tG b8nO4jf6MuK1zxt1+k+SfKd2tr6Md4XvGAHRWRP+fdS+JoiV4SFLp1RNKPHtizo7vTy7 bR6BBMax7n7Y71svqb0rVmiS3lH9Ci6ADYeZ/ZS94qF9ftPs7QuDAw7MFVuirwtA8/p5 Rdz4Nbq4qtuqdVhBOX2ls7H1AOWxuP6UuO1pS8pqwvM6UvmVt5aa5YCajUNkVnzRWafb +9zQ== X-Gm-Message-State: APjAAAXUUtxptyF34hXvlmN4X0m/GQe+55eXMPKoG2k+R0C9VccBvG/L y6TBQ/QrMwkdW/Gs+RAleLWMZQ== X-Google-Smtp-Source: APXvYqz4OcOiPYYwjykWDnoionD8KfdcwkF41Fxgsv0zfkdOe3lMXkeR3og+bs8app0rRHUyhYfxeA== X-Received: by 2002:a62:4595:: with SMTP id n21mr1013984pfi.79.1557364217329; Wed, 08 May 2019 18:10:17 -0700 (PDT) Received: from xps13 ([167.220.63.181]) by smtp.gmail.com with ESMTPSA id 10sm486579pgm.0.2019.05.08.18.10.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2019 18:10:17 -0700 (PDT) Date: Wed, 8 May 2019 18:10:14 -0700 From: Stephen Hemminger To: Mattias =?UTF-8?B?UsO2bm5ibG9t?= Cc: dev@dpdk.org, nhorman@tuxdriver.com, "Richardson, Bruce" Message-ID: <20190508181014.7dde7580@xps13> In-Reply-To: <576fb266-0163-9c4c-261c-2ce3261d7258@ericsson.com> References: <20190424123320.19610-1-mattias.ronnblom@ericsson.com> <20190424123320.19610-2-mattias.ronnblom@ericsson.com> <20190508131239.07e06092@xps13> <576fb266-0163-9c4c-261c-2ce3261d7258@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [RFC v3 1/2] eal: replace libc-based random number generation with LFSR 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: <20190509011014.kHBvyUCaqCFnATv4d_lMLQ2_-rOvfAsX6on9AzSij0I@z> On Wed, 8 May 2019 22:30:00 +0200 Mattias R=C3=B6nnblom wrote: > On 2019-05-08 22:12, Stephen Hemminger wrote: > > On Wed, 24 Apr 2019 14:33:19 +0200 > > Mattias R=C3=B6nnblom wrote: > > =20 > >> diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal= /eal.c > >> index 161399619..d6bf0e89e 100644 > >> --- a/lib/librte_eal/linux/eal/eal.c > >> +++ b/lib/librte_eal/linux/eal/eal.c > >> @@ -1083,8 +1083,6 @@ rte_eal_init(int argc, char **argv) > >> #endif > >> } > >> =20 > >> - rte_srand(rte_rdtsc()); =20 > >=20 > > The current model of seeding with TSC will have problems at scale. > > If a whole rack of machines reboots at the same time because of power c= ycle, > > it would not be surprising if several had the same TSC value. > >=20 > > A better solution would be to use the get_random() system call to get > > seed, the kernel can get entropy from more sources. > > =20 >=20 > Sounds reasonable. >=20 > What version of FreeBSD is DPDK supposed to support? getrandom(2) (and=20 > its cousin getentropy(3)) seem not be available until FreeBSD 12. Linux has had it since 3.17 but you often need a syscall wrapper. Or just read /dev/urandom.