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 18AFCA0555 for ; Thu, 9 Jun 2022 13:38:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F4EB40220; Thu, 9 Jun 2022 13:38:56 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id BFE3540220 for ; Thu, 9 Jun 2022 13:38:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654774733; 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=rTUu1tlk4/Og1jzdmUqd97CllaU3Afeh4gbVTw/jE+c=; b=KBKyej26g6AFsWcizOEYaHX14MZmNMRTTp/YjPv+OiAkySqnqCLSPp4HKuTyD+GRlIJ+MC aLyDY7rC9MHZidtoAcT5iPt9URIKHxQLfPHWIbuiih+Av6/FlGnnJX4zEw3dOgsupOSnY6 0xRvS/wCzpk4q1Mth+628buSX2pRXc0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-446-IUzM0tmCMuKEOtp94Od3PQ-1; Thu, 09 Jun 2022 07:38:50 -0400 X-MC-Unique: IUzM0tmCMuKEOtp94Od3PQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 171333C025CE; Thu, 9 Jun 2022 11:38:50 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.195.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id 375FC18EA3; Thu, 9 Jun 2022 11:38:49 +0000 (UTC) From: Kevin Traynor To: Duncan Bellamy Cc: David Christensen , dpdk stable Subject: patch 'eal/ppc: fix compilation for musl' has been queued to stable release 21.11.2 Date: Thu, 9 Jun 2022 12:37:01 +0100 Message-Id: <20220609113701.386938-74-ktraynor@redhat.com> In-Reply-To: <20220609113701.386938-1-ktraynor@redhat.com> References: <20220609113701.386938-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 21.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/13/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/52c9e902beb02d3d458a13eaa484c23b4487eae7 Thanks. Kevin --- >From 52c9e902beb02d3d458a13eaa484c23b4487eae7 Mon Sep 17 00:00:00 2001 From: Duncan Bellamy Date: Sat, 14 May 2022 08:14:35 +0100 Subject: [PATCH] eal/ppc: fix compilation for musl [ upstream commit 0615dd2aa139312a93ae312233a80e164c8f1048 ] musl lacks __ppc_get_timebase() but has __builtin_ppc_get_timebase() Signed-off-by: Duncan Bellamy Reviewed-by: David Christensen --- lib/eal/ppc/include/rte_cycles.h | 7 ++++++ lib/eal/ppc/rte_cycles.c | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/lib/eal/ppc/include/rte_cycles.h b/lib/eal/ppc/include/rte_cycles.h index 5585f9273c..666fc9b0bf 100644 --- a/lib/eal/ppc/include/rte_cycles.h +++ b/lib/eal/ppc/include/rte_cycles.h @@ -11,5 +11,8 @@ extern "C" { #endif +#include +#ifdef __GLIBC__ #include +#endif #include "generic/rte_cycles.h" @@ -27,5 +30,9 @@ static inline uint64_t rte_rdtsc(void) { +#ifdef __GLIBC__ return __ppc_get_timebase(); +#else + return __builtin_ppc_get_timebase(); +#endif } diff --git a/lib/eal/ppc/rte_cycles.c b/lib/eal/ppc/rte_cycles.c index 3180adb0ff..cd4bdff8b8 100644 --- a/lib/eal/ppc/rte_cycles.c +++ b/lib/eal/ppc/rte_cycles.c @@ -3,5 +3,11 @@ */ +#include +#ifdef __GLIBC__ #include +#elif RTE_EXEC_ENV_LINUX +#include +#include +#endif #include "eal_private.h" @@ -10,4 +16,37 @@ uint64_t get_tsc_freq_arch(void) { +#ifdef __GLIBC__ return __ppc_get_timebase_freq(); +#elif RTE_EXEC_ENV_LINUX + static unsigned long base; + char buf[512]; + ssize_t nr; + FILE *f; + + if (base != 0) + goto out; + + f = fopen("/proc/cpuinfo", "rb"); + if (f == NULL) + goto out; + + while (fgets(buf, sizeof(buf), f) != NULL) { + char *ret = strstr(buf, "timebase"); + + if (ret == NULL) + continue; + ret += sizeof("timebase") - 1; + ret = strchr(ret, ':'); + if (ret == NULL) + continue; + base = strtoul(ret + 1, NULL, 10); + break; + } + fclose(f); +out: + return (uint64_t) base; +#else + return 0; +#endif + } -- 2.34.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-09 12:34:31.438797115 +0100 +++ 0074-eal-ppc-fix-compilation-for-musl.patch 2022-06-09 12:34:29.814980758 +0100 @@ -1 +1 @@ -From 0615dd2aa139312a93ae312233a80e164c8f1048 Mon Sep 17 00:00:00 2001 +From 52c9e902beb02d3d458a13eaa484c23b4487eae7 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,2 @@ + +[ upstream commit 0615dd2aa139312a93ae312233a80e164c8f1048 ]