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 5F661A057B; Tue, 14 Apr 2020 15:35:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 171911C297; Tue, 14 Apr 2020 15:35:55 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 6328E1C257 for ; Tue, 14 Apr 2020 15:35:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586871353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QUMEwLHKh5Dd6cIS3mzOFvwit4Z5bePJ7zeWQSrJgls=; b=izyaZfF1ZPURXpO28eljC+IYtfjdBnIV3Wes4BVuJCI/BEG9nST9nxHzEtfymdxQgJUiU6 4CTSE8P5+DS5miZg5Rbrgqa4si2j+z5oeZh1g9TbKsrpc9eWRdruvw1mSyCU8zn/UzRB3X 21Z7MRBkm9ON2cM5xoqqyU7nG8hrBPs= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-QSxe70dbP-WACgpPnV5BCw-1; Tue, 14 Apr 2020 09:35:50 -0400 X-MC-Unique: QSxe70dbP-WACgpPnV5BCw-1 Received: by mail-ua1-f72.google.com with SMTP id v20so5628577ual.21 for ; Tue, 14 Apr 2020 06:35:50 -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:content-transfer-encoding; bh=QUMEwLHKh5Dd6cIS3mzOFvwit4Z5bePJ7zeWQSrJgls=; b=eCcYSdovDxFRBphc3V0a7D8yBnW8mhP/GuXxjQdV1hTQw8yw6qpu7dSsBKlPcMYeJ/ lvrrYz6/gjJMt1koTNGiqHGCwLieK2XLqkhXTL4WXCIlaRc05YjVR4Vj76SuJNeHYtus +X+HPl1dtfbtQl7v0LosMLPSvnCYgWd15yprdHhOCfktKBgZsHfktRs5JXRe4/v2oJCI lkorjDqwZuEyW3QatYDDhbSJsvueQpEAvLIHpKGYQmk425d8my5zD056AuJTkhB6Uoj2 q6DRIh4D0qo/LJ5svjCfUZa7lv6VaP5LFQBPTeQbOCfNMminIwvBO+y3RM776vCriEBN 165w== X-Gm-Message-State: AGi0PubLfJVdXsTKDIXReD8k7Gv+L48nlB6agl70b0kt3cs6xj2ylx0Y AXT8+qAHqHs06m4GARkBLwU+A5WpCoanDMmW3q1qpX7zVe1zqelwBMK7lW8OanV/5IxWoWABLkF 6xgMzVPatfCtc0x7Djj4= X-Received: by 2002:a9f:2204:: with SMTP id 4mr186604uad.87.1586871349685; Tue, 14 Apr 2020 06:35:49 -0700 (PDT) X-Google-Smtp-Source: APiQypLZwtaiONuvxEeXFQnyzDDiajNd5kX8zIDtAOTVm+d17Z7o/ACYxjRrhNZmy6Q3pXHU4k1MP/Cy3t3SD2WEOAs= X-Received: by 2002:a9f:2204:: with SMTP id 4mr186583uad.87.1586871349376; Tue, 14 Apr 2020 06:35:49 -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: From: David Marchand Date: Tue, 14 Apr 2020 15:35:37 +0200 Message-ID: To: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= Cc: Tonghao Zhang , Stephen Hemminger , dpdk-dev , "stable@dpdk.org" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 3:20 PM Mattias R=C3=B6nnblom wrote: > > On 2020-04-14 06:43, Tonghao Zhang wrote: > > 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 = LFSR") > >>> > >>> Cc: stable@dpdk.org > >>> > >>> Signed-off-by: Tonghao Zhang > >> Are you sure this patch won't change current default to use HPET (whic= h is 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 t= he > > default timer source actually. > > Then this patch will affect RTE_INIT function which invoke > > rte_get_timer_cycles. but hpet is not available yet. > > > Would using rte_rdtsc() directly be an option? s/rte_rdtsc/rte_get_tsc_cycles/ This could work, but I am a bit surprised to see an initialisation in a constructor. The commitlog that moved rte_srand() from rte_eal_init does not explain why it was moved. --=20 David Marchand