Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752521AbdIVW1o (ORCPT ); Fri, 22 Sep 2017 18:27:44 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:21305 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752083AbdIVW1n (ORCPT ); Fri, 22 Sep 2017 18:27:43 -0400 Subject: Re: [PATCH v4 11/13] xen/pvcalls: implement poll command To: Stefano Stabellini , xen-devel@lists.xen.org References: <1505516440-11111-1-git-send-email-sstabellini@kernel.org> <1505516440-11111-11-git-send-email-sstabellini@kernel.org> Cc: linux-kernel@vger.kernel.org, jgross@suse.com, Stefano Stabellini From: Boris Ostrovsky Message-ID: <2ee745f7-5bf4-b45c-bee9-e8aa4c20de92@oracle.com> Date: Fri, 22 Sep 2017 18:27:20 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1505516440-11111-11-git-send-email-sstabellini@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 767 Lines: 31 > > +static unsigned int pvcalls_front_poll_passive(struct file *file, > + struct pvcalls_bedata *bedata, > + struct sock_mapping *map, > + poll_table *wait) > +{ > + int notify, req_id, ret; > + struct xen_pvcalls_request *req; > + > + if (test_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT, > + (void *)&map->passive.flags)) { > + uint32_t req_id = READ_ONCE(map->passive.inflight_req_id); > + > + if (req_id != PVCALLS_INVALID_ID && > + READ_ONCE(bedata->rsp[req_id].req_id) == req_id) > + return POLLIN | POLLRDNORM; Do we need to clear PVCALLS_FLAG_ACCEPT_INFLIGHT? Or do we expect a (subsequent?) accept() to do that? -boris > + > + poll_wait(file, &map->passive.inflight_accept_req, wait); > + return 0; > + } > +