From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 4085A301 for ; Fri, 5 Aug 2016 14:18:46 +0200 (CEST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8FA0AC069B53; Fri, 5 Aug 2016 12:18:45 +0000 (UTC) Received: from [10.36.7.61] (vpn1-7-61.ams2.redhat.com [10.36.7.61]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u75CIgN0007403 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Aug 2016 08:18:44 -0400 To: Yuanhan Liu References: <1468333932-26509-1-git-send-email-maxime.coquelin@redhat.com> <20160803140305.GD30752@yliu-dev.sh.intel.com> Cc: huawei.xie@intel.com, dev@dpdk.org, vkaplans@redhat.com, mst@redhat.com From: Maxime Coquelin Message-ID: Date: Fri, 5 Aug 2016 14:18:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160803140305.GD30752@yliu-dev.sh.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 05 Aug 2016 12:18:45 +0000 (UTC) Subject: Re: [dpdk-dev] [RFC] vhost: Add indirect descriptors support to the TX path X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2016 12:18:46 -0000 On 08/03/2016 04:03 PM, Yuanhan Liu wrote: > On Tue, Jul 12, 2016 at 04:32:12PM +0200, Maxime Coquelin wrote: >> Indirect descriptors are usually supported by virtio-net devices, >> allowing to dispatch a large number of large requests. >> >> When the virtio device sends a packet using indirect descriptors, >> only one slot is used in the ring, even for large packets. >> >> Signed-off-by: Maxime Coquelin >> --- >> I have a two questions regarding the implementation of this feature: >> >> 1. Should I add a check to ensure the indirect feature is supported >> (i.e. the negociation succeeded) when having an indirect desc? >> >> 2. Should I check in copy_desc_to_mbuf() that we don't have a nested >> indirect descriptor? >> >> Both these sanity checks are recommended from the virtio spec, but >> since it is to be done in the hot path, it may introduce some >> performance penalties. >> >> Note that the first check is not done in the Kernel vhost driver, whereas >> the second one is. > > I think we could firstly follow the Linux kernel implementation. OK, I can do that in the v2. > >> + if (vq->desc[desc_indexes[i]].flags & VRING_DESC_F_INDIRECT) { >> + desc = (struct vring_desc *)gpa_to_vva(dev, >> + vq->desc[desc_indexes[i]].addr); >> + rte_prefetch0(desc); >> + size = vq->desc[desc_indexes[i]].len / sizeof(*desc); >> + idx = 0; >> + } else { >> + desc = vq->desc; >> + size = vq->size; >> + idx = desc_indexes[i]; > > Why not fetching the desc here and feeding it to copy_desc_to_mbuf(), > instead of using "desc" and "idx" combination and fetching it inside > that function? Because the desc we pass to copy_desc_to_mbuf() is the descriptor that will be used as the base later to get the next descriptors. In case of indirect descriptors, the first descriptor of the chain is always the first element of the descriptors array, which is not the case for direct descriptors. > > Overall, this patch looks good to me. As stated in IRC, It'd be great > if you could offer some performance data. Sure. I lacked time this week, and next week will be likely the same. But I agree we need the perf data before it gets merged. > Thanks for the work, and apologize for the late review! Not a problem, you review is appreciated. Thanks, Maxime