From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v4 3/6] bus: introduce device level DMA memory mapping Date: Wed, 13 Mar 2019 10:56:25 +0100 Message-ID: <1698312.TEgN2QzQvo@xps> References: <1159b0da448d794e00011c7bbfd0a99523d005e6.1552206210.git.shahafs@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, yskoh@mellanox.com, ferruh.yigit@intel.com, nhorman@tuxdriver.com, gaetan.rivet@6wind.com To: Shahaf Shuler , anatoly.burakov@intel.com Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 83F1E374E for ; Wed, 13 Mar 2019 10:56:29 +0100 (CET) In-Reply-To: <1159b0da448d794e00011c7bbfd0a99523d005e6.1552206210.git.shahafs@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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. Should we make it documented somewhere? > +/** > + * 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. Could we make more explicit that this function is part of the "external memory API"?