Received: by 10.192.165.148 with SMTP id m20csp272831imm; Tue, 24 Apr 2018 22:17:28 -0700 (PDT) X-Google-Smtp-Source: AIpwx49pzmaoClDGnovv4VggozmH2Zh7rHk2hVbVpCMRke6WGfmEALEgrwG6ZwB5UKdww/oja8fJ X-Received: by 10.99.122.5 with SMTP id v5mr22542451pgc.184.1524633448552; Tue, 24 Apr 2018 22:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524633448; cv=none; d=google.com; s=arc-20160816; b=Y0NG4+cTjLfo15uag1ZMYG47uY3ue8I2dYgultE+6U3dbL4Cy7VR2lWn7W19bzl+hA qMjn0fgkfOE7FnOKnbcVrIB2E7vzpEK2jpyWN8iX8rBxnmQhAVK34xJgVocLrtYcPK+A wwLFBub+3OTQmk/txMn8fyjrEWl37n+XzRwj6qxvOdxjJyrlmbaYFE7XpwNYmmrQpbtv 3WeA+FmfgDGUVCEYy3Va1xvbYikVF2VOiNmTcneEHDtOFDYQdyvM9rsFp3CN67UTgYH2 0ZweFjB9JN0E+fXCYgZiMhr1w4ou7jAGBXPNYH0Q93kyePHSZmndTTNZy27+HBssVbNG Y+Gg== 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=086CqGLXydpphg8lFMV6B9I/jvGHRw/+XPM694yeG7g=; b=0x0qfZx7+bBfTvD0JsK06AsMs2IdpNUb4FJINNEh+79s2XaJ+WcLA6j8s8sGwOQZjG B5H0nGOpvg9kLAeNdKJX4W8pT9vkSykkg06+Q5S1buByBK/OCRD1wGoMXGCQ5AAFLc6L oUtX28d7FSh8hb9Cwrev9rkI1PU5X3qFF1ArQzPf9XO+4IHpm2PWtu+t0R7qcRATAQKz 4ASqBxP4zNwGMQ618KiBRPga8ZcbZNmrH4hv+3DqixXEqAUjn9qA+X/mPC3mylSY7m98 J8EtkSp/ctvOVVBmmDNiPR86Rm9lO4NF2H2pdmGInH7WGoQJTsgAC/JYDBDZ4zURc/8k +7iA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10-v6si16763647plj.265.2018.04.24.22.16.59; Tue, 24 Apr 2018 22:17:28 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751275AbeDYFPY (ORCPT + 99 others); Wed, 25 Apr 2018 01:15:24 -0400 Received: from mga06.intel.com ([134.134.136.31]:64024 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbeDYFPW (ORCPT ); Wed, 25 Apr 2018 01:15:22 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2018 22:15:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,325,1520924400"; d="scan'208";a="223170550" Received: from debian.sh.intel.com ([10.67.104.164]) by fmsmga006.fm.intel.com with ESMTP; 24 Apr 2018 22:15:20 -0700 From: Tiwei Bie To: mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: wexu@redhat.com, jfreimann@redhat.com, tiwei.bie@intel.com Subject: [RFC v3 0/5] virtio: support packed ring Date: Wed, 25 Apr 2018 13:15:45 +0800 Message-Id: <20180425051550.24342-1-tiwei.bie@intel.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello everyone, This RFC implements packed ring support in virtio driver. Some simple functional tests have been done with Jason's packed ring implementation in vhost: https://lkml.org/lkml/2018/4/23/12 Both of ping and netperf worked as expected (with EVENT_IDX disabled). But there are below known issues: 1. Reloading the guest driver will break the Tx/Rx; 2. Zeroing the flags when detaching a used desc will break the guest -> host path. Some simple functional tests have also been done with Wei's packed ring implementation in QEMU: http://lists.nongnu.org/archive/html/qemu-devel/2018-04/msg00342.html Both of ping and netperf worked as expected (with EVENT_IDX disabled). Reloading the guest driver also worked as expected. TODO: - Refinements (for code and commit log) and bug fixes; - Discuss/fix/test EVENT_IDX support; - Test devices other than net; RFC v2 -> RFC v3: - Split into small patches (Jason); - Add helper virtqueue_use_indirect() (Jason); - Just set id for the last descriptor of a list (Jason); - Calculate the prev in virtqueue_add_packed() (Jason); - Fix/improve desc suppression code (Jason/MST); - Refine the code layout for XXX_split/packed and wrappers (MST); - Fix the comments and API in uapi (MST); - Remove the BUG_ON() for indirect (Jason); - Some other refinements and bug fixes; RFC v1 -> RFC v2: - Add indirect descriptor support - compile test only; - Add event suppression supprt - compile test only; - Move vring_packed_init() out of uapi (Jason, MST); - Merge two loops into one in virtqueue_add_packed() (Jason); - Split vring_unmap_one() for packed ring and split ring (Jason); - Avoid using '%' operator (Jason); - Rename free_head -> next_avail_idx (Jason); - Add comments for virtio_wmb() in virtqueue_add_packed() (Jason); - Some other refinements and bug fixes; Thanks! Tiwei Bie (5): virtio: add packed ring definitions virtio_ring: support creating packed ring virtio_ring: add packed ring support virtio_ring: add event idx support in packed ring virtio_ring: enable packed ring drivers/virtio/virtio_ring.c | 1271 ++++++++++++++++++++++++++++-------- include/linux/virtio_ring.h | 8 +- include/uapi/linux/virtio_config.h | 12 +- include/uapi/linux/virtio_ring.h | 36 + 4 files changed, 1049 insertions(+), 278 deletions(-) -- 2.11.0