+ Srinath Thanks Anatoly for reviewing this. Please find my reply inline below:
[Anatoly] First of all, what is "iso-cmem"? It doesn't seem to have any defined meaning nor any relation to any existing functionality, and it's not explained anywhere what is "isolated cmem". [Rajesh] I 'll correct commit message to include clearer explanation. *Context & purpose* We 're using this to improve SPDK performance. When NVMe completion queues are allocated from a certain memory range, out of order competions completions are enabled with our PCIe and it improves performance. *Usage* spdk_env_init()-->(calls rte_eal_init(), and then calls )spdk_env_dpdk_post_init() [file: spdk/lib/env_dpdk/init.c] --> spdk_mem_map_init() [lib/env_dpdk/memory.c]-->map_cmem_virtual_area() [this is our custom function] In map_cmem_virtual_area(): we 're mmaping anonymous & private region and then creating iova table which makes iova addresses which fall in custom memory region. Then we call rte_malloc_heap_memory_add() and then allocate NVMe completion queues from this heap. [Anatoly] More importantly, why is this necessary? Type1 map only bypasses external segments when adding memory at startup - it doesn't stop you from calling rte_vfio_dma_map() to map the memory with VFIO when you create the segment. [Rajesh] Please correct me if I'm wrong or missing some thing here. A) We wanted to create a heap from which we can allocate dynamically B) I see that type1_map() [file:dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c] getting called once rte_malloc_heap_memory_add()() was invoked. SPDK uses type1 dma map [spdk/lib/env_dpdk/memory.c] vfio_type1_dma_map() is registered for .dma_map_func member [dpdk/lib/librte_eal/linuxapp/eal/eal_vfio.c] So type1_map is called. Not sure whether we can change this. Regards, Rajesh On Thu, Oct 17, 2019 at 9:15 PM Burakov, Anatoly <anatoly.bura...@intel.com> wrote: > On 15-Oct-19 6:30 AM, Ajit Khaparde wrote: > > From: Rajesh Ravi <rajesh.r...@broadcom.com> > > > > Support external custom memory added to heap to be used with vfio with > > --iso-cmem option.Type1 memory mapping was by passed for external memory. > > But an exception is added to allow external custom memory to be used with > > vfio. > > > > Signed-off-by: Rajesh Ravi <rajesh.r...@broadcom.com> > > Reviewed-by: Jonathan Richardson <jonathan.richard...@broadcom.com> > > Reviewed-by: Scott Branden <scott.bran...@broadcom.com> > > Reviewed-by: Vikram Mysore Prakash <vikram.prak...@broadcom.com> > > Reviewed-by: Ajit Khaparde <ajit.khapa...@broadcom.com> > > --- > > Hi, > > First of all, what is "iso-cmem"? It doesn't seem to have any defined > meaning nor any relation to any existing functionality, and it's not > explained anywhere what is "isolated cmem". > > More importantly, why is this necessary? Type1 map only bypasses > external segments when adding memory at startup - it doesn't stop you > from calling rte_vfio_dma_map() to map the memory with VFIO when you > create the segment. > > -- > Thanks, > Anatoly > -- Regards, Rajesh