From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 4E206532D for ; Wed, 20 Jul 2016 05:16:15 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 19 Jul 2016 20:16:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,392,1464678000"; d="scan'208";a="1010229470" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 19 Jul 2016 20:16:14 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 19 Jul 2016 20:16:13 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 19 Jul 2016 20:16:13 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.116]) with mapi id 14.03.0248.002; Wed, 20 Jul 2016 11:16:09 +0800 From: "Xu, Qian Q" To: "Tan, Jianfeng" , Yuanhan Liu CC: "dev@dpdk.org" , "Wang, Zhihong" Thread-Topic: [dpdk-dev] [PATCH] examples/vhost: fix perf regression Thread-Index: AQHR4cT9gmZYhJZfx0WS63xlyth1baAgBvUAgAAQl4CAAI2IEA== Date: Wed, 20 Jul 2016 03:16:09 +0000 Message-ID: <82F45D86ADE5454A95A89742C8D1410E032EEFD2@shsmsx102.ccr.corp.intel.com> References: <1468936391-138371-1-git-send-email-jianfeng.tan@intel.com> <20160720014450.GQ5146@yliu-dev.sh.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 03:16:15 -0000 My comments below.=20 -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tan, Jianfeng Sent: Wednesday, July 20, 2016 10:44 AM To: Yuanhan Liu Cc: dev@dpdk.org; Wang, Zhihong Subject: Re: [dpdk-dev] [PATCH] examples/vhost: fix perf regression Hi Yuanhan, On 7/20/2016 9:44 AM, Yuanhan Liu wrote: > On Tue, Jul 19, 2016 at 01:53:11PM +0000, Jianfeng Tan wrote: >> We find significant perfermance drop introduced by below commit, when=20 >> vhost example is started with --mergeable 0 and inside vm, kernel=20 >> 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=20 >> mergeable is disabled, it triggers big_packets path of virtio-net=20 >> driver. In this path, virtio driver uses 19 desc with 18 4K-sized=20 >> pages to receive each packet, so that it can receive a big packet=20 >> with size of 64K. But QEMU only creates 256 desc entries for each vq,=20 >> which results in that only 13 packets can be received. VM kernel can=20 >> 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=20 >> disable VIRTIO_NET_F_GUEST_TSO4 and VIRTIO_NET_F_GUEST_TSO6 with=20 >> VIRTIO_NET_F_HOST_TSO4 and VIRTIO_NET_F_HOST_TSO6 when we disable tso=20 >> of vhost example, to avoid VM kernel virtio driver go into=20 >> big_packets path. >> >> Fixes: 859b480d5afd ("vhost: add guest offload setting") >> >> Reported-by: Qian Xu >> Signed-off-by: Jianfeng Tan > We could apply this patch, but I don't think it actually fix anything: > > - it doesn't fix other vhost applications, say OVS, which is for sure > way more widly used than vhost-example. If I remember it correctly, OVS will enable mergeable. > > - it doesn't even fix it when tso is enabled and mergeable-rx is disabled > with this vhost-example. But we'd better avoid users go into such doubt that performance drops becau= se of that commit under the case tso=3Doff,mergeable=3Doff, right? Normally, when people enable TSO, they should turn on mergeable, if they do= n't turn on mergeable, then please don't expect high performance,=20 so this is not a problem. They may get low performance due to the improper = settings.=20 As to a complete fix for the issue, we may need go back to the TSO feature = design for vhost, currently, the feature negotiation code is in the applica= tion,=20 but it's better to be considered in the vhost/virtio library so that applic= ation doesn't need to check/set the feature. But now it's too late for the = complete fix,=20 so the workaround is ok for this release from my view.=20 Thanks, Jianfeng > > Thanks for the good root-cause, btw! > > --yliu