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 CA60AA0567; Tue, 10 Mar 2020 13:55:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C63971BF7F; Tue, 10 Mar 2020 13:55:20 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id DB8B023D for ; Tue, 10 Mar 2020 13:55:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583844919; 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=XcLKQol3KXAQb7qaX18oa8JZTJcK860xwdMMjVeX1FU=; b=EkqYQ26pYytgNJf2UAsH5erBMd80geQgmdD22M4GAjmGvD/lXHlpYyawwBS6CZq3VdTbW6 7rMavCazgD/rMq4YTSkeJtoC+9jm1iS3DgeZdtCdqgtXrgeBMf+Jt4MHFZ8lXq5XYWd+1I cZUgK2ChwXH3eUXjz5u5NmpBhVa1zDg= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-377-NSVGtxA6NtGsGTlVqGEj1g-1; Tue, 10 Mar 2020 08:55:15 -0400 X-MC-Unique: NSVGtxA6NtGsGTlVqGEj1g-1 Received: by mail-io1-f72.google.com with SMTP id c7so736296iog.13 for ; Tue, 10 Mar 2020 05:55:15 -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; bh=qtjnOxS54Y3M8uD4sPrsRsOSWPAcQDC7ofnBWEOjuL4=; b=OSGDT6etRehGQQwpCrsQlYUo2oPtmrUGIZHvcni703ipsc67lOU4tJvpPtt1wos2dr WnYWLK2S3k2Z72kVBKDAUR2P4hb5ay1rRRwRwcw5cgtfL/4FBBtLl8PrDd/Rtv0+x7n3 qwz70WXwthdHkHlXUABwFnsKUwJy20L9NFhXHD019aQ91jD9qcBol34c8thJGcXHIMcU zYbnmlTNKnh+ccyjp4EKey3SwpX1P1c7I+FRMqC3r3/XpHFnEce48DkiflyOXAv+Mlwj K6px6ftBqS/V7qGJH/MJkX0E/geKxO9WWpmSigctbxWIl4xRkYN5Z0SZaMkHMcYt+dCB jySQ== X-Gm-Message-State: ANhLgQ0DSVro67lG6vLq1sR1t9h2+FtyqJZqUMpeKk557RedixMoQy0e Wexw8Zuq89vJK1Qs56Fv7w7oNaVb4DNVP7qpb7NydNjCnjSj+62HhXV62/FNQHMRt6JEiNY3HiD 3oVqyhf71KjLESK3Pf9E= X-Received: by 2002:a5d:9dcb:: with SMTP id 11mr17731596ioo.177.1583844914614; Tue, 10 Mar 2020 05:55:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsgawBLNnu0+SPRhrN1P3JvWlN8Sd1fWWMMZzPz5l2/dpcTtZp7RTbU06Jbgub4TQ2SE9uckK/SMpwNSG1zldw= X-Received: by 2002:a5d:9dcb:: with SMTP id 11mr17731584ioo.177.1583844914285; Tue, 10 Mar 2020 05:55:14 -0700 (PDT) MIME-Version: 1.0 References: <20200128210233.691-1-thinhtr@linux.vnet.ibm.com> <20200131220336.103874-1-thinhtr@linux.vnet.ibm.com> In-Reply-To: <20200131220336.103874-1-thinhtr@linux.vnet.ibm.com> From: David Marchand Date: Tue, 10 Mar 2020 13:55:03 +0100 Message-ID: To: Thinh Tran Cc: dev , David Christensen 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 v2] eal/ppc64: improve rte_rdtsc with ppc_get_timebase 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 Fri, Jan 31, 2020 at 11:04 PM Thinh Tran wr= ote: > > __ppc_get_timebase() is GNU extension and is more efficient > > v2: Advoid breaking other ppc_64 flatforms. The __ppc_get_timebase() > seems to be specific to powerpc platform and with GLIBC. dpdk only supports glibc at the moment. https://doc.dpdk.org/guides/linux_gsg/sys_reqs.html#system-software Now the 1M$ question is which C library are you using and on which platform= :-). > > Signed-off-by: Thinh Tran > --- > lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h b/lib= /librte_eal/common/include/arch/ppc_64/rte_cycles.h > index 8f2e98642..1c3fd556e 100644 > --- a/lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h > +++ b/lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h > @@ -14,6 +14,9 @@ extern "C" { > > #include > #include > +#if defined(__powerpc__) && defined(__GLIBC__) > +#include > +#endif libc headers must come first: https://doc.dpdk.org/guides/contributing/coding_style.html#header-includes Why do you need the __powerpc__ guard? > > /** > * Read the time base register. > @@ -24,6 +27,9 @@ extern "C" { > static inline uint64_t > rte_rdtsc(void) > { > +#if defined(__powerpc__) && defined(__GLIBC__) > + return __ppc_get_timebase(); > +#else > union { > uint64_t tsc_64; > RTE_STD_C11 > @@ -50,6 +56,7 @@ rte_rdtsc(void) > [tmp] "=3Dr"(tmp) > ); > return tsc.tsc_64; > +#endif /* __powerpc__ && __GLIBC__ */ > } > > static inline uint64_t > -- > 2.17.1 > --=20 David Marchand