Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp758921imm; Mon, 2 Jul 2018 22:39:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfdSy9WMyCK+cyIY+grxN9bwY9mq/ZSVZ6CVk85xYkQv+p54r4LIXBY6n/VXb5fDwGsEPqD X-Received: by 2002:a63:c20:: with SMTP id b32-v6mr5367522pgl.400.1530596363887; Mon, 02 Jul 2018 22:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530596363; cv=none; d=google.com; s=arc-20160816; b=TIqL1Rhb9mt94fqDpYpBYsThmDTbwLoL7sUCYOYRbymyAzeud1ehH/A+x89yjfBYfe NHxIdpqYjV+zvWxPi0p3vBmONE0JmeULULxq90DaV27FRAOh55Kt+ewbGHqZGQJtedgx IkEWuALetsXEtbsqjLk11zmy4gcaaWjtjw6I0W4nWYTmfgVa5dGP+9PjKjq7TAuQu+1f vhNSm3JOm7cn7Jq47J+WRZuc1oJ6O5o0H/iJg/9JVRViJXoeCU+FV/WF4qGNJd7I23Ta q1HkQc6EhwoRnq1y4ROSRCcYIcQB/7UsSIIBZ2F+dLmukwL2tLlrG6RNsNTtiKcX7Tm1 eOmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=FpmLxhm1rV6rL0l2uWd1Z0VK825marNHhgkpB/SQKZU=; b=phs7HTq2HmKy458kSNSbg1UaBgrM8yiu/6IjiSmP1P6dazYQtjyjteVkSde4AJJJZm VXm1KtTx+gZ54vE+B9jlfVbh+MWzxND+ayV9cW2x+/EL0n9g3Pb8aQopM9isOrSP0KCq QL6CnsZk/p7Xq9Oow+nCuVqTchwEjrwiOtF+dmlkJbCuEQVCVtIAZF802JPovlyIeYdM yb0Mmgy3HwcvXhd5LmfzsINjbTOhwJGF0DT4wilC56oGK63rwNIRTpC2kb5+JKo6LB1r Ebe3wE7goI7yNA4Mm8UW0UsGtn9rYCBDwz4211OQDWQHSmPn+VZseqqKuMfElse/ZZ1n tYPg== 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 w123-v6si320173pfb.362.2018.07.02.22.39.09; Mon, 02 Jul 2018 22:39:23 -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 S1754165AbeGCFiT (ORCPT + 99 others); Tue, 3 Jul 2018 01:38:19 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44640 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753935AbeGCFiS (ORCPT ); Tue, 3 Jul 2018 01:38:18 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9434A8163C5F; Tue, 3 Jul 2018 05:38:17 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-60.pek2.redhat.com [10.72.12.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id E4805111CA1A; Tue, 3 Jul 2018 05:38:06 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: wexu@redhat.com, tiwei.bie@intel.com, maxime.coquelin@redhat.com, jfreimann@redhat.com Subject: [PATCH net-next 0/8] Packed virtqueue for vhost Date: Tue, 3 Jul 2018 13:37:56 +0800 Message-Id: <1530596284-4101-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Jul 2018 05:38:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Jul 2018 05:38:17 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jasowang@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all: This series implements packed virtqueues. The code were tested with Tiwei's RFC V6 at https://lkml.org/lkml/2018/6/5/120. Pktgen test for both RX and TX does not show obvious difference with split virtqueues. The main bottleneck is the guest Linux driver, since it can not stress vhost for a 100% CPU utilization. A full TCP benchmark is ongoing. Will test virtio-net pmd as well when it was ready. This version were tested with: - Zerocopy (Out of Order) support - vIOMMU support - mergeable buffer on/off - busy polling on/off Changes from RFC V5: - save unnecessary barriers during vhost_add_used_packed_n() - more compact math for event idx - fix failure of SET_VRING_BASE when avail_wrap_counter is true - fix not copy avail_wrap_counter during GET_VRING_BASE - introduce SET_VRING_USED_BASE/GET_VRING_USED_BASE for syncing last_used_idx - rename used_wrap_counter to last_used_wrap_counter - rebase to net-next Changes from RFC V4: - fix signalled_used index recording - track avail index correctly - various minor fixes Changes from RFC 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 RFC 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 RFC 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 | 144 ++---- drivers/vhost/scsi.c | 62 +-- drivers/vhost/vhost.c | 996 +++++++++++++++++++++++++++++++++---- drivers/vhost/vhost.h | 52 +- drivers/vhost/vsock.c | 42 +- include/uapi/linux/vhost.h | 7 + include/uapi/linux/virtio_config.h | 2 + include/uapi/linux/virtio_ring.h | 32 ++ 8 files changed, 1070 insertions(+), 267 deletions(-) -- 2.7.4