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 737A4A051F; Wed, 10 Jun 2020 17:49:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8E5BB1BEAC; Wed, 10 Jun 2020 17:49:02 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 246BE1BEA5 for ; Wed, 10 Jun 2020 17:49:00 +0200 (CEST) IronPort-SDR: 5PVbWWMCDgPNtwScKDoybS0vwJHn/VAxxIRIlUiKQVR62FfddnoEE0St2uOzguKKlvDrED/ncp k+yuJVDRPgww== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2020 08:49:00 -0700 IronPort-SDR: 8ZgzpnN5WtFCCOLoe9hD3vVkfzTb/UTnhhlBeDqD3i8/RUTyD5fJAUofnYqpGFqU2P0e9nyeZ/ 6z21tZufvHcQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,496,1583222400"; d="scan'208";a="296256721" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.200.247]) ([10.213.200.247]) by fmsmga004.fm.intel.com with ESMTP; 10 Jun 2020 08:48:58 -0700 To: Dmitry Kozlyuk Cc: dev@dpdk.org, Dmitry Malloy , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Bruce Richardson References: <20200525003720.6410-1-dmitry.kozliuk@gmail.com> <20200602230329.17838-1-dmitry.kozliuk@gmail.com> <20200602230329.17838-5-dmitry.kozliuk@gmail.com> <255a3887-b187-e3b2-cf06-a0a67942e788@intel.com> <20200609171733.7e3d9601@sovereign> <20200610173151.27f1a1aa@sovereign> From: "Burakov, Anatoly" Message-ID: <201ca89a-ae94-0bc1-184f-ac8f41b38b57@intel.com> Date: Wed, 10 Jun 2020 16:48:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200610173151.27f1a1aa@sovereign> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v6 04/11] eal/mem: extract common code for memseg list initialization 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 10-Jun-20 3:31 PM, Dmitry Kozlyuk wrote: > On Wed, 10 Jun 2020 11:26:22 +0100 > "Burakov, Anatoly" wrote: > > [snip] >>>>> + addr = eal_get_virtual_area( >>>>> + msl->base_va, &mem_sz, page_sz, 0, reserve_flags); >>>>> + if (addr == NULL) { >>>>> +#ifndef RTE_EXEC_ENV_WINDOWS >>>>> + /* The hint would be misleading on Windows, but this function >>>>> + * is called from many places, including common code, >>>>> + * so don't duplicate the message. >>>>> + */ >>>>> + if (rte_errno == EADDRNOTAVAIL) >>>>> + RTE_LOG(ERR, EAL, "Cannot reserve %llu bytes at [%p] - " >>>>> + "please use '--" OPT_BASE_VIRTADDR "' option\n", >>>>> + (unsigned long long)mem_sz, msl->base_va); >>>>> + else >>>>> + RTE_LOG(ERR, EAL, "Cannot reserve memory\n"); >>>>> +#endif >>>> >>>> You're left without any error messages on Windows. How about: >>>> >>>> const char *err_str = "Cannot reserve memory\n"; >>>> #ifndef RTE_EXEC_ENV_WINDOWS >>>> if (rte_errno == EADDRNOTAVAIL) >>>> err_str = ... >>>> #endif >>>> RTE_LOG(ERR, EAL, err_str); >>>> >>>> or something like that? >>>> >>> >>> How about removing generic error message here completely and printing more >>> specific messages at call sites? In fact, almost all of them already do this. >>> It would be more helpful in tracking down errors. >>> >> >> Agreed, let's do that :) We do pass up the rte_errno, correct? So, we >> should be able to do that. > > Actually, callers don't need rte_errno, because we only have to distinguish > EADDRNOTAVAIL here, and eal_get_virtual_area() already prints precise > diagnostics at WARNING and ERR level. rte_errno is preserved, however. > Not sure i agree, we still need the "--base-virtaddr" hint, and we can only do that from the caller (without #ifdef-ery here), so we do need rte_errno for that. -- Thanks, Anatoly