Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752112AbdFTPu3 (ORCPT ); Tue, 20 Jun 2017 11:50:29 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:48381 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751015AbdFTPu2 (ORCPT ); Tue, 20 Jun 2017 11:50:28 -0400 Subject: Re: [PATCH v4 10/18] xen/pvcalls: implement listen command To: Stefano Stabellini , xen-devel@lists.xen.org References: <1497553787-3709-1-git-send-email-sstabellini@kernel.org> <1497553787-3709-10-git-send-email-sstabellini@kernel.org> Cc: linux-kernel@vger.kernel.org, jgross@suse.com, Stefano Stabellini From: Boris Ostrovsky Message-ID: <4316df6f-398c-48d3-84b5-1f3ae217de26@oracle.com> Date: Tue, 20 Jun 2017 11:51:56 -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: <1497553787-3709-10-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: 1379 Lines: 46 On 06/15/2017 03:09 PM, Stefano Stabellini wrote: > Call inet_listen to implement the listen command. > > Signed-off-by: Stefano Stabellini > CC: boris.ostrovsky@oracle.com > CC: jgross@suse.com Reviewed-by: Boris Ostrovsky > --- > drivers/xen/pvcalls-back.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c > index c17d970..e5c535d 100644 > --- a/drivers/xen/pvcalls-back.c > +++ b/drivers/xen/pvcalls-back.c > @@ -358,6 +358,25 @@ static int pvcalls_back_bind(struct xenbus_device *dev, > static int pvcalls_back_listen(struct xenbus_device *dev, > struct xen_pvcalls_request *req) > { > + struct pvcalls_fedata *fedata; > + int ret = -EINVAL; > + struct sockpass_mapping *map; > + struct xen_pvcalls_response *rsp; > + > + fedata = dev_get_drvdata(&dev->dev); > + > + map = radix_tree_lookup(&fedata->socketpass_mappings, req->u.listen.id); > + if (map == NULL) > + goto out; > + > + ret = inet_listen(map->sock, req->u.listen.backlog); > + > +out: > + rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++); > + rsp->req_id = req->req_id; > + rsp->cmd = req->cmd; > + rsp->u.listen.id = req->u.listen.id; > + rsp->ret = ret; > return 0; newline before return would be useful (if you respin this) > } >