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 F0B09A04F5; Fri, 19 Jun 2020 00:44:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B06C5DE3; Fri, 19 Jun 2020 00:44:27 +0200 (CEST) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by dpdk.org (Postfix) with ESMTP id 73CDE255 for ; Fri, 19 Jun 2020 00:44:26 +0200 (CEST) Received: by mail-lf1-f68.google.com with SMTP id i8so4449849lfo.4 for ; Thu, 18 Jun 2020 15:44:26 -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=xu607sqswcSof7m+PSAErbfmxVfs9QyGOjVovbQ2tuQ=; b=gEaebHavl7UMaKq8jG2TlMr18uDL2M+vvj2orY0MRfswv9K25KL1dDtq5HhHkPZNDv TmYsAT0a52jVlU1DRo/2TvA9Umq5yis1m3bFNJxOQM3LTZ8sOeLchJOYKrM/Go2v+OYQ Cf2jyFz8ECd6KmtKK795udl5Rofc+mEu4xv9uCmXmoUDo7PYz/39scC1e3zwD+RQTLf/ c34c0ZihD19cQ7ULGRlcviES2D4e6ad8TMcoCR82UXsnoz47pSw/Z6B/X1XEm3cwhh4I YPpm/9cBlEBnQgiKTmjQ7XfGILivkk+R21RnDS0Xc7JPIFpwt0/sNp7+QZZGpxBqZ1VI PeaA== 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=xu607sqswcSof7m+PSAErbfmxVfs9QyGOjVovbQ2tuQ=; b=OB8M4CTkVUaVOb5ROMuGjtyhGMr/0PLXVN5qI/SAaZurjOUSyvjgkL5xk8G07wxWQG Zw4C6bkhjadXv3G8bs0OA1iygUCQQjQNQMIv9I33hiOJGq+3ZAtPdtp6G7ooHk2xfsva JAMmo3u0jYjxFgG1nVRhX+quPNY7A7+i4DmQL5veHPxbFnt7DV1nSpAkbJTrI6tu/UPf JaXZWZIpso3xdLUGTBeSlOhEkVzkwtPhhnidramgQymTx/zRPtDkCRMKMIBVIsF/n2eB RjcsGagsvV7xMNlFidZgwMAg/v4ie/afkWx1BjRvljOog7HhqoTPUEfyl7k4Rl9NEunj Rm5w== X-Gm-Message-State: AOAM530t/G3Jn0uXVYRBfahzNsxggwv44ZyGWENCI6wTawY4w5/6H0MA QUM09xMl9vDnoouH8qkYhP8Vt0t8/Z/kxg== X-Google-Smtp-Source: ABdhPJwJxXJSGQ4wNdkkGW/1TMlTmtcXRpFcoe5gSUGOIeSV2BuVr2kldY00n041Se4sP7R/ibAzvA== X-Received: by 2002:ac2:5295:: with SMTP id q21mr255411lfm.185.1592520266001; Thu, 18 Jun 2020 15:44:26 -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 v25sm1182641lfg.81.2020.06.18.15.44.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2020 15:44:25 -0700 (PDT) Date: Fri, 19 Jun 2020 01:44:24 +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, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, anatoly.burakov@intel.com, fady@mellanox.com, bruce.richardson@intel.com Message-ID: <20200619014424.625b8e64@sovereign> In-Reply-To: <20200618211546.24496-3-talshn@mellanox.com> References: <20200609103139.22168-2-talshn@mellanox.com> <20200618211546.24496-1-talshn@mellanox.com> <20200618211546.24496-3-talshn@mellanox.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 2/9] pci: use OS generic memory mapping functions 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" [snip] > @@ -154,14 +154,15 @@ pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size, > void *mapaddr; > > /* Map the PCI memory resource of device */ > - mapaddr = mmap(requested_addr, size, PROT_READ | PROT_WRITE, > - MAP_SHARED | additional_flags, fd, offset); > - if (mapaddr == MAP_FAILED) { > + mapaddr = rte_mem_map(requested_addr, size, > + RTE_PROT_READ | RTE_PROT_WRITE, > + RTE_MAP_SHARED | additional_flags, fd, offset); > + if (mapaddr == NULL) { > RTE_LOG(ERR, EAL, > - "%s(): cannot mmap(%d, %p, 0x%zx, 0x%llx): %s (%p)\n", > + "%s(): cannot map resource(%d, %p, 0x%zx, 0x%llx): %s (%p)\n", > __func__, fd, requested_addr, size, > (unsigned long long)offset, > - strerror(errno), mapaddr); > + strerror(rte_errno), mapaddr); rte_errno should use rte_strerror(). > } else > RTE_LOG(DEBUG, EAL, " PCI memory mapped at %p\n", mapaddr); > > @@ -176,7 +177,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)); errno should be rte_errno, strerror() should be rte_strerror(). Also the message mentions munmap(). -- Dmitry Kozlyuk