From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0082.outbound.protection.outlook.com [104.47.41.82]) by dpdk.org (Postfix) with ESMTP id 45C602BD3 for ; Thu, 28 Jul 2016 10:06:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3pbWS63hLT0OSpS4zFglD0i9PYHUwg1BZHiMNLjsQfw=; b=fTPuryYRwovg0XaV+Qa2oQk2thX6GlMuhl/ify9+KendVbbOLOg0wCfs1fmu0+r3BJwvjma/pmg5XDkET2NzKpC0XWt0DTKOtV1MXXOqZAafHGZW1pv8BH6l6DhVPMYM7t6D0l0ndxkfuJDxhV9253ir4CgM40P2NccI+cAicH8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from santosh-Latitude-E5530-non-vPro (14.140.2.178) by BY1PR0701MB1722.namprd07.prod.outlook.com (10.162.111.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Thu, 28 Jul 2016 08:06:44 +0000 Date: Thu, 28 Jul 2016 13:36:24 +0530 From: Santosh Shukla To: Alex Williamson CC: "anatoly.burakov@intel.com" , "dev@dpdk.org" Message-ID: <20160728080609.GA5736@santosh-Latitude-E5530-non-vPro> References: <20160727161457.7992c756@t450s.home> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160727161457.7992c756@t450s.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0064.INDPRD01.PROD.OUTLOOK.COM (10.164.136.164) To BY1PR0701MB1722.namprd07.prod.outlook.com (10.162.111.141) X-MS-Office365-Filtering-Correlation-Id: f4f74344-b3e9-473b-2089-08d3b6be1e9f X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 2:TxwNrvkFW5ajrAsBa1wSuV0TgmlLXuEqrGG1xDTeYw0QtaQ+DgRSN/y+b9JFWjxwHq16B6kjXZae5RMQbfeuB4f5acWmhXi2NnhMvoQ5ket3+wEiKQoxxGyQ9Mi3R9+TavfRsR3WyML+izX11ZomaKJ99vs/A9NgSP2RfZ91vVR9XwygIa0eIGKaKVtcXjEW; 3:X/GnYad8MfOKkQDsDksCmSL48R+vXQu+6jBOGu8yO8ZSbIX5MohnVilVjXVnWnEDIJI0daSxD0KroWnbAivbnvQAM7KHWKE2o4ScZVmHD9eHpHinw5ZnTDqSvA0kKzN4; 25:nz5fvUF9nswlyFP+N5MAnELj5MySzLKSFoi7Kj4iXvO4lVTrdUW0IhbcqcxDIU0TwflAfpm/RkQZmw9F+37nopo4Xp3MWtNamXibHTJ9VtiMs0c8cDusOmU75UMvEohKmdnHbJAyuLJqnGQkWs3TSphmksuaG124PmP1HAhQfA6mYFPlFmmjks03Jpw+8pn4B9C7mkXivLTuCYAz69ARTlzE4Jh/hCm7qMSd0U/WbDymcWSLTSqM7/FbxznlqJgjWH6Pm9v2IN3aDf7F4UM0lXYXuQaXg9Eu/cPQQfB07ip3ifB0OEmO7W7lNyL+XJ+rt1Nb9H0N7VotGsKq0Wlv/zcCOKg7fUHdoAiXLV1Cwz4Z16LD4EDc0vsH+37VWY7UzWwARMMxM8s0jQb2aMHkwMLobeD9Tt0TcLiVoiR19Eg= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1722; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 31:HpCA9KSE+MzQ6ICTfnlAabFxeFtRveA/Ki5NCFR3fJECY7poAVAFedaJKi11Jy/ndcjptWYexeLpZBxr5167z5TprfdHtnn9SSixc0Duv44VRC125mP9THsa+Cuene98Wxy6lhk69yAVAV3GVtgVm7sWA7I8yKGGKoJtiE9LHpgCbgF++n4ta4DtWWLJ20gfuwxJ2V1/ZV07fuDGWMo1Hg==; 20:yMm8WqWd1SMoFl+b0dre3rFG7v+rrFrOD1V7KhBixF7JB7ViTZTNUv7K5T+oMmVNPLQqXo2xyOdeNoNb4G+zb4E4lKJW8Tu3Qy49K+VEwJs2McOeMogwE0Ugm9jJGiZlP0RBbMJ7Y8aFIIQDFV9h6coKfxnLDQLHbJbRq5xsdta3xGdfN9PemJfI8A0qQ8H6vYhnzLPA29WqDN09ba9uCQ+8VpvduZQvLXMxDN642p9lcMLrHXqdpuhhJ5hhYPEU6bH750AGZHfo0UeH5Nhrm6iTI313uSq0UOfBy4lHh6BVudruLgpnm1dclEDzgiy06m0sPviaCnaUfUtt6JBs5PTQ2PMc0fBcn1uXGhTVuXplL2AeBfDXZ6fLxVIgl0QXDtdce1i8vdFvJS69OY49h88/wozNUXwaq3G/CbcxFtqMFPsZfK3R0WICGYr9CCvSLMiZrHDK0hX527lJzBo1IRGMW1VKxpQaiRD9t6140mS8KHT4O6nugYR+UM5dLYTTBrvzBGDrjJlXjS6l7Oh8UyFofn/ASQc7wQ+Z1mdtuniC0o+7udkEBP3yN3/mvXDoISD8z/gmp0p+9XKLYCPuVKh36dVt1rhZlQRld61xec0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:BY1PR0701MB1722; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1722; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 4:5Ol/q4YOXVOHXeOkSZhIUFyBIDKFgCqOfqTxHP1NR7v8jvQg9nnFvcjC2EPXfYJnBqxGbF+rXVt8eoGrA55SyXcFtwu7GT3MW629GthRfpxEywQTRI/Jg6a+sSBJpgXjxtNmBemxuSDGQaMDFwnAkoZmpHwnh+/i2xL+EkiKivzfSZirQDJfrPP/5Oz8o8annxy0SPShU1SnPfg8DSxVbe9Dc0ciIMcxkP60sayDApwFE+zkLYwxjA5JOvmW9NPhwyUsrLXPPYsoDkUMsGYl0drCfGy6W4tXbsDALHyaDyWVdIKv0GYBAM75zy6BzMec5tP/FE+ioRl4rbl1/9Buvod71yPDjIJ5TTulXCmzAzcJRv3eGwpAv0h7XYPTXdwF X-Forefront-PRVS: 00179089FD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(24454002)(199003)(1076002)(66066001)(8676002)(47776003)(5009440100003)(23726003)(42186005)(101416001)(2906002)(50466002)(105586002)(97736004)(7846002)(4001350100001)(7736002)(106356001)(305945005)(189998001)(110136002)(33656002)(586003)(33716001)(46406003)(3846002)(2950100001)(77096005)(83506001)(6116002)(92566002)(97756001)(4326007)(68736007)(76176999)(50986999)(81156014)(81166006)(54356999)(9686002)(7099028)(110426003)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1722; H:santosh-Latitude-E5530-non-vPro; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1722; 23:vyJ8TRKqKanmy2A+XubojMJ5AFs+VcQNIMHM0NK?= =?us-ascii?Q?7R+JdXdBbN0Tc2Zu15bRxVrm9/zy8CO5TM6SxFdtxKlaKVstjAv/mH960uqo?= =?us-ascii?Q?FYZKl0wWVWbV+RW8LJ1k+DLbUb6u6rL1ExSKYTdykBt59jP+vu/UA02MEvJs?= =?us-ascii?Q?W3miY3s+9Sj3ndCOK13xachsWKnVVl8JKfObyHvdTJLwVHKUaRuK7L/aoJwx?= =?us-ascii?Q?DSbrp4OaE/9rWyrKrFxhiVwxIlrVaGPb4BlfNrzg36OW3Kbbq4k+HC69RfRk?= =?us-ascii?Q?Fx8ike3uhz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ascii?Q?icJ2wcTre/NND2HQ=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 6:SvKy4nJAPohNLd3rBg7/IjwyN7bpnslUnTT5Ht7lK67Odg0s6pGpUDig56GyX9SmeDBhQHruvEqdF97K7zmSamRnbjspsJyFWl98wm/GL8rViFVWz9k2QhPC1EGC4ZR1QGmMI6CxFCyI1EWblG3yidjqJUavA6TirwKVq8MLFWV4QQ+x8ggKQIX5c0elN2ca/oyEzu8zdFOZa/ndi5fR49AkeKtvKirEkc92XzGlz7Z1kUeirt03VqWBDkeYoT2c37lcR2Wk13AaaqvFpDHk0YkPLFx8VdZqtVODFsg6eaM=; 5:nZyDl91SjKmQ4luHH8PSDzJGR9oxDI3IQdOg67KwhLGeyEu/14BL94RALjrDtrae0uAKnSiej4jNPsdJFWiNfy+EJbPXu3VqEgFlycUwaEeU9MAkZeIpfUH4yaH2BEbWT9GCa/65d4vVrX/DAegzSw==; 24:C4z9dNUAG1Hwc2cvu0JSCSVDbyeoKkWVbIQskHF6goOrC6p51o6R3HCn+aKpk/phplQHHOGMxGNtdJQNPsbHc05XNsL/4wvBYHL71rLdZi4=; 7:uNDc+BCvroyGmVHUKVqcJgCJ3qWTpTo6guT6PeucouaArA8tgRmF644fkNzDjq6/EkGjszql4mctrMpvLTCzXNrdBxKatHbENCH7s0D9jqjkTSTTv8IKRwm4KfLKunTPXVdowya6ygAkk5PxHwTwUq7AlTRXzPHXe+skY6ad3xii1hIrTUV0S1CY7h74ALImMjgZpimWFVirTNCAqg1x+XnC1voTf1ZZBifxAyfNyEadYl1rPTfrP2ByRa9Ze48Z SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2016 08:06:44.6044 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1722 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 08:06:49 -0000 On Thu, Jul 28, 2016 at 03:44:57AM +0530, Alex Williamson wrote: > Hi, > > I took a quick look at the dpdk vfio code and spotted an invalid > assumption that should probably be corrected ASAP. 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) Yes. I agree. We need some way to carry essential vfio region info in pci_dev, needed for pread/pwrite. currently, rte_intr_handle only has vfio_dev_fd but thats not sufficient information. I stumbled while adding ioport support in vfio and took a short path to define region_idx thatway. To get-rid of this, Possible approach could be; - add essential vfio region specific info (ie.. offset, idx, flag) in rte_intr_handle. - or pull dev_fd to rte_pci_device{}; and define region specific details. Thanks. > 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, > > Alex