From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [bug] dpdk-vfio: Invalid region/index assumption Date: Thu, 28 Jul 2016 08:54:42 +0200 Message-ID: <2860054.FZ01Xh8IR9@xps13> References: <20160727161457.7992c756@t450s.home> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, anatoly.burakov@intel.com To: Alex Williamson Return-path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 8A5FDCE7 for ; Thu, 28 Jul 2016 08:54:44 +0200 (CEST) Received: by mail-wm0-f45.google.com with SMTP id f65so239135900wmi.0 for ; Wed, 27 Jul 2016 23:54:44 -0700 (PDT) In-Reply-To: <20160727161457.7992c756@t450s.home> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, 2016-07-27 16:14, Alex Williamson: > I took a quick look at the dpdk vfio code and spotted an invalid > assumption that should probably be corrected ASAP. It can theoretically be a bug but the value may never change in the kernel, right? So when you say ASAP, I feel it can wait the next DPDK release (we plan to release today). Do you agree? > That is: > > lib/librte_eal/linuxapp/eal/eal_vfio.h: > #define VFIO_GET_REGION_ADDR(x) ((uint64_t) x << 40ULL) > #define VFIO_GET_REGION_IDX(x) (x >> 40) > > Region offset to index is an implementation detail of the kernel, the > vfio API defines that the offset of a given region (BAR) is found via > the offset field of struct vfio_region_info returned via the > VFIO_DEVICE_GET_REGION_INFO ioctl. You're free to cache the offset > into any sort of local variable you like, but the kernel may change the > implementation of region index to offset at any point in time. This is > explicitly not part of the ABI. Is there a place to file a bug, or is > this sufficient? Thanks, Thanks for the report. This email is sufficient :)