Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp6732840imm; Sun, 20 May 2018 09:25:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqmTHz6TuUeSESr1XSslftD8vR6p/6PmyG9M95k9LQkvWpFRetpkCNcYHr8sZosMWBle/Zj X-Received: by 2002:aa7:83c7:: with SMTP id j7-v6mr16914220pfn.50.1526833553633; Sun, 20 May 2018 09:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526833553; cv=none; d=google.com; s=arc-20160816; b=YuMGRJC0ICt2X3UTBeQiw+BOgq9FSvfC0hVSt+sobtAkFMSFZzWxqKw7e6rmfB6/6F YKjzmflE+OjbBBJQ2tCoOJc65qWFbQEo1xyDEs+fBgJWP2b9Qa7TCt6FOXHD7tr+bbUD r+yzAFWKPmqCj9w/JryisXq6l9pw7T7mas4iO8mLBjuN8nr8wiD/A/DVrIpcUHNF1Aj+ tDnBgpm0ZQh7VB+cQuMpagUFWErtBZCVvFaY2lJ3YF7CRKrKKEYHW6KjCuq+e9hVJbaY FKzaI29sx0PjQ3HGeDcP/EmDHIQmABV0cpWQGYGVC663MrugWx5xbB4+2rexMUEkknGB vYUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=EBlNR6WgxxYRxhLpe3ZBk/cVSdTxykaE1EF+xBj8XBg=; b=RrRgrmjb8svhc5NasDRKiVdJmB0LEIhritzudis56CIrRZoaj3J9qmlX4js6RzgnWN CRenQMHZtod4ORu3FMmjCjj7Zk+eegW+SG8Iro2ypa8+/dlH918xpDcYEs1ng/k8s7uQ 6ivyAZ+eg1SHAttP/eEjyHpbuReTiiKP8KZD4Ms2WYTE0mSt1quII4Loxzt9QDq7pYFu +z5lvvni1OW5Bwvtp6QPnmexPB+USKdLtSyuy+gNv8MR/EDdDJRlRGB03VfYjFPxpEVH hIEX0lNd+Cf964b89FYUry2FUgU5c7rkNoF8pL5D2gNe7T7vp4GRj+g1hdSeNDblkyMd KftQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v137-v6si9718363pgb.117.2018.05.20.09.25.37; Sun, 20 May 2018 09:25:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752375AbeETQZ0 (ORCPT + 99 others); Sun, 20 May 2018 12:25:26 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57812 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751162AbeETQZX (ORCPT ); Sun, 20 May 2018 12:25:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A4C07407574B; Sun, 20 May 2018 16:25:22 +0000 (UTC) Received: from wei-ubt (dhcp-14-122.nay.redhat.com [10.66.14.122]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 869562026609; Sun, 20 May 2018 16:25:18 +0000 (UTC) Date: Mon, 21 May 2018 00:25:14 +0800 From: Wei Xu To: Jason Wang Cc: mst@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jfreimann@redhat.com, tiwei.bie@intel.com Subject: Re: [RFC V4 PATCH 0/8] Packed ring layout for vhost Message-ID: <20180520162514.GA21958@wei-ubt> References: <1526473941-16199-1-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1526473941-16199-1-git-send-email-jasowang@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 20 May 2018 16:25:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 20 May 2018 16:25:22 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'wexu@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 16, 2018 at 08:32:13PM +0800, Jason Wang wrote: > Hi all: > > This RFC implement packed ring layout. The code were tested with > Tiwei's RFC V3 ahttps://lkml.org/lkml/2018/4/25/34. Some fixups and > tweaks were needed on top of Tiwei's code to make it run for event > index. Could you please show the change based on Tiwei's code to easy other's test? > > Pktgen reports about 20% improvement on PPS (event index is off). More > testing is ongoing. > > Notes for tester: > > - Start from this version, vhost need qemu co-operation to work > correctly. Or you can comment out the packed specific code for > GET/SET_VRING_BASE. Do you mean the code in vhost_virtqueue_start/stop? Both Tiwei's and your v3 work fortunately correctly which should be avoided since the ring should be definitely different. Wei > > Changes from V3: > - Fix math on event idx checking > - Sync last avail wrap counter through GET/SET_VRING_BASE > - remove desc_event prefix in the driver/device structure > > Changes from V2: > - do not use & in checking desc_event_flags > - off should be most significant bit > - remove the workaround of mergeable buffer for dpdk prototype > - id should be in the last descriptor in the chain > - keep _F_WRITE for write descriptor when adding used > - device flags updating should use ADDR_USED type > - return error on unexpected unavail descriptor in a chain > - return false in vhost_ve_avail_empty is descriptor is available > - track last seen avail_wrap_counter > - correctly examine available descriptor in get_indirect_packed() > - vhost_idx_diff should return u16 instead of bool > > Changes from V1: > > - Refactor vhost used elem code to avoid open coding on used elem > - Event suppression support (compile test only). > - Indirect descriptor support (compile test only). > - Zerocopy support. > - vIOMMU support. > - SCSI/VSOCK support (compile test only). > - Fix several bugs > > Jason Wang (8): > vhost: move get_rx_bufs to vhost.c > vhost: hide used ring layout from device > vhost: do not use vring_used_elem > vhost_net: do not explicitly manipulate vhost_used_elem > vhost: vhost_put_user() can accept metadata type > virtio: introduce packed ring defines > vhost: packed ring support > vhost: event suppression for packed ring > > drivers/vhost/net.c | 136 ++---- > drivers/vhost/scsi.c | 62 +-- > drivers/vhost/vhost.c | 861 ++++++++++++++++++++++++++++++++----- > drivers/vhost/vhost.h | 47 +- > drivers/vhost/vsock.c | 42 +- > include/uapi/linux/virtio_config.h | 9 + > include/uapi/linux/virtio_ring.h | 32 ++ > 7 files changed, 928 insertions(+), 261 deletions(-) > > -- > 2.7.4 >