From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7F1FE2C01 for ; Wed, 20 Jul 2016 06:34:37 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 19 Jul 2016 21:34:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,392,1464678000"; d="scan'208";a="1010257018" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga001.fm.intel.com with ESMTP; 19 Jul 2016 21:34:35 -0700 Date: Wed, 20 Jul 2016 12:38:31 +0800 From: Yuanhan Liu To: Jianfeng Tan Cc: dev@dpdk.org, zhihong.wang@intel.com, "Xu, Qian Q" Message-ID: <20160720043831.GT5146@yliu-dev.sh.intel.com> References: <1468936391-138371-1-git-send-email-jianfeng.tan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468936391-138371-1-git-send-email-jianfeng.tan@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] examples/vhost: fix perf regression 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: Wed, 20 Jul 2016 04:34:37 -0000 On Tue, Jul 19, 2016 at 01:53:11PM +0000, Jianfeng Tan wrote: > We find significant perfermance drop introduced by below commit, > when vhost example is started with --mergeable 0 and inside vm, > kernel virtio-net driver is used to do ip based forwarding. > > The root cause is that below commit adds support for > VIRTIO_NET_F_GUEST_TSO4 and VIRTIO_NET_F_GUEST_TSO6, and when > mergeable is disabled, it triggers big_packets path of virtio-net > driver. In this path, virtio driver uses 19 desc with 18 4K-sized > pages to receive each packet, so that it can receive a big packet > with size of 64K. But QEMU only creates 256 desc entries for each > vq, which results in that only 13 packets can be received. VM > kernel can quickly handle those packets and go to sleep (HLT). > > As QEMU has no option to set the desc entries of a vq, so here, > we disable VIRTIO_NET_F_GUEST_TSO4 and VIRTIO_NET_F_GUEST_TSO6 > with VIRTIO_NET_F_HOST_TSO4 and VIRTIO_NET_F_HOST_TSO6 when we > disable tso of vhost example, to avoid VM kernel virtio driver > go into big_packets path. > > Fixes: 859b480d5afd ("vhost: add guest offload setting") And here you are patching vhost example to try to fix an "issue" in vhost lib, this is __logically__ wrong. --yliu > > Reported-by: Qian Xu > Signed-off-by: Jianfeng Tan > --- > examples/vhost/main.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/examples/vhost/main.c b/examples/vhost/main.c > index 3b98f42..92a9823 100644 > --- a/examples/vhost/main.c > +++ b/examples/vhost/main.c > @@ -327,6 +327,8 @@ port_init(uint8_t port) > if (enable_tso == 0) { > rte_vhost_feature_disable(1ULL << VIRTIO_NET_F_HOST_TSO4); > rte_vhost_feature_disable(1ULL << VIRTIO_NET_F_HOST_TSO6); > + rte_vhost_feature_disable(1ULL << VIRTIO_NET_F_GUEST_TSO4); > + rte_vhost_feature_disable(1ULL << VIRTIO_NET_F_GUEST_TSO6); > } > > rx_rings = (uint16_t)dev_info.max_rx_queues; > -- > 2.7.4