From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80042.outbound.protection.outlook.com [40.107.8.42]) by dpdk.org (Postfix) with ESMTP id 3DA522C28 for ; Wed, 13 Mar 2019 12:12:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OiFfhWkvZ+WmYK/uF1UyXXez5n8tz4IyLxfh2jn/0g4=; b=obGyYmjNul3fPYBy9k/47MUvx0xi4xrvmay3u+0vrWqmzjufJRRM7VnLfQqhN2xr14tgDefLaSgI5nP3M0ovakIrsY5O+43yG3LhLk1RPoNfO7tot9bzHmTPBfVytJq4JxaUi7x2SnUS10GdkJuqTSE13WQS1Utm0fI8mtoKXLM= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB3713.eurprd05.prod.outlook.com (52.133.43.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.20; Wed, 13 Mar 2019 11:12:42 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003%2]) with mapi id 15.20.1709.011; Wed, 13 Mar 2019 11:12:42 +0000 From: Shahaf Shuler To: Thomas Monjalon , "anatoly.burakov@intel.com" CC: "dev@dpdk.org" , Yongseok Koh , "ferruh.yigit@intel.com" , "nhorman@tuxdriver.com" , "gaetan.rivet@6wind.com" Thread-Topic: [dpdk-dev] [PATCH v4 3/6] bus: introduce device level DMA memory mapping Thread-Index: AQHU2YMJ2zQd5GuloU6ru9IrVdeAcqYJZ2vw Date: Wed, 13 Mar 2019 11:12:42 +0000 Message-ID: References: <1159b0da448d794e00011c7bbfd0a99523d005e6.1552206210.git.shahafs@mellanox.com> <1698312.TEgN2QzQvo@xps> In-Reply-To: <1698312.TEgN2QzQvo@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 49ff708e-cd71-4b48-5a04-08d6a7a4cfec x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3713; x-ms-traffictypediagnostic: AM0PR0502MB3713: x-ms-exchange-purlcount: 1 x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-exchange-diagnostics: =?us-ascii?Q?1; AM0PR0502MB3713; 23:wKb1QyTnn4y7xm8kzYHoJKAfOxNxIme0NFFT9FO?= =?us-ascii?Q?M5OK2lBl1pRktKTN76qP1bPp7x7mmsT1Ez95q4NdQGDUgK/9T4UJzIWSDgVE?= =?us-ascii?Q?Uf1iLDqI/HgwalddkdYlCyn02UiSGi9FOtRPn23lII+LBKMN0ZIyB/HNVTn3?= =?us-ascii?Q?KnKF6AuMMXUV4Wg/o4Uv0SBtPsrRJItD3c9ciKmGFl6B9piXxde4VWWxwQBk?= =?us-ascii?Q?t1QH9FF/DgijrS6kCC8jdIenwGq4xzbLP13NKnkhGaebUSzoeLoUd0yP+WkP?= =?us-ascii?Q?r0O6oOWgA0R5QdokWWX+9sf02wumZUy/IEI/UUTkgKCtF5PNSU6e2S222+k8?= =?us-ascii?Q?yiMqfa+bZHVfX9h7FyJTPPRyNQqMB+kBhDZPOJvleQOqHTLEGO1GzsfyNuLN?= =?us-ascii?Q?ckCM52Kz0IJpFH77Y6jWVIp7jQdu23hqVHYp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8jFHo7/jjeElKaH2wBER4F221SEw6BRTy6XW4ZQfMDLBXkYE/2z?= =?us-ascii?Q?cQxTuTA=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09752BC779 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(346002)(39860400002)(396003)(376002)(13464003)(199004)(189003)(76176011)(74316002)(99286004)(6436002)(8936002)(97736004)(11346002)(446003)(86362001)(14444005)(256004)(93886005)(7736002)(71200400001)(478600001)(81166006)(7696005)(71190400001)(8676002)(81156014)(26005)(14454004)(5660300002)(186003)(305945005)(33656002)(102836004)(52536013)(476003)(6246003)(110136005)(229853002)(6306002)(55016002)(3846002)(105586002)(9686003)(54906003)(6116002)(25786009)(4326008)(316002)(66066001)(486006)(2906002)(53546011)(6506007)(966005)(106356001)(68736007)(53936002)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3713; H:AM0PR0502MB3795.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: IxM9EXMlZbDboLkXX8jlDvZuhydAH2+sNwyLA4u4zCcToe89ISCgNIYFzLsYwHSe5Q/n6cinLJ/CCJlh4RHgqloRZbLzYeZ4WRnVsSKajVjYaNjg63M8/At8gnqihc0a6dd/aXDmKUu6SEFqki5eRqu40Tsy9KYgC0yvH70wwF30e3Qv+TwxHxXS24PtKiLUwnle19yjgTiBQ9Ve1H86Rdgm1vAcWwQQdb7ELlYdAOFu7TWURRYwvSUHh7rKhZ7i2mxRVB/xZsi+kQtLLLgBkLLcPiVsW+S9t1p+L5OJ+wN+0YON1+AgzmuLrvgssBcOJ/B8p/iToqobhv5BsdcvSR7z3zW0s/zYOlUeImhomX78PNwLE2NfM+bj2PDBcrnPJ2B5lNAYuL7ugWax28EMlPcU22eT7RxxQAnzvnPRvzg= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49ff708e-cd71-4b48-5a04-08d6a7a4cfec X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Mar 2019 11:12:42.3831 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3713 Subject: Re: [dpdk-dev] [PATCH v4 3/6] bus: introduce device level DMA memory mapping X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Mar 2019 11:12:45 -0000 > -----Original Message----- > From: Thomas Monjalon > Sent: Wednesday, March 13, 2019 11:56 AM > To: Shahaf Shuler ; anatoly.burakov@intel.com > Cc: dev@dpdk.org; Yongseok Koh ; > ferruh.yigit@intel.com; nhorman@tuxdriver.com; gaetan.rivet@6wind.com > Subject: Re: [dpdk-dev] [PATCH v4 3/6] bus: introduce device level DMA > memory mapping >=20 > 10/03/2019 09:28, Shahaf Shuler: > > For PCI bus devices, the pci driver can expose its own map and unmap > > functions to be used for the mapping. In case the driver doesn't > > provide any, the memory will be mapped, if possible, to IOMMU through > VFIO APIs. > > > > Application usage with those APIs is quite simple: > > * allocate memory > > * call rte_extmem_register on the memory chunk. > > * take a device, and query its rte_device. > > * call the device specific mapping function for this device. >=20 > Should we make it documented somewhere? The full flow to work w/ external memory is documented at doc/guides/prog_g= uide/env_abstraction_layer.rst , Subchapter "Support for Externally Allocat= ed Memory. The last commit in series update the right API to use.=20 >=20 > > +/** > > + * Device level DMA map function. > > + * After a successful call, the memory segment will be mapped to the > > + * given device. > > + * > > + * @note: Memory must be registered in advance using rte_extmem_* > APIs. >=20 > Could we make more explicit that this function is part of the "external > memory API"? How do you suggest?=20 This function belongs to rte_dev therefore the rte_dev prefix. better rte_d= ev_extmem_dma_map ? >=20 >=20 [1] https://patches.dpdk.org/patch/51018/