Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2081775imu; Wed, 21 Nov 2018 06:29:43 -0800 (PST) X-Google-Smtp-Source: AJdET5d6PousTajOIT1PZV465rx1gkh2FQyL7tzKYZgT5Ep75d5X90TU06ucJQErpiDp/TduqiqA X-Received: by 2002:aa7:83c6:: with SMTP id j6mr7038521pfn.91.1542810583840; Wed, 21 Nov 2018 06:29:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542810583; cv=none; d=google.com; s=arc-20160816; b=noqaVcPoPxdNan9xaavEcLD1CrxNJDkyWMJXwK1xuj5ewEbUqIpW+EoACAv9tP5x81 5iFiT1Na3fFS+FvGI38XfZjCpx4MHjRzpmrPvpybSK94u0lcvSrXtWuxHe/7hbYBO35F NH+Db8/uyKK5sMY19CkFVAIEtLRYEr72yH6Qv9/KKyowvPGcLljPFrLOrYr1uDDgYj96 vKOEpfaIDreYtPA64MH9JlpGPy+bu29NuG4taN4HrO+4uh16M5Y2TJ/wvXCA8Zgnrzo0 d1DpE10rVpGywX/tbGqy8MPXTisZDcXA/grDqrLfE0wCd2Zb7sSSSLTs0P0qCT6IkrGJ zmkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=8eYtxlyFoxY/APqe91kh4A4n8E8pp5MXoNUZ5ISjrXQ=; b=HRH8BhmVnQn/7WDqV/bsxeAj1z+dFiDELwAJAnHy0Loxtxt4rkWGnH4ZpKwXgsC+lR d5TqTqwU+T3614Hdh6395J0o6wx8v9H65DGzXV4wsxfkoUmDOs6pTHLoMN+fVNR0lqTf MugfLVgQiFXSr5K9hKeD/9gJw3sx6ZDafywPYrvPStzkNuQNlHOh9jwj5nlREkoeQA7N M4ILGzwi8lWAVsLprYs4Z1ddTIDl0iERgOcYOTrGJFfS/FzXcRBt0nHEcKLHwRcfxq3h cPiqHAqeWN3tGvNKNKKHQsoJPumiMMDPTEN89J/whm5qXePb7GnI3bZeY5azJX+m5wY2 0WXA== 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 i129si7449885pfb.32.2018.11.21.06.29.28; Wed, 21 Nov 2018 06:29:43 -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 S1730156AbeKVAUm (ORCPT + 99 others); Wed, 21 Nov 2018 19:20:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46950 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726016AbeKVAUm (ORCPT ); Wed, 21 Nov 2018 19:20:42 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6288830001D4; Wed, 21 Nov 2018 13:46:14 +0000 (UTC) Received: from [10.72.12.110] (ovpn-12-110.pek2.redhat.com [10.72.12.110]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B979160923; Wed, 21 Nov 2018 13:46:09 +0000 (UTC) Subject: Re: [PATCH net-next v3 00/13] virtio: support packed ring To: Tiwei Bie , "Michael S. Tsirkin" Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, virtio-dev@lists.oasis-open.org, wexu@redhat.com, jfreimann@redhat.com, maxime.coquelin@redhat.com References: <20181121100330.24846-1-tiwei.bie@intel.com> <20181121071308-mutt-send-email-mst@kernel.org> <20181121124233.GA32189@debian> From: Jason Wang Message-ID: <84e80a22-75cc-5b9d-7f6e-980e41850e00@redhat.com> Date: Wed, 21 Nov 2018 21:46:06 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181121124233.GA32189@debian> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 21 Nov 2018 13:46:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/11/21 下午8:42, Tiwei Bie wrote: > On Wed, Nov 21, 2018 at 07:20:27AM -0500, Michael S. Tsirkin wrote: >> On Wed, Nov 21, 2018 at 06:03:17PM +0800, Tiwei Bie wrote: >>> Hi, >>> >>> This patch set implements packed ring support in virtio driver. >>> >>> A performance test between pktgen (pktgen_sample03_burst_single_flow.sh) >>> and DPDK vhost (testpmd/rxonly/vhost-PMD) has been done, I saw >>> ~30% performance gain in packed ring in this case. >> Thanks a lot, this is very exciting! >> Dave, given the holiday, attempts to wrap up the 1.1 spec and the >> patchset size I would very much appreciate a bit more time for >> review. Say until Nov 28? >> >>> To make this patch set work with below patch set for vhost, >>> some hacks are needed to set the _F_NEXT flag in indirect >>> descriptors (this should be fixed in vhost): >>> >>> https://lkml.org/lkml/2018/7/3/33 >> Could you pls clarify - do you mean it doesn't yet work with vhost >> because of a vhost bug, and to test it with the linked patches >> you had to hack in _F_NEXT? Because I do not see _F_NEXT >> in indirect descriptors in this patch (which is fine). >> Or did I miss it? > You didn't miss anything. :) > > I think it's a small bug in vhost, which Jason may fix very > quickly, so I didn't post it. Below is the hack I used: Good catch. I didn't notice the subtle difference since split ring requires for it. Let me fix it in next version. Thanks. > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index cd7e755484e3..42faea7d8cf8 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -980,6 +980,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq, > unsigned int i, n, err_idx; > u16 head, id; > dma_addr_t addr; > + int c = 0; > > head = vq->packed.next_avail_idx; > desc = alloc_indirect_packed(total_sg, gfp); > @@ -1001,8 +1002,9 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq, > if (vring_mapping_error(vq, addr)) > goto unmap_release; > > - desc[i].flags = cpu_to_le16(n < out_sgs ? > - 0 : VRING_DESC_F_WRITE); > + desc[i].flags = cpu_to_le16((n < out_sgs ? > + 0 : VRING_DESC_F_WRITE) | > + (++c == total_sg ? 0 : VRING_DESC_F_NEXT)); > desc[i].addr = cpu_to_le64(addr); > desc[i].len = cpu_to_le32(sg->length); > i++;