Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751842AbdIUTk5 (ORCPT ); Thu, 21 Sep 2017 15:40:57 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:36963 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751803AbdIUTk4 (ORCPT ); Thu, 21 Sep 2017 15:40:56 -0400 Subject: Re: [PATCH v4 06/13] xen/pvcalls: implement bind command To: Stefano Stabellini , xen-devel@lists.xen.org Cc: linux-kernel@vger.kernel.org, jgross@suse.com, Stefano Stabellini References: <1505516440-11111-1-git-send-email-sstabellini@kernel.org> <1505516440-11111-6-git-send-email-sstabellini@kernel.org> From: Boris Ostrovsky Message-ID: <3937be6d-c1b4-1c46-65c8-b55182f70a62@oracle.com> Date: Thu, 21 Sep 2017 15:40:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1505516440-11111-6-git-send-email-sstabellini@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1386 Lines: 52 On 09/15/2017 07:00 PM, Stefano Stabellini wrote: > Send PVCALLS_BIND to the backend. Introduce a new structure, part of > struct sock_mapping, to store information specific to passive sockets. > > Introduce a status field to keep track of the status of the passive > socket. > > Signed-off-by: Stefano Stabellini > CC: boris.ostrovsky@oracle.com > CC: jgross@suse.com > --- > drivers/xen/pvcalls-front.c | 68 +++++++++++++++++++++++++++++++++++++++++++++ > drivers/xen/pvcalls-front.h | 3 ++ > 2 files changed, 71 insertions(+) > > diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c > index ef511b6..50b6588 100644 > --- a/drivers/xen/pvcalls-front.c > +++ b/drivers/xen/pvcalls-front.c > @@ -72,6 +72,13 @@ struct sock_mapping { > > wait_queue_head_t inflight_conn_req; > } active; > + struct { > + /* Socket status */ > +#define PVCALLS_STATUS_UNINITALIZED 0 > +#define PVCALLS_STATUS_BIND 1 > +#define PVCALLS_STATUS_LISTEN 2 > + uint8_t status; > + } passive; > }; > }; > > + req->u.bind.id = (uint64_t) map; Space between cast and variable (this happens in quite a few places) > + memcpy(req->u.bind.addr, addr, sizeof(*addr)); > + req->u.bind.len = addr_len; > + > + init_waitqueue_head(&map->passive.inflight_accept_req); This queue is not introduced until patch 8. -boris