From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 1BCF13978 for ; Thu, 14 Jul 2016 15:25:40 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id o80so113197523wme.1 for ; Thu, 14 Jul 2016 06:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=mMCdxlXs35ZJSbmBqt+dzZprsz2on1EE3smPczndtBw=; b=hND3BD1+plIe9eUz3xxt4EzFx1ORVSom2oaWv5uMHKQEcadgEuUib0ze40Z1RjFI0O CuVsg8KtFdVZfwiKXwKKD2PBtXVCHox1Ju9pkfA4kEKHyqcFFlkAok/yGGjbXGrFKxfW 2isqiscnjSvZqfQlJ4QuLp9Cq2lXrc2bZxwkMp/OENWBbAFONd03KYt9Wu+hhpcuw3LP 2VaWOoWVM8X8Hbr8gGLR9Y/xWrsC0VpRnKTVDGXYMVHx9EO66/WnvlcRrBtOycnQUAkN 4n+WyxOgsILxxCtZKwHIP8x+rpQ3iPz0Ar2mInpRSsVoFp7F/KFkA2eRrM48Mme4hiiQ 3big== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=mMCdxlXs35ZJSbmBqt+dzZprsz2on1EE3smPczndtBw=; b=MFFwzWWr/roniu0kso0gCX2Xfk3LGNUrNZh81Qvm9A/er2vUcMEI9FkaVPp9BeQQ0W OefJIE7IuANFJ2/ff2c6HpgjbRquFlCXVz64G2OxMWOCfrteyfRF+0MK8yuJe1XeUO7Y sETlGNzViNOJISoByAkRnyDsu1JGw8YfNLR7QTFLzf5H1dADZ12NYr+rX5z7RYO23bRO WQs8SkLzFJ8//EqpH/XjnBqhZxhCcX1VexuA0EVFxgb6Wj/GEloRuvg/rpZcMZoXD9Qv dkPoVhW8lfC9UljygJiNATqeBnjmY1pvXG7aa5QtfsrAXETdtZ3Ht4P6jEvSkgq/aX1I fZQA== X-Gm-Message-State: ALyK8tLgGHuoEYsqJfibi40TlFSBktdT9UxPN0OTaD9w0SKgKygTZ0oSUHXxRjI7RefPxMQP X-Received: by 10.28.187.67 with SMTP id l64mr15328112wmf.11.1468502739887; Thu, 14 Jul 2016 06:25:39 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id f193sm3581897wme.11.2016.07.14.06.25.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 06:25:38 -0700 (PDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Yong Wang , anatoly.burakov@intel.com, Ronghua Zhang Date: Thu, 14 Jul 2016 15:25:37 +0200 Message-ID: <3677701.6a7nRcOOV2@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1467930397-39777-1-git-send-email-yongwang@vmware.com> References: <1467930397-39777-1-git-send-email-yongwang@vmware.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 1/2] vfio: fix pci_vfio_map_resource X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2016 13:25:40 -0000 Someone to review this patch please? It can be integrated in RC3 if we are sure it doesn't break anything. 2016-07-07 15:26, Yong Wang: > The offset of the 2nd mmap when mapping the region after msix_bar > needs to take region address into consideration. This is exposed > when using vfio-pci to manage vmxnet3 pmd. > > Fixes: 90a1633b2347 ("eal/linux: allow to map BARs with MSI-X tables") > > Signed-off-by: Yong Wang > Signed-off-by: Ronghua Zhang > --- > lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > index f91b924..3729c35 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > @@ -896,7 +896,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev) > } else { > memreg[0].offset = reg.offset; > memreg[0].size = table_start; > - memreg[1].offset = table_end; > + memreg[1].offset = reg.offset + table_end; > memreg[1].size = reg.size - table_end; > > RTE_LOG(DEBUG, EAL, > @@ -939,7 +939,8 @@ pci_vfio_map_resource(struct rte_pci_device *dev) > /* if there's a second part, try to map it */ > if (map_addr != MAP_FAILED > && memreg[1].offset && memreg[1].size) { > - void *second_addr = RTE_PTR_ADD(bar_addr, memreg[1].offset); > + void *second_addr = RTE_PTR_ADD(bar_addr, > + memreg[1].offset - memreg[0].offset); > map_addr = pci_map_resource(second_addr, > vfio_dev_fd, memreg[1].offset, > memreg[1].size, >