From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 7F48F3798 for ; Mon, 21 Aug 2017 17:00:44 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B38A81E0F; Mon, 21 Aug 2017 15:00:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9B38A81E0F Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jfreimann@redhat.com Received: from localhost (ovpn-116-220.ams2.redhat.com [10.36.116.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5526977CB7; Mon, 21 Aug 2017 15:00:36 +0000 (UTC) Date: Mon, 21 Aug 2017 17:00:34 +0200 From: Jens Freimann To: Dariusz Stojaczyk Cc: dev@dpdk.org, Pawel Wodkowski , "Maxime Coquelin (mcoqueli)" , yliu@fridaylinux.org Message-ID: <20170821150034.sevaefe57m3pnlpd@localhost.localdomain> References: <1503308082-17926-1-git-send-email-dariuszx.stojaczyk@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1503308082-17926-1-git-send-email-dariuszx.stojaczyk@intel.com> User-Agent: NeoMutt/20170714 (1.8.3) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 21 Aug 2017 15:00:43 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH] vhost: added user callbacks for socket open/close X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Aug 2017 15:00:44 -0000 Hi Dariusz, On Mon, Aug 21, 2017 at 11:34:42AM +0200, Dariusz Stojaczyk wrote: >When user receives destroy_device signal, he does not know *why* that >event happened. He does not differ between socket shutdown and virtio >processing pause. User could completely delete device during transition >from BIOS to kernel, causing freeze or possibly kernel panic. Instead >of changing new_device/destroy_device callbacks and breaking the ABI, >a set of new functions new_connection/destroy_connection has been added. > >Signed-off-by: Dariusz Stojaczyk >--- > lib/librte_vhost/rte_vhost.h | 5 ++++- > lib/librte_vhost/socket.c | 23 +++++++++++++++++++---- > 2 files changed, 23 insertions(+), 5 deletions(-) > >diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h >index 8c974eb..8f86167 100644 >--- a/lib/librte_vhost/rte_vhost.h >+++ b/lib/librte_vhost/rte_vhost.h >@@ -107,7 +107,10 @@ struct vhost_device_ops { > */ > int (*features_changed)(int vid, uint64_t features); > >- void *reserved[4]; /**< Reserved for future extension */ >+ int (*new_connection)(int vid); /**< Connect to socket. */ >+ void (*destroy_connection)(int vid); /**< Disconnect from socket */ I'm a little uncertain but my gut feeling is that in this context a connection is something between two sockets, not between devices. I would probably add these callbacks to struct vhost_user_socket. This is also where we keep the list of connections. regards, Jens