From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 59E6042B16; Mon, 15 May 2023 17:52:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CA9740687; Mon, 15 May 2023 17:52:58 +0200 (CEST) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id C213640395 for ; Mon, 15 May 2023 17:52:56 +0200 (CEST) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1aaff9c93a5so87997505ad.2 for ; Mon, 15 May 2023 08:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1684165976; x=1686757976; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=fvtARYypbDBgeYGcW9m4pXn2GihM33+UqAgyHsVdnSc=; b=TbiUT1VOuuiqzBwR0n/SyF/JoyC3Sf+MKghINEgNWXAmAAmSgJf19OiRj08lakobGd MOt1GvJa74qAxNTKFeylSrtMfFoBLdNkmr2uUfG4CZq3bqQiZ2vy3rEDagmAdb8ifXxd 2WxLsIEKBQSSA7Hw74ceQ7GKXOl0bA5oSMzlh2sjoXwor3UQM7ihP1Ucgv5rOQLo4R6g JwbvB5H6cdUBIk86TPPYhdfv7Jp35a7zo3YkHhbgmXi4CETnBkD3L47J1bRwbQzXJ4nu 82fbUYIFRJkOHu8zVf8bf/33pFMLBa2xC+R9TIghpxyQaJvAcIzJ2Py5J/X7fdSOebD4 1MXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684165976; x=1686757976; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fvtARYypbDBgeYGcW9m4pXn2GihM33+UqAgyHsVdnSc=; b=cCUn9csXXPIKxb1D5yUpyLq/zI4iHMmeHuOYhNqSCo61ni6/V40GQedTbvxyMsKZ+Z Edar1MyiVyX5CjnmtMUgZaaZ6BOZ0pop3opHqmzuH8z8pysULqDb4KQd7KxygPFMpAkO cp9NgW5tbT7QbtE1z/akVM32El1UTM7DdAJx+OVmCZ+vepi4iyFuKCZ1UQ04YJYrCHsW V3HWy14rS4svxxfOODNjS3DJ48ccfxZ56bjP5klPWXQlEfvMg/bgllL5QuvIXCEeuEi1 yE5acXInakzsYWhm1pp6EZ7/itnUvCoqZSBNdu/Ek4hjUWzaXRAhUIGu2yV8+ErnUmJ1 fdYA== X-Gm-Message-State: AC+VfDwJ69yt8oKZT7LXS7j2g4dsF9rMkN78JlKUMvUUfI2gL8mZIuN8 lSJGaTm6SJC550BV0SsUKis34w== X-Google-Smtp-Source: ACHHUZ70VefIHSWeNKrAoXIkJLptctP/XkoXZ8pwpnhdktFsQYbnc78D6wpzCkTkgfsIVDqUy29LBg== X-Received: by 2002:a17:902:6b03:b0:1a6:a1ec:53a3 with SMTP id o3-20020a1709026b0300b001a6a1ec53a3mr33626031plk.3.1684165975999; Mon, 15 May 2023 08:52:55 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id j2-20020a170902da8200b00186a2274382sm13680992plx.76.2023.05.15.08.52.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 08:52:52 -0700 (PDT) Date: Mon, 15 May 2023 08:52:49 -0700 From: Stephen Hemminger To: Miao Li Cc: dev@dpdk.org, skori@marvell.com, thomas@monjalon.net, david.marchand@redhat.com, ferruh.yigit@amd.com, chenbo.xia@intel.com, yahui.cao@intel.com, Anatoly Burakov Subject: Re: [PATCH v1 4/4] bus/pci: add VFIO sparse mmap support Message-ID: <20230515085249.283dd7d0@hermes.local> In-Reply-To: <20230515064700.624054-5-miao.li@intel.com> References: <20230418053012.10667-1-chenbo.xia@intel.com> <20230515064700.624054-1-miao.li@intel.com> <20230515064700.624054-5-miao.li@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, 15 May 2023 06:47:00 +0000 Miao Li wrote: > + map_addr = pci_map_resource(addr, vfio_dev_fd, > + bar->offset + sparse->offset, sparse->size, > + RTE_MAP_FORCE_ADDRESS); > + if (map_addr == NULL) { > + munmap(bar_addr, bar->size); > + RTE_LOG(ERR, EAL, "Failed to map pci BAR%d\n", > + bar_index); If mmap() fails then printing errno would help diagnose why.