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 1714DA057B for ; Tue, 14 Apr 2020 15:35:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E94601C119; Tue, 14 Apr 2020 15:35:52 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 3741A1C119 for ; Tue, 14 Apr 2020 15:35:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586871351; 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=NFZHtMfVltvc+GWklVwbl2Xpeo2TzGPHYHDjYf2M18SJGs7q307G0QRaASbSHNmGWSRlKQ 813do3IMe4SdWwWigXDeXLis6KbksXEMW9+eh7JbLEFr5bFxMqk0tm1WAPGVZh4jpRHp3p yhJzXu8zSTvMIgeo14R4YX9luAsQTtE= Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-372-mrV2xF4fPTComsYajPkylw-1; Tue, 14 Apr 2020 09:35:50 -0400 X-MC-Unique: mrV2xF4fPTComsYajPkylw-1 Received: by mail-vs1-f71.google.com with SMTP id i11so2089996vsp.4 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=GQfhAgnDnP5cX3vDU4pnc/Rr65rqxeCBmyrPNDjgSrY+0ZeczG5YTgiUKxvhO7LDTe rrQ/WK9CL7sLXNLnKwZWdnvm7lDAsaEJaYvKQrr8ALiq5iC/Xu6Fi5GsyONXhcMVyZqz 2SmoFctSI2mOfM4I1CBnlBwfW4N0cPQqJx5IbvMazwVtLVv7JhIVkS7lYrGf2xF28m6H 8tZoc8kgX3Mn8aWtsxUEwkCCexcuFvD9U/DbxCDSbLNXZX4iAIXyA3h8GwT1WfXNE2NP xNNhl2H4kQk53bYO4ttCwMNG2GDFD6PDeWGOBKslXrKZjNcmr7C+2k+zsxpSP98VDvZ5 OUCQ== X-Gm-Message-State: AGi0PuZG/+UnASzRyKnb0FHE4qVQm/yT99VJa6X7NjCGthgVzOdYSm3e HdYrJ9StW72FGkt1oQrQ7lO/geoCM+C8FH8eVebZdM26JOhovfjYVlFcm+ZIMcLSkqdVRnrseNw 48bknLYXV+h+yR5Ws5wCvQ+E= X-Received: by 2002:a9f:2204:: with SMTP id 4mr186607uad.87.1586871349687; 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-stable] [dpdk-dev] [PATCH dpdk-dev] rte_random: fix crash when random init X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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