Received: by 10.192.165.148 with SMTP id m20csp3041446imm; Sun, 22 Apr 2018 22:40:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+dUGZH4tKtj3i33hR2cgeniEg13Mx3nbOOxJjXCixDV6h0MJxkGS3joPDS1w/hmIa7VqNs X-Received: by 10.101.101.150 with SMTP id u22mr15642093pgv.368.1524462003577; Sun, 22 Apr 2018 22:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524462003; cv=none; d=google.com; s=arc-20160816; b=uukFXYTT0kLN+CBjoqScXRY1Hv7iIsY1nVVTjFcxTj+I3KaaA0exgRVG55o3iviTeR FltbtDH8kxvTYr1Kr+Y/3MkM0IN7Wsg01RUdgeUYyuHdKEtIcY3hz5Y5XTIwLrM9cKPj tIvxPt6u5IGTr9ixCTq+kiMMGD6WHcttqaCksbRckdF/1p9diqW9cr8A/+53Mj0hxMa4 eRFME4cKJTG5xMYYc+gDrErsI7c4znpHZvPHCMggyOHim9p3eLD3pDhMk259x7Jatiid r00VQjFKcJxgVIGgbIEtdxFC/F8yzuQL7fLCd+RVdm+3vJA1zNIWQl7zWGGaGv9glEr/ iSWw== 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=QYDnomKll9ujpdKBSe9Y7ZVXidnYbNXPXfHGeAOiSQ0=; b=JSCAPV1AgYt3YTEz025FMnR15KHpd8RlCIkv55kCRgEDmdOUL+CW7VYTMg8Jo0h/PV 8l0of6U0fSo2nLBRouwTCiPaSkCFgbiu4Q6TVKQtyNXThgz8ljugFs4xxp5Jg1rcYPio Zu0No4azpLOkHMplWpI7ipHiD8dmowLAuypJB82f3Youb7xvTWhwgu35df62+ANELMxc tSJeSlXytW6egMJeWq9R0lGEEWhbQfQ4vp50bsoR5YY2BnJPkcok6O3xNRK2Ybz8cRvw gqSTWwH8Hw3FaYeMVAEMIQABhuKPeU8oFClTMjVshMUsv9eNn4uQdKTeu/T23x66P/wz kP5w== 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 u5si8728172pfi.96.2018.04.22.22.39.49; Sun, 22 Apr 2018 22:40:03 -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 S1751365AbeDWFfL (ORCPT + 99 others); Mon, 23 Apr 2018 01:35:11 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43992 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751117AbeDWFfJ (ORCPT ); Mon, 23 Apr 2018 01:35:09 -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 B085681A88C6; Mon, 23 Apr 2018 05:35:08 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-101.pek2.redhat.com [10.72.12.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id A09A32023239; Mon, 23 Apr 2018 05:35:02 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, tiwei.bie@intel.com, jfreimann@redhat.com, wexu@redhat.com Subject: [RFC V3 PATCH 0/8] Packed ring for vhost Date: Mon, 23 Apr 2018 13:34:52 +0800 Message-Id: <1524461700-5469-1-git-send-email-jasowang@redhat.com> 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.8]); Mon, 23 Apr 2018 05:35:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 23 Apr 2018 05:35:08 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.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 RFC implement packed ring layout. The code were tested with Tiwei's RFC V2 a thttps://lkml.org/lkml/2018/4/1/48. Some fixups and tweaks were needed on top of Tiwei's code to make it run. TCP stream and pktgen does not show obvious difference compared with split ring. 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 For simplicity, I don't implement batching or other optimizations. Please review. 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 | 824 ++++++++++++++++++++++++++++++++++--- 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, 926 insertions(+), 226 deletions(-) -- 2.7.4