Received: by 10.223.185.116 with SMTP id b49csp155573wrg; Tue, 13 Feb 2018 18:44:41 -0800 (PST) X-Google-Smtp-Source: AH8x224z/mdgVCNQRrGSFjGm4eDx3HwoB/mm5ZthfOjRUJ1tBPRq43PeOVXNBXW44O+pXw6EfANN X-Received: by 2002:a17:902:bc41:: with SMTP id t1-v6mr3054317plz.436.1518576281499; Tue, 13 Feb 2018 18:44:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518576281; cv=none; d=google.com; s=arc-20160816; b=v5v06BCmuzbR8ph5jxPx6YXqID2PSDrA4/irU+UVzR5wq/xA6/+81ggiaV8jbiS1zU ohjZxrBvY+/pUXGJsyIoapP0NDXsjNjVl7s/1QqI5yA8Z7U5bV51+Tl80W+zsfI7ubQI Jszqv5YwzioE6d70C/9Ngc05m7wxpYsxo9cNRG0aCH43Y1qpqrGdqGjV3Imu0jcc2j6i J8FS8a0SKKjz/1s3pEdpyAOqI/D2i3RvkgTsyftYCfSUneXWmQ2z44zT4ByovaNd3OkH GBt6ZtInaw1Wl8Fd3kLBgOd6yXW0q/FYN2Uxmjt2SHawRpbZyuCPMPXIdJK5OyKJ8N/P vhtQ== 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=AYrtH+JGro1GmhoBrgPMmm30VNSW1F4+Do5/ea5mmVM=; b=bJ+Dj5eM8k/hwN27dau7dzM+0rIs5ueLY4XKbTYu6qZEw17j+HSdmLW67ZtRnDFcV5 bvrA9OTQjQS5iQtlHWmXwKut9EPmPk+MqF5WzdFSEOdGK0/pDLjYWwbC6mBvIIRN+Eqa tRPnRqyCwkW7lrmyqT9rjGc0pIq1N/xYKIcLPr+CqbnkzjZuFUrqqmHAPwGSr4M5Pr3B pMTnldM8Q7gApoe5hTzdfA1RGoZR7Id8gInSA+K1tPk497QC3PakhqbNQ5KPQC31qoj1 MOFesiMhJ3O5O8wwsqfmFPeDVA4pT+E4I86/8TEAUSg521Bbs869wBU97AjdQucyzjrN zZoQ== 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 x11si3431900pge.713.2018.02.13.18.44.15; Tue, 13 Feb 2018 18:44:41 -0800 (PST) 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 S966562AbeBNCnP (ORCPT + 99 others); Tue, 13 Feb 2018 21:43:15 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39020 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966382AbeBNCnO (ORCPT ); Tue, 13 Feb 2018 21:43:14 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 385B1404084B; Wed, 14 Feb 2018 02:37:19 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-122.pek2.redhat.com [10.72.12.122]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68023F41DA; Wed, 14 Feb 2018 02:37:12 +0000 (UTC) From: Jason Wang To: mst@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, Jason Wang Subject: [PATCH RFC 0/2] Packed ring for vhost Date: Wed, 14 Feb 2018 10:37:07 +0800 Message-Id: <1518575829-1431-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 14 Feb 2018 02:37:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 14 Feb 2018 02:37:19 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 a subset of packed ring which was described at https://github.com/oasis-tcs/virtio-docs/blob/master/virtio-v1.1-packed-wd07.pdf . The code were tested with pmd implement by Jens at http://dpdk.org/ml/archives/dev/2018-January/089417.html. Minor change was needed for pmd codes to kick virtqueue since it assumes a busy polling backend. Test were done between localhost and guest. Testpmd (rxonly) in guest reports 2.4Mpps. Testpmd (txonly) repots about 2.1Mpps. It's not a complete implemention, here's what were missed: - Device Area - Driver Area - Descriptor indirection - Zerocopy may not be functional - Migration path is not tested - Vhost devices except for net - vIOMMU can not work (mainly because the metadata prefetch is not implemented). - See FIXME/TODO in the codes for more details - No batching or other optimizations were implemented For a quick prototype, this series open code the tracking of warp counter and descriptor index at net device. This will be addressed in the future by: - Move get_rx_bufs() from net.c to vhost.c - Let vhost_get_vq_desc() returns vring_used_elem instad of head id With the above, we can hide the internal (at least part of) vring layout from specific device. Please review. Thanks Jason Wang (2): virtio: introduce packed ring defines vhost: packed ring support drivers/vhost/net.c | 14 +- drivers/vhost/vhost.c | 351 ++++++++++++++++++++++++++++++++++--- drivers/vhost/vhost.h | 6 +- include/uapi/linux/virtio_config.h | 9 + include/uapi/linux/virtio_ring.h | 17 ++ 5 files changed, 369 insertions(+), 28 deletions(-) -- 2.7.4