From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 29AD6A0556; Thu, 26 May 2022 17:25:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D7CFB40151; Thu, 26 May 2022 17:25:18 +0200 (CEST) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by mails.dpdk.org (Postfix) with ESMTP id 4EE2D40150 for ; Thu, 26 May 2022 17:25:18 +0200 (CEST) Received: by mail-pg1-f173.google.com with SMTP id j21so1560631pga.13 for ; Thu, 26 May 2022 08:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W+9j58J670OHkFO2/0jdPLKq017kCElKlt0iBamF1tw=; b=S1mAOYZQf4PwfqqBMLPQsZ9ltkDka2gvFEs5CdtcaoYsKk/xkSbi0mRfeXjjgGqyjf VFRH1Cn7Qa/2t84fIe0gUmlqvdxsn692HkDWcZtg5BN7b/dQPuY86HwLEiH95t+cbRK1 voz/p88JLnKc13AexIU3wGG+ccwdjLN9fjOR/EOHjCK6EypvjhpcMgUjjYupmoGR0IK8 eR1RpfjZ9040PnXTunj9YLbjL23+QzMXWkHgPLzuuetshYDItJxsStxkVuj0+f4jiKs+ V8lUTyHRzrwp0sgz/nIOZxNj9xmbiI/ooe87rLhwKBmGLFSSW3n04pUqrOkylHtSCX2f w2wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W+9j58J670OHkFO2/0jdPLKq017kCElKlt0iBamF1tw=; b=ZLhyLkpyiWpwa/48yEqrfee4FUdZQY0l4bABGZqiFo1KSOcEBCSc0ZlUVm1mGUlAbK 95tdwhzyEeNmZz7gHp+Ew5mfR0Zn9h2BKpcBgjqRL5gbzWeO2GBGELgriAfHIb1e0Mob fRCEVayMIPxqSVnokDFiOy89i52UoIpliwJi5ERwOZXL2PHng3j9LutYgu201CN5Jmq/ 9uO1ebuq6HyG7QDkdkw7MtD/9o1Tmivsp2N/tkiOK6SU8R8hwG5N6FyYqcWaDBqXHD5O bTXbzDfpJkmGyVf6trwUWvZhcM5xG+FQK/c8BkVucBIPkse2meWKLN5hK16ax3HrQzh1 4W1w== X-Gm-Message-State: AOAM533X1QjZqBoTFJTKA+Qn3IFFZ+BvdyMiyN3x12yCD5PrOVRPvdHt hYZabH0peDbgjtU68ZrK7wjg9QV9aQJRTw== X-Google-Smtp-Source: ABdhPJwmMO4KXsARexSNyd9aUjRMcMZFV4BzCh8GQ0TDRu5mRFK11d/mcmQnVJif82U4wqiWu8p1mw== X-Received: by 2002:a63:1a63:0:b0:3f6:4513:44af with SMTP id a35-20020a631a63000000b003f6451344afmr31595757pgm.370.1653578717451; Thu, 26 May 2022 08:25:17 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id w20-20020a170902a71400b0016232dbd01fsm1677864plq.292.2022.05.26.08.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 08:25:17 -0700 (PDT) Date: Thu, 26 May 2022 08:25:14 -0700 From: Stephen Hemminger To: Mattias =?UTF-8?B?UsO2bm5ibG9t?= Cc: dev@dpdk.org, Mattias =?UTF-8?B?UsO2bm5ibG9t?= , Ray Kinsella Subject: Re: [PATCH v4 1/3] random: add rte_drand() function Message-ID: <20220526082514.3a9ab8ee@hermes.local> In-Reply-To: <84afee2e-fa4c-faf1-d046-febb0ae77c09@lysator.liu.se> References: <20220524184623.480646-1-stephen@networkplumber.org> <20220525203123.277180-1-stephen@networkplumber.org> <20220525203123.277180-2-stephen@networkplumber.org> <84afee2e-fa4c-faf1-d046-febb0ae77c09@lysator.liu.se> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 26 May 2022 15:20:29 +0200 Mattias R=C3=B6nnblom wrote: > > @@ -55,6 +58,9 @@ test_rand_perf_type(enum rand_type rand_type) > > case rand_type_64: > > sum +=3D rte_rand(); > > break; > > + case rand_type_float: > > + sum +=3D 1000. * rte_drand(); =20 >=20 > Including this floating point multiplication will lead to an=20 > overestimation of rte_drand() latency. >=20 > You could refactor this function to be a macro, and pass the return type= =20 > to as a parameter to this macro. I did just that, and on both an AMD=20 > 5900X and a Cortex-A72 it didn't add more than ~5%, so I don't think=20 > it's necessary. The test is not doing anything useful with the result. It is just a way to exercise the code. Macros are evil, have little or no typechecking and should be avoided.