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 81858A0513; Tue, 9 Jun 2020 16:17:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 643CB1BE9E; Tue, 9 Jun 2020 16:17:36 +0200 (CEST) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by dpdk.org (Postfix) with ESMTP id 5E0011F28 for ; Tue, 9 Jun 2020 16:17:35 +0200 (CEST) Received: by mail-lf1-f65.google.com with SMTP id u16so12593154lfl.8 for ; Tue, 09 Jun 2020 07:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mPOKVnqTRGhuf5zutJLWcvvSo6nc/ErlKZH1Ru4kxJI=; b=HKo+MacPBThjCa2TpBv1xD1WOeVm+J6k75FN3ifJQyr20pTebtyGxY9gT5VKnnCUwQ abzeLtWPZHLr1Hqkg8rLARswUewEbX3x17kgcLG0YI1CHjpYo295JVjx87gFa0q4K2yr TDd1PYN7kwvB25orlbnxAgga9Yp4QztmFz5znnJxVEAfd9sxnOlMqFKuxel23v5mEp5A WFnhKKQPjfOphfaJPq2/RdV8jJ0JrIwlZHWWnr1AWlvY9kycpy3N4Ya2aLa19rUZnk2u 8ds8f0zp16wuD6Rp2w8cUlgSmFuudlNlmO5U36m91aErKVCA/Y0NJUAv/HGL0PnPzfnS flew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mPOKVnqTRGhuf5zutJLWcvvSo6nc/ErlKZH1Ru4kxJI=; b=r/6kC7XQEb2sLXgnJzvG/9oBwXJdSPiEaRDUnAuabqFKjvX9zZOiTHoSI1PQHBBxGP tW55ESxKM9Q/2BDxBhtaYJHUL8jyTOx232hHgsQm/6qrykd6CkhqFAunlr18zEvVSsm2 V8tKyJ4uR9DnUQYf/uCtE2ExhOqinDP6SbOrdq2uQD0uAVw1IrUkxCpqtSrmx9KQ5fYb O8xNevw3XZhPeHcbK8g289mKQufNR8fJOojHE3qPjsv/Xb75sl4xftMkWScsejr3EJxF lJW4/EZ3kx1mgM+D5DegOXc6rC/HFfe/3I7xFYAtiz8iKOB/Kj1Hx5q2WywPkLGYJEtT liKg== X-Gm-Message-State: AOAM5328dmfO0jnDuYCmEZnXvAlNXuzS2//xREjhn4uXGGmxqkRGuAET 0EZl4njONF4sPD6iidqE7m8= X-Google-Smtp-Source: ABdhPJwP9qELpJeTLYUwo3ZUEsMztDX/qYceaYQw8N92DSy1AvQB0Eqp2bn3LKV5OyAJGla7Z0UBRA== X-Received: by 2002:a05:6512:d1:: with SMTP id c17mr15410435lfp.80.1591712254879; Tue, 09 Jun 2020 07:17:34 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id 13sm4343422ljj.83.2020.06.09.07.17.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 07:17:34 -0700 (PDT) Date: Tue, 9 Jun 2020 17:17:33 +0300 From: Dmitry Kozlyuk To: "Burakov, Anatoly" Cc: dev@dpdk.org, Dmitry Malloy , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Bruce Richardson Message-ID: <20200609171733.7e3d9601@sovereign> In-Reply-To: <255a3887-b187-e3b2-cf06-a0a67942e788@intel.com> 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> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 Tue, 9 Jun 2020 14:36:10 +0100 "Burakov, Anatoly" wrote: > On 03-Jun-20 12:03 AM, Dmitry Kozlyuk wrote: > > All supported OS create memory segment lists (MSL) and reserve VA space > > for them in a nearly identical way. Move common code into EAL private > > functions to reduce duplication. > > > > Signed-off-by: Dmitry Kozlyuk > > --- > > > > > +int > > +eal_memseg_list_alloc(struct rte_memseg_list *msl, int reserve_flags) > > +{ > > + size_t page_sz, mem_sz; > > + void *addr; > > + > > + page_sz = msl->page_sz; > > + mem_sz = page_sz * msl->memseg_arr.len; > > + > > + 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. -- Dmitry Kozlyuk