From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3] examples/vhost: fix perf regression Date: Fri, 22 Jul 2016 11:59:18 +0200 Message-ID: <2545812.Vh7NDq74Ot@xps13> References: <1468936391-138371-1-git-send-email-jianfeng.tan@intel.com> <1469061765-50814-1-git-send-email-jianfeng.tan@intel.com> <20160721013426.GA28708@yliu-dev.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Yuanhan Liu , zhihong.wang@intel.com, qian.q.xu@intel.com To: Jianfeng Tan Return-path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 7F3CE4A63 for ; Fri, 22 Jul 2016 11:59:20 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id i5so58885958wmg.0 for ; Fri, 22 Jul 2016 02:59:20 -0700 (PDT) In-Reply-To: <20160721013426.GA28708@yliu-dev.sh.intel.com> 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" 2016-07-21 09:34, Yuanhan Liu: > On Thu, Jul 21, 2016 at 12:42:45AM +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 commit, 859b480d5afd ("vhost: add guest offload setting"), adds > > support for VIRTIO_NET_F_GUEST_TSO4 and VIRTIO_NET_F_GUEST_TSO6, > > in vhost lib. But inside vhost example, the way to disable tso only > > excludes the direction from virtio to vhost, but not the opposite > > direction. When mergeable is disabled, it triggers big_packets path > > of virtio-net driver to prepare to receive possible big packets with > > size of 64K. Because mergeable is off, for each entry of avail ring, > > virtio driver uses 19 desc chained together, with one desc pointing > > to header, other 18 desc pointing to 4K-sized pages. 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: 9fd72e3cbd29 ("examples/vhost: add virtio offload") > > > > Reported-by: Qian Xu > > Signed-off-by: Jianfeng Tan > > --- > > v3: reword commit log. > > Yes, much better. One minor nit: you forgot to carry the Tested-by from > Qian. > > Acked-by: Yuanhan Liu Applied, thanks