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 8A2E2A058A; Sun, 12 Apr 2020 15:42:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 25799293C; Sun, 12 Apr 2020 15:42:23 +0200 (CEST) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by dpdk.org (Postfix) with ESMTP id DE5F51B53; Sun, 12 Apr 2020 15:42:21 +0200 (CEST) Received: by mail-pj1-f67.google.com with SMTP id nu11so2807718pjb.1; Sun, 12 Apr 2020 06:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=MBsEgCAdf7vAhxJ7t5BooNki4VC8Hy1qsIdXU8fyV34=; b=esRKXtPDXdJ4wE3ov4u1he07M24OEjQAANDkmrEcb60PvR49uyC+0+JTK/i0GcA6nQ i3oFJZG0YSPK2BCTxUHkb/SxNPAim+5GDX4r5RvRxlkATZhV57XhUYKDi0Ds+PvSnbMv TotE+O1phfBFjxXXvoca5iC3cpfoFBPrjIvQ+uVanyrlYUvH/RFV3oNmVd74ZcGByCug 7H2zbZRkBaZDNJUqe4VNa2vVCJ7DTLlWxb5QCOXwV1nTkX7AIs1IEzoXgU5Uv77ZJMgu 3+KjFfk97KAM56TzOm/f3K+SDROtmqE5k/FDlzbASwPOjR4AYDWztqVPGyaxX3GzDDjS iImA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MBsEgCAdf7vAhxJ7t5BooNki4VC8Hy1qsIdXU8fyV34=; b=nFaWq9OVtW2tJ4C5gYE+41Biu9XqoexBjx38nMQ/C/GJgMOUDTVpt7bp7Nv9C8VUOn UY7KdUw/oNqImVwH+HWZngporyrEllW5pO1wIFiwwtVDIje9AY2kuHR5nNkMh9GQcXPO X/MDP0Nvj5QjsYX03PUxtdrjKed1M6fXiEkrPb8Aqpp9V7IfkxuShWMFdVjO5Yi0d+8U tYQUvNAqm910wrZcFm+9HXpsBZfndxB49eK/8VwEYfbGaKtyCYohjce1j0rawlMHlChM Fm9ylm3oSwGrEJbydm7uaR1yMT3fl298/caeQRPOHgzbi6+ORTtnC6qnbmFFvEUbZdg+ YJ3Q== X-Gm-Message-State: AGi0Pua87KdEc9ztAyWXGUSJu9ztOQW0VTVxzF0dXhD9iEY92uP0d2wV D67JOvgjgF+7SuE8aIXMIAQ= X-Google-Smtp-Source: APiQypJdWVOcbVRHQUP1yxXpET1dV6aLFl+UGdljbpKny1Unfgsi6kc2TdnviZM8S+i409aIKlOVsQ== X-Received: by 2002:a17:90a:bf18:: with SMTP id c24mr16139581pjs.125.1586698941093; Sun, 12 Apr 2020 06:42:21 -0700 (PDT) Received: from local.opencloud.tech.localdomain ([115.171.63.184]) by smtp.gmail.com with ESMTPSA id d203sm925288pfd.79.2020.04.12.06.42.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Apr 2020 06:42:20 -0700 (PDT) From: xiangxia.m.yue@gmail.com To: mattias.ronnblom@ericsson.com Cc: dev@dpdk.org, Tonghao Zhang , stable@dpdk.org Date: Sun, 12 Apr 2020 16:27:53 +0800 Message-Id: <1586680073-11075-1-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [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" 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 --- lib/librte_eal/linux/eal_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/linux/eal_timer.c b/lib/librte_eal/linux/eal_timer.c index a904a8297cd2..4067e46da534 100644 --- a/lib/librte_eal/linux/eal_timer.c +++ b/lib/librte_eal/linux/eal_timer.c @@ -26,7 +26,7 @@ #include "eal_private.h" #include "eal_internal_cfg.h" -enum timer_source eal_timer_source = EAL_TIMER_HPET; +enum timer_source eal_timer_source = EAL_TIMER_TSC; #ifdef RTE_LIBEAL_USE_HPET -- 1.8.3.1