From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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=5iznbNNOAjJ9aNcJiXZpnGP4Eue/VoFR4a/Gh1WdbB0=; b=uNuaflfJCPORzboVbE253PciogeWAE7QHgM22T/l4VZoFWqwK7ufKSWCO7KvzRH6sH JRCzHVSlzhlWRRqCKdSws6gLrzyuN94ITygmCuhp3GyowI6oK8u4XoXfYfder5mkyr2W CcXzyYFb2CM3KuwE3L5wyOi/Za1FitSKbpWtP6Y400ZdLOfbTdICsOD6epP9lOdGs5kS pPTMx4/vlTtML/qIJ5Hy3QgzC4jSzGLTdsvJke0q8QzoBFLGhC+a4ZAhM1P4+pLTwsdB TzHNz+VWS9hf0jmqkXJYCT+K6DYnJBXnsd51GfBMee5bCBuOFqRMojmY0pFeXiAadxPH 4Mcw== 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=5iznbNNOAjJ9aNcJiXZpnGP4Eue/VoFR4a/Gh1WdbB0=; b=L3NHPl6uJlz9WrL6/9FlCnFrSXB5Epf61Z/FNayKNghBxgMbGS2EMJIf0dXn9ApKfy PzhHy/6DFc7fnVgTMzEf32pUaQK+iKvOUlhuNI8TQdw6Q9DAdEpw6E9+/O0L/wpL8Kyq q3DPIdlabAV2DJgihAjeLiXwC/I0SPYRtm0AiWKHRyW29KqfYQfzcqGppJo5NxFy60H+ ymbdlE9/dW+6Awu6t2TzkrzFrLSHcVvhKgkrJNdU9gOSiAcbZo5y3r35lK8TRqgRtJNp k5oeWn8lEnAm1wkOy3EEX7z1c/3EZWlcE2BxVH4sVvXzWbqcUdnKgTM0QoxvsuQVhNwP 4dAw== X-Gm-Message-State: AEkoousMeFh/Pwa9uC2bLygI/OhOzwHwV0SF8KQaMPAk1/+V7juHWIS4tiUUe9RQiPuCh4iJ X-Received: by 10.28.194.195 with SMTP id s186mr38394678wmf.48.1469688884331; Wed, 27 Jul 2016 23:54:44 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id c10sm9912052wjk.22.2016.07.27.23.54.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jul 2016 23:54:43 -0700 (PDT) From: Thomas Monjalon To: Alex Williamson Cc: dev@dpdk.org, anatoly.burakov@intel.com Date: Thu, 28 Jul 2016 08:54:42 +0200 Message-ID: <2860054.FZ01Xh8IR9@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20160727161457.7992c756@t450s.home> References: <20160727161457.7992c756@t450s.home> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [bug] dpdk-vfio: Invalid region/index assumption 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, 28 Jul 2016 06:54:44 -0000 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 :)