Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752755AbdFMHBA (ORCPT ); Tue, 13 Jun 2017 03:01:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:35190 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752656AbdFMHA7 (ORCPT ); Tue, 13 Jun 2017 03:00:59 -0400 Subject: Re: [PATCH v3 10/18] xen/pvcalls: implement listen command To: Stefano Stabellini , xen-devel@lists.xen.org Cc: linux-kernel@vger.kernel.org, boris.ostrovsky@oracle.com, Stefano Stabellini References: <1496431915-20774-1-git-send-email-sstabellini@kernel.org> <1496431915-20774-10-git-send-email-sstabellini@kernel.org> From: Juergen Gross Message-ID: Date: Tue, 13 Jun 2017 09:00:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <1496431915-20774-10-git-send-email-sstabellini@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1364 Lines: 49 On 02/06/17 21:31, 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 > --- > drivers/xen/pvcalls-back.c | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > > diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c > index 4a0cfa3..a75586e 100644 > --- a/drivers/xen/pvcalls-back.c > +++ b/drivers/xen/pvcalls-back.c > @@ -355,7 +355,26 @@ static int pvcalls_back_bind(struct xenbus_device *dev, > static int pvcalls_back_listen(struct xenbus_device *dev, > struct xen_pvcalls_request *req) > { > - return 0; > + struct pvcalls_fedata *priv; > + int ret = -EINVAL; > + struct sockpass_mapping *map; > + struct xen_pvcalls_response *rsp; > + > + priv = dev_get_drvdata(&dev->dev); > + > + map = radix_tree_lookup(&priv->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(&priv->ring, priv->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 ret; return 0? Juergen > } > > static int pvcalls_back_accept(struct xenbus_device *dev, >