From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E22D6A0547; Thu, 28 Oct 2021 15:00:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0BCDB4120A; Thu, 28 Oct 2021 15:00:46 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id A47BB4120A for ; Thu, 28 Oct 2021 15:00:42 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10150"; a="211169732" X-IronPort-AV: E=Sophos;i="5.87,189,1631602800"; d="scan'208";a="211169732" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2021 06:00:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,189,1631602800"; d="scan'208";a="447957947" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP; 28 Oct 2021 06:00:41 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 28 Oct 2021 06:00:40 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 28 Oct 2021 06:00:40 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 28 Oct 2021 06:00:40 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 28 Oct 2021 06:00:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k9gb0Kyn52PAmu+Ei4f4apaPz28mJCfe7vQOeDe1RI3+xITXHDp9eBiFRuHfgjT3cH76owUZfdA2G4AKpk1taPKiZkdyqYADwv/ud89sn0XreXuDcRlyRNlURfez2Swur8cZT1CdwUs0dDJGkjg5OR3JOU2q4hnVSqepze9ZRhDbcO1nkfSVcSE365izErz9hMFKWTW5E20ydFVh3tvvyl+CBiuaqeGR+FDSQnnumjC7mQMEqrmwVTXAa0BU1Zr82AhuQREdtnHGhqAeAEHpK1Gd8itBNw23B3VNbM15v/ok7NdeC8eVfspLFiq7Q9cTpIOykSbNWFhphnmKImj/gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LsFOU70TCkTMGxscj3FC1W+AM/SjBLMFUAth9Vx0Cm8=; b=au0AWEME8KCk6lk3i2Ms6jV6d9GOJ0949iXhS0deHO4HNUNjjMBVwA/yri3bXtPp1qN6bixNoX1uHQ8jwrmg+ndPJjLUZ1qBubs3ElqDu2CE4PJlOQchsOMHdMMvyTwYE8nwtuzLAWnlZvNaQ3N0XMQiSDCRHmt6r4PHDlFwlxaC4x43Pt5CTHn0n0+IvfDCPYNsg9Jv9s5HFMrP3i5GPjYTwq6+yJEDq3tx+2YNGZdXhfL9OCK/z9VajB6qTOntDdv7s7b4r5Kz2M27LGFFYBK3e82hLpLqhabqHvFY5xERBc7yi2yHaunzJdib9McuPns2mOK3chODA3GpdmnOEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LsFOU70TCkTMGxscj3FC1W+AM/SjBLMFUAth9Vx0Cm8=; b=tWK8/Hl1hWM3xV09kMi7qTFl3geZyT1XANLkoohaIjzGRBciol01dtqc+R28vFnuWVsayITT/OM65bROS5IRVqV0m4Ug41yoR2TNcSkbXZUU80JmbHKrz45D7F6dWx6U2j5WtwQWVdFcFykCJN0sYbHsExiWjIGrBTzV8fzJoWU= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) by PH0PR11MB4965.namprd11.prod.outlook.com (2603:10b6:510:34::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Thu, 28 Oct 2021 13:00:35 +0000 Received: from PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::a80e:d881:3c58:9730]) by PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::a80e:d881:3c58:9730%3]) with mapi id 15.20.4649.015; Thu, 28 Oct 2021 13:00:35 +0000 Message-ID: <1f848ee6-0ac7-33db-cb3c-b2876eee6e5c@intel.com> Date: Thu, 28 Oct 2021 14:00:28 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.2.1 Content-Language: en-US To: David Marchand CC: dev , Bruce Richardson , "Ray Kinsella" , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Xuan Ding , "Yigit, Ferruh" References: <043fc2d53770da8248b9cd0214775f9d41f2e0fb.1631273229.git.anatoly.burakov@intel.com> <9972054c-c68f-5b8c-d8cd-2330fce82369@intel.com> From: "Burakov, Anatoly" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DU2P250CA0007.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:231::12) To PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) MIME-Version: 1.0 Received: from [192.168.1.10] (212.17.34.161) by DU2P250CA0007.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:231::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.22 via Frontend Transport; Thu, 28 Oct 2021 13:00:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: faac47c5-27de-4620-f343-08d99a12ee4d X-MS-TrafficTypeDiagnostic: PH0PR11MB4965: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zqqC88NND6e1t56qDbytoJzxNsv/GrfU8dmiAijbStB0xOoA+wOmAA83MhKD9z1yH7Tm1ZbndevYkRWCv7WWuOQyx6rfBgXe6oXVeACzLlsfDUHchpvRLC9Pw5dWlF5uXeft8qiWk4Uj4p/OhEvKgVViek4vLzDqkWUo8tbr+SdQnm+wyWT1aU5+OW1yk92qjIHjqZXPKv9Ujon3uzSbp/a4BjnUlmlRfBTPR/Abhnw9bXrZ/ARGEV110oNvQh+D6drMnWnccsNa2aqELcXDUOjAMCbe0Dx7KkBTNjrsvQRqZFuf9ZD91+oua/leA02qJiaoIKy4YbUMBEy9rRtDFFgbJmEbvNR1KtdqC97QDL+MWuvHkiI1S9BsyC4vvufVZLeQ3KP3sJojvjPaAzRdHxh4gDbuAicPAGtz71dIySDVsPXjNtNWwEHj4AsRuQ0A1CfPIm0nomWvWbO6KP4k5U9I3+B/lNkZeP17Emt4VcqPJaDQcUnYpCsvtQ0KF7lv9zY5Ev2bBBvSl3DLU8vRaNXtwZoABsawUiUp24ZQU1MoXU9N3OYPyFzZUWaj+hzIef6c7Mhoj7cbTqlzMGmVjuti0s3u6ac+pfKfKdw3cEmJ+fPuFXylSJOWkMXy8F552wkpUNUlyo9oyrjBUDfWMFNl7vGAZG50QLy382UXXsgxnGXPgiz1c1UWlM8uUeoM0KIekjjROY2elGjFolfOvRe/6+UcC7L/GoV6OuKk85U= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5093.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(16576012)(38100700002)(8676002)(2906002)(186003)(4326008)(107886003)(66476007)(508600001)(316002)(36756003)(66556008)(54906003)(5660300002)(6666004)(86362001)(26005)(2616005)(6916009)(31696002)(66946007)(956004)(8936002)(82960400001)(53546011)(31686004)(6486002)(4744005)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?djdUb085MDhGTERmcVJJb2dBajV6K0puTHhkVk8rVkw0WGZrNGNieXB1b1pL?= =?utf-8?B?OVNOMzE2R2JuZHROUUdPSG5CeEJsalZIaVBWQ25Bbk4rempPa2NGS3dwREQr?= =?utf-8?B?cDZJS3BSVEs2Q0FQcmtzMU94MGo5dEtHZ0g3ZktQUUQybnZuaHpRNUxUY1BW?= =?utf-8?B?UWs1d0Vud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OaUhBR2JOd3psSFRRQ01m?= =?utf-8?B?U2U3U3J4TCtSeGg4NVA0ZEFUV2phM1JhU3k4SUl3ajFHSXZhN255Z0grLytL?= =?utf-8?B?REZQUFI2UW9IaHhnaUNrVEplMWk1aGVuNFM0b3loTitlblpYVFc2bkwxUmZr?= =?utf-8?B?alhqT3pCd1QxSmY3MzZ1VlA2VjcxQ3BRVktuUE15Q0lCdnNrVVB2TTF1KzdC?= =?utf-8?B?RkNQOEFZNVQvZEQ2K0ZvRTlQdGRmUzFHTG5nTkpwTjRuZjZOeWNURkppcU1Y?= =?utf-8?B?WmE0Zmk3NlNnZkVST3hmaTlFakF3PT0=?= X-MS-Exchange-CrossTenant-Network-Message-Id: faac47c5-27de-4620-f343-08d99a12ee4d X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5093.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2021 13:00:35.1036 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tt/6lQD+ciWg5PSz3IA+eHj19K3LAmQc5incPTNAqopzcHvX53ChNXgAL3D/S8Ve6AAugBwsTE4AjvFYX7bcDp2QNhy8OmdKs40YN71yZOQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4965 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v1 1/1] vfio: add page-by-page mapping API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 28-Oct-21 9:18 AM, David Marchand wrote: > On Wed, Sep 29, 2021 at 12:19 PM Burakov, Anatoly > wrote: >>> @@ -2179,7 +2208,29 @@ rte_vfio_container_dma_map(int container_fd, uint64_t vaddr, uint64_t iova, >>> return -1; >>> } >>> >>> - return container_dma_map(vfio_cfg, vaddr, iova, len); >>> + /* not having page size means we map entire segment */ >>> + return container_dma_map(vfio_cfg, vaddr, iova, len, 0); >>> +} >>> + >>> +int >>> +rte_vfio_container_dma_map_paged(int container_fd, uint64_t vaddr, >>> + uint64_t iova, uint64_t len, uint64_t pagesz) >>> +{ >>> + struct vfio_config *vfio_cfg; >>> + >>> + if (len == 0 || pagesz == 0 || !rte_is_power_of_2(pagesz) || >>> + (len % pagesz) != 0) { >> >> This should also check if VA/IOVA is page-aligned. Will fix in v2. > > Can you send v2? > Thanks. > Yes, working on it :) -- Thanks, Anatoly