From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 1191C4C92 for ; Wed, 12 Sep 2018 12:53:37 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2018 03:53:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,364,1531810800"; d="scan'208";a="69394496" Received: from dhunt5-mobl2.ger.corp.intel.com (HELO [10.237.221.37]) ([10.237.221.37]) by fmsmga007.fm.intel.com with ESMTP; 12 Sep 2018 03:53:36 -0700 To: Stephen Hemminger Cc: dev@dpdk.org, john.mcnamara@intel.com References: <20180830105422.1198-1-david.hunt@intel.com> <20180830105422.1198-2-david.hunt@intel.com> <20180830095535.1548db4f@xeon-e3> From: "Hunt, David" Message-ID: <8e371068-4f6c-7d74-7995-4f4daab55357@intel.com> Date: Wed, 12 Sep 2018 11:53:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180830095535.1548db4f@xeon-e3> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v1 1/7] examples/power: add checks around hypervisor 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: , X-List-Received-Date: Wed, 12 Sep 2018 10:53:38 -0000 Hi Stephen, On 30/8/2018 5:59 PM, Stephen Hemminger wrote: > On Thu, 30 Aug 2018 11:54:16 +0100 > David Hunt wrote: > > Minor nits > >> +static unsigned int global_hypervisor_available; > Please use bool for boolean values. Will change in next revision. >> /* >> * Represents a single Virtual Machine >> @@ -198,7 +199,11 @@ get_pcpus_mask(struct channel_info *chan_info, unsigned vcpu) >> { >> struct virtual_machine_info *vm_info = >> (struct virtual_machine_info *)chan_info->priv_info; >> - return rte_atomic64_read(&vm_info->pcpu_mask[vcpu]); >> + >> + if ((global_hypervisor_available) && (vm_info != NULL)) > > parenthesis are unnecessary here. Fixed in next version. > > I know this is pre-existing, but please don't use CamelCase: > > + if (virNodeGetInfo(global_vir_conn_ptr, &info)) { Unfortunately I've no control over this, it's part of the libvirt API. Thanks, Dave.