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 78870A0577; Tue, 14 Apr 2020 06:44:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0A9951C07D; Tue, 14 Apr 2020 06:44:28 +0200 (CEST) Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) by dpdk.org (Postfix) with ESMTP id 78E351BF7B; Tue, 14 Apr 2020 06:44:26 +0200 (CEST) Received: by mail-qv1-f68.google.com with SMTP id 37so3192044qvc.8; Mon, 13 Apr 2020 21:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=HNphklydO2cpTNouBAoK8oGesAgvDx2JZvsGXFTYT84=; b=nWe+BVRFz0d+ijYmOvVtXh4j7YD8bJsuijMHR0K537BzH+LX2eVtK06y2IH8cQqVno dIxL2uSrvgvILtQZw6C5hybO6Pn0F3iIsXvZ9ObLUErUYlouKyZyf4xCRUHQ2lA5isUi cC/2mw8FshFeVUPOSIWjSmTnd7Cm9ILmE3Hl3xAPlhbVqFwprZGT3b5g/JP//cFjOz0y sFharxHX3Pl1bCMbmwnlWir5i/oW9f0wtB6hQvEylk02qUi41Qrmssmio6UIGD8H2fRW VUKdWhbtTwMPh16JZ3juFu4sOs2yLBym5ymZ9MD/0Yi2+UEVAfkr2uj75m1/0rXVonno +KlA== 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:content-transfer-encoding; bh=HNphklydO2cpTNouBAoK8oGesAgvDx2JZvsGXFTYT84=; b=XYWyFNLH3x30MtOr4lhMQcbdKjIELG+ncH4uNjR3ryYfw8Kv+WdEEMT7pusdJaU45I /ymS/+b17wTxp1QtLGyJQ2T/ctbBusfDSyAUAOiZ3cuSCC0Qym9Rp/KOqHnXyBBHqE/+ ZV1RMJgFsa9yWR+UM16c9K3jITZY7d0cAuw4MdF4SQuNleAvzP2uh1VOvQvHvZaNE1pC UvorYljujT+jyOZCu1BhzvJI458RKoZQS1Tn6NH8JB7dHAOTE2BvT0FV0EimEs7dmq5f kYlyikZV1yMpLURYGz95pwLJwEjnU+BQtok8G6SmYQeNB22ErhPQcPYkC3MNBXd3tCKX xOCA== X-Gm-Message-State: AGi0PuYFM2ZkOgwSNFAxMW/4oGLILZ6D+Z1OVWOJ+3gpU2KuG7cCOgo0 0ZzzuvCuwsjf3at8MqETL7cIURpdZWhOu+tZeek= X-Google-Smtp-Source: APiQypItuqTP+S6ojJ4hs7ECfakqfcf18mL8zhlXlXvAjbf0iyvEg2BZRD9q/yEDwRinryQWRzBgh5oA6Df23LjxJhE= X-Received: by 2002:ad4:49c6:: with SMTP id j6mr20723157qvy.68.1586839465733; Mon, 13 Apr 2020 21:44:25 -0700 (PDT) MIME-Version: 1.0 References: <1586680073-11075-1-git-send-email-xiangxia.m.yue@gmail.com> <20200413210658.2308b86e@hermes.lan> In-Reply-To: <20200413210658.2308b86e@hermes.lan> From: Tonghao Zhang Date: Tue, 14 Apr 2020 12:43:47 +0800 Message-ID: To: Stephen Hemminger Cc: mattias.ronnblom@ericsson.com, dpdk-dev , stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH dpdk-dev] rte_random: fix crash when random init 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 14, 2020 at 12:07 PM Stephen Hemminger wrote: > > On Sun, 12 Apr 2020 16:27:53 +0800 > xiangxia.m.yue@gmail.com wrote: > > > From: Tonghao Zhang > > > > When rte_rand_init is invoked, and the kernel > > (kernel version < 3.17) running dpdk does't support > > *getentropy, at the same time, the cpu does't support > > rdseed, the rte_rand_init will invoke rte_get_timer_cycles > > which function will invoke rte_get_hpet_cycles > > (RTE_LIBEAL_USE_HPET was enabled) while *eal_hpet is not > > allocated. > > > > Fixes: faf8fd252785 ("eal: improve entropy for initial PRNG seed") > > Fixes: 3f002f069612 ("eal: replace libc-based random generation with LF= SR") > > > > Cc: stable@dpdk.org > > > > Signed-off-by: Tonghao Zhang > > Are you sure this patch won't change current default to use HPET (which i= s slower)? In rte_eal_timer_init (linux/eal_timer.c)=EF=BC=8C it will set eal_timer_source =3D EAL_TIMER_TSC too. So after rte_eal_init, eal_timer_source =3D=3D EAL_TIMER_TSC which is the default timer source actually. Then this patch will affect RTE_INIT function which invoke rte_get_timer_cycles. but hpet is not available yet. > Before this patch users would get TSC as default. --=20 Best regards, Tonghao