From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tan, Jianfeng" Subject: Re: [PATCH v1 0/2] Virtio-net PMD Extension to work on host Date: Mon, 11 Jan 2016 13:31:41 +0800 Message-ID: <56933E3D.1090802@intel.com> References: <1447930650-26023-2-git-send-email-mukawa@igel.co.jp> <1450255049-2263-1-git-send-email-mukawa@igel.co.jp> <568117AB.1080605@igel.co.jp> <568C90A7.9040503@igel.co.jp> <568CA950.9000205@intel.com> <568CC3A4.7080603@igel.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "nakajima.yoshihiro@lab.ntt.co.jp" , "mst@redhat.com" To: Tetsuya Mukawa , "dev@dpdk.org" Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A9B995A6B for ; Mon, 11 Jan 2016 06:31:46 +0100 (CET) In-Reply-To: <568CC3A4.7080603@igel.co.jp> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Tetsuya, > With current your implementation, when 'virtual' virtio-net PMD is used, > 'phys_addr' will be virtual address in EAL layer. > > struct rte_memseg { > phys_addr_t phys_addr; /**< Start physical address. */ > union { > void *addr; /**< Start virtual address. */ > uint64_t addr_64; /**< Makes sure addr is always 64 > bits */ > }; > ....... > }; It's not true. It does not effect EAL layer at all. Just fill virtual address in virtio PMD when: 1). set_base_addr; 2). preparing RX's descriptors; 3). transmitting packets, CVA is filled in TX's descriptors; 4). in TX and CQ's header, CVA is used. > > How about choosing it in virtio-net PMD? My current implementation works as you say. > (In the case of 'virtual', just use 'addr' instead of using 'phys_addr'.) > For example, port0 may use physical address, but port1 may use virtual > address. > > With this, of course, we don't have an issue with 'physical' virtio-net PMD. > Also, with 'virtual' virtio-net PMD, we can use virtual address and fd > that represents the big virtual address space. > (TODO: Need to change rte_memseg and EAL to keep fd and offset?) I suppose you mean that when initializing memory, just maintain one fd in the end, and mmap all memsegs inside it. This sounds like a good idea to solve the limitation of VHOST_MEMORY_MAX_NREGIONS. Besides, Sergio and I are discussing about using VA instead of PA in VFIO to avoid the requirement of physical-config for physical devices. Thanks, Jianfeng > Then, you don't worry about VHOST_MEMORY_MAX_NREGIONS, because we have > only one fd. > >> b. containers without root privilege >> No need to worry about this problem, because it lacks of privilege to >> construct physical-contiguous memory. >> > Yes, we cannot run 'physical' PMDs in this type of container. > Anyway, I will check it more, if we really need it. > > Thanks, > Tetsuya