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 5CB4DA00BE; Wed, 29 Apr 2020 01:52:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 385A11D65F; Wed, 29 Apr 2020 01:52:20 +0200 (CEST) Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by dpdk.org (Postfix) with ESMTP id 9402B1D65E for ; Wed, 29 Apr 2020 01:52:19 +0200 (CEST) Received: by mail-lf1-f66.google.com with SMTP id u10so124679lfo.8 for ; Tue, 28 Apr 2020 16:52:19 -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=wF792gV9SyQuefCUoDb1WE3yMbxBdz9N/nD78HXLSYY=; b=ODuJbjOlViS5xZZR1SsYrvs7HTKayYHp9Vi00HCkqMNkDTINbPvTemAncWacBbRJvz uYAZRmC9+Hyqu8nlE9JmmOhwD/JqXmwkZ37UDyfaurCuGnH3Y+qcGOuwKWCk9Fscm5JX ahMerWgd4FK9VOHH+IL+Mr1H4Rjz+z8uHNzwSROqc4OdVN7u59CIPNCaAOpo1BMmdQJ8 PBi5moyyt+Oin37yOrfeffS3+Qsox+IUE1fBFgr1riLQaakRxatlZfslty9TSRki4DBR LpPq9BnkJCKiETcgpq93lg3WVr2QLKTtSCTlVkBi9D3iMmp18ImqEEzRNj/WwqiDBtyt JNmg== 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=wF792gV9SyQuefCUoDb1WE3yMbxBdz9N/nD78HXLSYY=; b=bChE4B5jiuLCfuMxQm1wbBUFFSDA+HJKCz2nGv6Kbq4sQolI+HyCg/5pG9SZ1mFS2a 5Embmn4ejDMk25by+/hNlynABf0zj+gw08WZT9+PSFpTvxNaZ+/nYnyKQhp2FcvJV1X1 ZGxtAMAURxc+kV9RirgqJtgBNBdpfqZk8FfHcxjMbQX96rqmMZSamywIQrIbPMWDZOta mkmniFo6g587yrle9cnVV1GhDa7Vk6/2Ur3wAo9GEamHNnChBRDDw0BUKx9jQe3WBYdz anOx055/tYcW1rl8mgsaOytnQ6ETc8VH5jeHJ/9gV2P1Flimo8neyG4p+mSveEAXm8+2 yEWA== X-Gm-Message-State: AGi0PuY/CxdSAEtXUU7kBmQQhA9vV9UTWbndraNPm9HKx9lXlKKeKe96 B5DqbqznJLh2442ysoUC9Tw= X-Google-Smtp-Source: APiQypK5l2Nvog8yuq7dwYgLB7r3qNm5OtUzYRMkuT+degB79G/tFsRNvVIRbHwHRKILARRaPre29Q== X-Received: by 2002:a05:6512:1109:: with SMTP id l9mr21208377lfg.12.1588117939233; Tue, 28 Apr 2020 16:52:19 -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 x17sm830151lfg.36.2020.04.28.16.52.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 16:52:18 -0700 (PDT) Date: Wed, 29 Apr 2020 02:52:17 +0300 From: Dmitry Kozlyuk To: talshn@mellanox.com Cc: dev@dpdk.org, thomas@monjalon.net, pallavi.kadam@intel.com, david.marchand@redhat.com, grive@u256.net, ranjit.menon@intel.com, navasile@linux.microsoft.com Message-ID: <20200429025217.4bd2e06e@Sovereign> In-Reply-To: <20200428091111.13416-3-talshn@mellanox.com> References: <20200428091111.13416-1-talshn@mellanox.com> <20200428091111.13416-3-talshn@mellanox.com> X-Mailer: Claws Mail 3.17.5 (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 v2 2/7] pci: build on Windows 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" This patch misses two things: 1. Documentation on pci_map_resource() mentions MAP_FAILED, while rte_mem_map() returns NULL on failure. 2. Code in drivers/bus/pci/linux passes MAP_FIXED to pci_map_resource(), which should be changed to corresponding RTE_MAP_FORCE_ADDRESS flag (it is renamed in v4 of MM patch series). On 2020-04-28 12:11 GMT+0300 talshn@mellanox.com wrote: [snip] > + if (mapaddr == NULL) { > RTE_LOG(ERR, EAL, > "%s(): cannot mmap(%d, %p, 0x%zx, 0x%llx): %s (%p)\n", > __func__, fd, requested_addr, size, > @@ -160,7 +160,7 @@ pci_unmap_resource(void *requested_addr, size_t size) > return; > > /* Unmap the PCI memory resource of device */ > - if (munmap(requested_addr, size)) { > + if (rte_mem_unmap(requested_addr, size)) { > RTE_LOG(ERR, EAL, "%s(): cannot munmap(%p, %#zx): %s\n", > __func__, requested_addr, size, > strerror(errno)); Logging can be removed here if ERR level is not a requirement: rte_mem_map() and rte_mem_unmap() already log OS errors on debug level. -- Dmitry Kozlyuk