From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932453AbdJZTkn (ORCPT ); Thu, 26 Oct 2017 15:40:43 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:16649 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932326AbdJZTkm (ORCPT ); Thu, 26 Oct 2017 15:40:42 -0400 Subject: Re: [PATCH v7 02/13] xen/pvcalls: implement frontend disconnect To: Stefano Stabellini , xen-devel@lists.xen.org References: <1509045112-9807-1-git-send-email-sstabellini@kernel.org> <1509045112-9807-2-git-send-email-sstabellini@kernel.org> Cc: linux-kernel@vger.kernel.org, jgross@suse.com, Stefano Stabellini From: Boris Ostrovsky Message-ID: <07fa24b4-6c13-1b65-52bd-4aecaeac1055@oracle.com> Date: Thu, 26 Oct 2017 15:42:05 -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: <1509045112-9807-2-git-send-email-sstabellini@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/26/2017 03:11 PM, Stefano Stabellini wrote: > Introduce a data structure named pvcalls_bedata. It contains pointers to > the command ring, the event channel, a list of active sockets and a list > of passive sockets. Lists accesses are protected by a spin_lock. > > Introduce a waitqueue to allow waiting for a response on commands sent > to the backend. > > Introduce an array of struct xen_pvcalls_response to store commands > responses. > > Introduce a new struct sock_mapping to keep track of sockets. In this > patch the struct sock_mapping is minimal, the fields will be added by > the next patches. > > pvcalls_refcount is used to keep count of the outstanding pvcalls users. > Only remove connections once the refcount is zero. > > Implement pvcalls frontend removal function. Go through the list of > active and passive sockets and free them all, one at a time. > > Signed-off-by: Stefano Stabellini > CC: boris.ostrovsky@oracle.com > CC: jgross@suse.com Reviewed-by: Boris Ostrovsky