From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZaQg-00062U-5k for qemu-devel@nongnu.org; Wed, 09 Sep 2015 04:08:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZaQc-0002BE-WB for qemu-devel@nongnu.org; Wed, 09 Sep 2015 04:08:30 -0400 Received: from mga03.intel.com ([134.134.136.65]:42499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZaQc-0002B1-RH for qemu-devel@nongnu.org; Wed, 09 Sep 2015 04:08:26 -0400 Date: Wed, 9 Sep 2015 16:11:40 +0800 From: Yuanhan Liu Message-ID: <20150909081140.GM2925@yliu-dev.sh.intel.com> References: <1441697927-16456-1-git-send-email-yuanhan.liu@linux.intel.com> <1441697927-16456-7-git-send-email-yuanhan.liu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 6/7] vhost-user: add multiple queue support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Ouyang, Changchun" Cc: "qemu-devel@nongnu.org" , "mst@redhat.com" On Wed, Sep 09, 2015 at 08:05:11AM +0000, Ouyang, Changchun wrote: > > > > -----Original Message----- > > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > > Sent: Tuesday, September 8, 2015 3:39 PM > > To: qemu-devel@nongnu.org > > Cc: mst@redhat.com; Ouyang, Changchun; Yuanhan Liu > > Subject: [PATCH 6/7] vhost-user: add multiple queue support > > > > From: Ouyang Changchun > > > > This patch is initially based a patch from Nikolay Nikolaev. > > > > Here is the latest version for adding vhost-user multiple queue support, by > > creating a nc and vhost_net pair for each queue. > > > > > > static int vhost_user_start(VhostUserState *s) { > > VhostNetOptions options; > > + VHostNetState *vhost_net; > > + int max_queues; > > + int i = 0; > > > > - if (vhost_user_running(s)) { > > + if (s->running) > > return 0; > > - } > > > > options.backend_type = VHOST_BACKEND_TYPE_USER; > > - options.net_backend = &s->nc; > > options.opaque = s->chr; > > > > - s->vhost_net = vhost_net_init(&options); > > + options.net_backend = s->peers[i].nc; > > + vhost_net = s->peers[i++].vhost_net = vhost_net_init(&options); > > + > > + max_queues = vhost_net_get_max_queues(vhost_net); > > + if (s->queues >= max_queues) { > > use '>' rather than '>=' here? Right, and thanks! --yliu