From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 0971037A4 for ; Thu, 14 Jul 2016 17:34:20 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id f65so70607263wmi.0 for ; Thu, 14 Jul 2016 08:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernelim-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9K2puDKjSwaSICCnXeMTNQv77NMoygaV6pTTq625NEs=; b=Rokhugk3eLu0odVPkaD1xL6PmFbmvMKDJ+2BI3iE5sU50eCUb0QfISazlKzPxifpYH ZV9rDfNz3mcwmomEFLtbCmk8AnZksDuVgJmUpi6mURd+d2Q9lwX4/inrECEuq7q4yJFS HCOxNGbCu9CrfZq8JlCzNudp6AXtpJQlm3Tje7Edq7DAVX4HHiP11aqD6YYBfg+Esjsk 6XK2Vye1C6u32SVlpnUz5gfH2YqB+UKXf2JI0QGIRoCo3OSK/ToABKzTOEMyUJXlR5jY tqho7IWZvu+9lIBT4KZXHF5x0Cf3I1w6bm01gaEjh9r/zuK5ILOV80ZtnNVx+mrSEeyX 6uuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9K2puDKjSwaSICCnXeMTNQv77NMoygaV6pTTq625NEs=; b=S90hRfL3WqWmOo3y/lVt9tt5vSgLm/Jwc99M3aw9r8OJ0uzAhbUU8mBO44KMKW8JOw Lzt0kH1Vy2Li46T4cTm/4yBmctFT9MBReH1i87GFVDTyBhu0BWhD88MRunOh9jcF5A5h LTpuVBEHX6Z6btHbj7J9jhNUukbnK8yPMd+c5n8rvxCxtT14hTuXIlwTayBafisw8pdA sZK0F0b0ZR/w52iG1nG5TD4Y5djrpnNymykMT7CEPsMFE6LbKX/pSwBXcKcU4E+EwRUA tuufCMwtoPY+K9QOsw0mad//eFJWaz5M43q7SDHKMz1r2/4MCctuYHKQdDRrk9kvmBwa mCtQ== X-Gm-Message-State: ALyK8tLM4ZitI77MRWXH0UeuAIfLsalfuKJANFUvW5vcA8YmDhSe4VwYNcyt2pnCASqRbA== X-Received: by 10.28.109.214 with SMTP id b83mr6634541wmi.19.1468510459757; Thu, 14 Jul 2016 08:34:19 -0700 (PDT) Received: from gmail.com ([5.102.233.21]) by smtp.gmail.com with ESMTPSA id q203sm4411228wmd.24.2016.07.14.08.34.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 08:34:18 -0700 (PDT) Date: Thu, 14 Jul 2016 18:34:15 +0300 From: Dan Aloni To: "Burakov, Anatoly" , r@gmail.com Cc: Thomas Monjalon , "dev@dpdk.org" , Yong Wang , Ronghua Zhang Message-ID: <20160714153415.GA8329@gmail.com> References: <1467930397-39777-1-git-send-email-yongwang@vmware.com> <3677701.6a7nRcOOV2@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) 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 15:34:20 -0000 On Thu, Jul 14, 2016 at 02:50:51PM +0000, Burakov, Anatoly wrote: > > 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 > > Hi Thomas, > > The patch makes sense to me, but I don't have any devices that trigger that particular codepath in my immediate vicinity. The original patch was mentioning an NVMe adapter, so that probably should be tested with this change. I'm CC'ing the original author of that patch just in case. Do we know of any other NICs/devices that might be affected by this? Aside from the obvious example of vmxnet3... The patch makes sense. To explain further, the reg.offset is resource-relative and not bar-relative like table_start and table_end. The mmap() needs to be resource-relative. I think it would be cleaner to use 'reg.offset' to substruct, conveying the fact that bar_addr already accounts for it. - void *second_addr = RTE_PTR_ADD(bar_addr, memreg[1].offset); + void *second_addr = RTE_PTR_ADD(bar_addr, + memreg[1].offset - reg.offset); The work I've done with the Intel NVMe adapter was cut short due to other tasks I've had to shift to. But it was left in a state where it almost worked under VFIO, in a sense that the NVME card entered a fault state and I had not invested enough time to figure out why. If it's due to this bug, then I would be able to finally close this one. But that's a bit hopeful, though. Happy to find actual users of the changes. -- Dan Aloni