From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by dpdk.org (Postfix) with ESMTP id A7B32156 for ; Sat, 14 Dec 2013 00:00:19 +0100 (CET) Received: by mail-pa0-f42.google.com with SMTP id lj1so624509pab.29 for ; Fri, 13 Dec 2013 15:01:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=8kgVqtYK4cq621fb1E1yyfzbt2qwxL2kOCNOp3LhYps=; b=KvMkEzs4eWJDxoOjza9HRVJbgtLCLtoQSjEW9nPzikuZyGYbZiDErW2XKL4L1X/p7a s6ZuRrB9KcF5gZ0Au9syE4EPwluauqQC6PErS6+kRe6mlf/hGbkXsulpFUGxaFA9zxrX QA2bPBpvJnxFUP8t67K3CDMxR+Fnc8Gxe6vbp+R4iKMl8YuJYt6wZhORVhy6WPxs+Xoj gvj9d603bXMJDZKNOqujbJ3DNd6O7HTQcBDprr21p8SNIMgJDVbeEFZWR7PWAXwG61KA WUDASVHwA7vjnx/YllccaE3lQi3ynGEtV8RTsDAHrp3GemO6tDPmIrcleAeItLJBgO/i LiDA== X-Gm-Message-State: ALoCoQk3ns39vT7C9XjR1dFdnC2Xhlx3xDWtn9hOeqyTHbyR82+GW9ps4epn6h3DrypW8d103aNE X-Received: by 10.66.168.12 with SMTP id zs12mr6256450pab.122.1386975684511; Fri, 13 Dec 2013 15:01:24 -0800 (PST) Received: from nehalam.linuxnetplumber.net (static-50-53-83-51.bvtn.or.frontiernet.net. [50.53.83.51]) by mx.google.com with ESMTPSA id qw8sm7549657pbb.27.2013.12.13.15.01.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Dec 2013 15:01:24 -0800 (PST) Date: Fri, 13 Dec 2013 15:01:21 -0800 From: Stephen Hemminger To: James Yu Message-ID: <20131213150121.3d70a0d2@nehalam.linuxnetplumber.net> In-Reply-To: References: X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] outw() in virtio_ring_doorbell() in DPDK+virtio consume 40% of the CPU in oprofile X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 23:00:20 -0000 On Fri, 13 Dec 2013 14:04:35 -0800 James Yu wrote: > Resending it due to missing [dpdk-dev] in the subject line. > > I am using Spirent to send a 2Gbps traffic to a 10G port that are looped > back by l2fwd+DPDK+virtio in a CentOS 32-bit and receive on the other port > only at 700 Mbps. The CentOS 32-bit is on a Fedora 18 KVM host. The > virtual interfaces are configured as virtio port type, not e1000. vhost-net > was automatically used in qemu-kvm when virtio ports are used in the guest. > > The questions are > A. Why it can only reach 2Gbps > B. Why outw() is using 40% of the entire measurement when it only try to > write 2 bytes to the IO port using assembly outw command ? Is it a blocking > call ? or it wastes time is mapping from the IO address of the guest to the > physical address of the IO port on the host ? > C. any way to improve it ? > D. vmxnet PMD codes are using memory mapped IO address, not port IO > address. Will it be faster to use memory mapped IO address ? > > Any pointers or feedback will help. > Thanks > > James The outw is a VM exit to the hypervisor. It informs the hypervisor that data is ready to send and it runs then. To really get better performance, virtio needs to be able to do multiple packets per send. For bulk throughput GSO support would help, but that is a generic DPDK issues. Virtio use I/O to signal hypervisor (there is talk of using MMIO in later versions but it won't be faster.