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 BB816A04B5; Tue, 12 Jan 2021 17:14:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7664A140E69; Tue, 12 Jan 2021 17:14:12 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id D2491140E67 for ; Tue, 12 Jan 2021 17:14:10 +0100 (CET) IronPort-SDR: V+vqjOcd+BxjERPhMy0uSL48l9m7o8i2q3cDE6wB+UU6XvooVewcsuglL8c44c8kg9wDrgNu7r 5e6S4r9J8fyQ== X-IronPort-AV: E=McAfee;i="6000,8403,9862"; a="175483040" X-IronPort-AV: E=Sophos;i="5.79,341,1602572400"; d="scan'208";a="175483040" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2021 08:14:08 -0800 IronPort-SDR: u2imXGOeDFLxlssSbXyi944mcTKm3W2Wq5x7ArebiFTQ8JB/Lfm7qYsJaCtnV2LdpcduCKHmlL 5EcJPxbEItiQ== X-IronPort-AV: E=Sophos;i="5.79,341,1602572400"; d="scan'208";a="498964513" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.252.30.231]) ([10.252.30.231]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2021 08:14:04 -0800 To: "Ananyev, Konstantin" , "dev@dpdk.org" Cc: Jan Viktorin , Ruifeng Wang , Jerin Jacob , David Christensen , Ray Kinsella , Neil Horman , "Richardson, Bruce" , "thomas@monjalon.net" , "McDaniel, Timothy" , "Hunt, David" , "Macnamara, Chris" References: <18244c0453adf9a216f88e8edc14f1e68b53053b.1610377084.git.anatoly.burakov@intel.com> From: "Burakov, Anatoly" Message-ID: Date: Tue, 12 Jan 2021 16:14:00 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v15 01/11] eal: uninline power intrinsics 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 Sender: "dev" On 12-Jan-21 4:09 PM, Ananyev, Konstantin wrote: > >> diff --git a/lib/librte_eal/x86/rte_power_intrinsics.c b/lib/librte_eal/x86/rte_power_intrinsics.c >> new file mode 100644 >> index 0000000000..34c5fd9c3e >> --- /dev/null >> +++ b/lib/librte_eal/x86/rte_power_intrinsics.c >> @@ -0,0 +1,120 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2020 Intel Corporation >> + */ >> + >> +#include "rte_power_intrinsics.h" >> + >> +static inline uint64_t >> +__get_umwait_val(const volatile void *p, const uint8_t sz) >> +{ >> +switch (sz) { >> +case sizeof(uint8_t): >> +return *(const volatile uint8_t *)p; >> +case sizeof(uint16_t): >> +return *(const volatile uint16_t *)p; >> +case sizeof(uint32_t): >> +return *(const volatile uint32_t *)p; >> +case sizeof(uint64_t): >> +return *(const volatile uint64_t *)p; >> +default: >> +/* this is an intrinsic, so we can't have any error handling */ >> +RTE_ASSERT(0); >> +return 0; > > Nearly forgot - as now this function is not inline anymore, we can probably > get rid of assert and return some error code instead? > Well, this would necessitate a change of API to include return values. Which i think is OK at this point, because it's a fully fledged API (rather than an intrinsic) at this point anyway. >> +} >> +} >> + -- Thanks, Anatoly