From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751892AbdIVIcL (ORCPT ); Fri, 22 Sep 2017 04:32:11 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:46092 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751792AbdIVIcJ (ORCPT ); Fri, 22 Sep 2017 04:32:09 -0400 X-Google-Smtp-Source: AOwi7QCRya6qJIY5sDRD9FCTECAoadynPu93ks8Q0sGOO5nE4CpuiA2KOgPd1WtQ1/X0u4acvybh4A== Date: Fri, 22 Sep 2017 09:31:58 +0100 From: Stefan Hajnoczi To: Jason Wang Cc: mst@redhat.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH net-next RFC 1/5] vhost: split out ring head fetching logic Message-ID: <20170922083157.GA9243@stefanha-x1.localdomain> References: <1506067355-5771-1-git-send-email-jasowang@redhat.com> <1506067355-5771-2-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1506067355-5771-2-git-send-email-jasowang@redhat.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 22, 2017 at 04:02:31PM +0800, Jason Wang wrote: > +/* This looks in the virtqueue and for the first available buffer, and converts > + * it to an iovec for convenient access. Since descriptors consist of some > + * number of output then some number of input descriptors, it's actually two > + * iovecs, but we pack them into one and note how many of each there were. > + * > + * This function returns the descriptor number found, or vq->num (which is > + * never a valid descriptor number) if none was found. A negative code is > + * returned on error. */ > +int __vhost_get_vq_desc(struct vhost_virtqueue *vq, > + struct iovec iov[], unsigned int iov_size, > + unsigned int *out_num, unsigned int *in_num, > + struct vhost_log *log, unsigned int *log_num, > + __virtio16 head) [...] > +int vhost_get_vq_desc(struct vhost_virtqueue *vq, > + struct iovec iov[], unsigned int iov_size, > + unsigned int *out_num, unsigned int *in_num, > + struct vhost_log *log, unsigned int *log_num) Please document vhost_get_vq_desc(). Please also explain the difference between __vhost_get_vq_desc() and vhost_get_vq_desc() in the documentation.