From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USXLd-0002PT-6A for qemu-devel@nongnu.org; Wed, 17 Apr 2013 14:44:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USXLa-0001Uq-DM for qemu-devel@nongnu.org; Wed, 17 Apr 2013 14:44:49 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:57895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USXLa-0001Sz-6g for qemu-devel@nongnu.org; Wed, 17 Apr 2013 14:44:46 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 17 Apr 2013 12:44:44 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 61B833E40066 for ; Wed, 17 Apr 2013 12:44:27 -0600 (MDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3HIicnJ316570 for ; Wed, 17 Apr 2013 12:44:38 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3HIiak2028723 for ; Wed, 17 Apr 2013 12:44:36 -0600 Message-ID: <516EED91.7090803@linux.vnet.ibm.com> Date: Wed, 17 Apr 2013 14:44:33 -0400 From: "Michael R. Hines" MIME-Version: 1.0 References: <1366172418-8729-1-git-send-email-mrhines@linux.vnet.ibm.com> <1366172418-8729-5-git-send-email-mrhines@linux.vnet.ibm.com> <516E6867.1070409@redhat.com> In-Reply-To: <516E6867.1070409@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL v3 4/7] rdma: core logic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aliguori@us.ibm.com, quintela@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com Thanks. Comments inline.... On 04/17/2013 05:16 AM, Paolo Bonzini wrote: > > +/* > + * Create protection domain and completion queues > + */ > +static int qemu_rdma_alloc_pd_cq(RDMAContext *rdma) > +{ > + /* allocate pd */ > + rdma->pd = ibv_alloc_pd(rdma->verbs); > + if (!rdma->pd) { > + fprintf(stderr, "failed to allocate protection domain\n"); > + return -1; > + } > + > + /* create completion channel */ > + rdma->comp_channel = ibv_create_comp_channel(rdma->verbs); > + if (!rdma->comp_channel) { > + fprintf(stderr, "failed to allocate completion channel\n"); > + goto err_alloc_pd_cq; > + } > + > + qemu_set_nonblock(rdma->comp_channel->fd); > Again showing my lack of IB-fu, do you have to test for POLLOUT > somewhere too? Or does it just work? There is no output to that file descriptor - it's strictly used for read() in order to know when events occur. I've already incorporated the yield() coroutine patch you requested, so you'll see it in my next posting. >> @@ -121,7 +125,6 @@ void process_incoming_migration(QEMUFile *f) >> Coroutine *co = qemu_coroutine_create(process_incoming_migration_co); >> int fd = qemu_get_fd(f); >> >> - assert(fd != -1); >> qemu_set_nonblock(fd); > So in the end you are setting the fd to non-blocking. :) > > Please add a get_fd implementation to QEMUFile that returns > rdma->comp_channel->fd, and leave the assertion in place. The fd will > be set twice to nonblocking, but that's ok. Cool. =)