From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tushar Swain Subject: vhost_net module TX path is expensive? Date: Wed, 10 Apr 2013 19:16:27 +0530 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 To: kvm@vger.kernel.org Return-path: Received: from mail-qe0-f50.google.com ([209.85.128.50]:37954 "EHLO mail-qe0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760208Ab3DJNq2 (ORCPT ); Wed, 10 Apr 2013 09:46:28 -0400 Received: by mail-qe0-f50.google.com with SMTP id a11so233542qen.23 for ; Wed, 10 Apr 2013 06:46:27 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: Hi, I am running a VM in Linux-kvm (kernel 3.6.11-4 ) that uses vhost_net driver for sending/receiving traffic in backend. VM has two ports and the stack running in the VM functions like a simple router that receives packet from one virtual port and simply routes it to other virtual port. In the backend, vhost_net driver does the actual packet handling for VM. In my routing test, the vhost_net TX path seems to be twice expensive than RX packet. For a 1500 byte packet, "sendmsg" socket call in "handle_tx" routine in "drivers/vhost/net.c" takes almost twice the time than "recvmsg" socket call in "handle_rx" routine sendmsg takes ~12000 cycles recvmsg takes ~6000 cycles Is there any thing wrong? Is there any way to minimize the time taken in sendmsg call? Thanks TS