From patchwork Fri Jan 4 14:34:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Garzarella X-Patchwork-Id: 1020742 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43WS3H4QHxz9s3l for ; Sat, 5 Jan 2019 01:34:19 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726680AbfADOeQ (ORCPT ); Fri, 4 Jan 2019 09:34:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33082 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbfADOeQ (ORCPT ); Fri, 4 Jan 2019 09:34:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B3B5A787F; Fri, 4 Jan 2019 14:34:16 +0000 (UTC) Received: from steredhat.redhat.com (ovpn-116-240.ams2.redhat.com [10.36.116.240]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA4AA100194A; Fri, 4 Jan 2019 14:34:12 +0000 (UTC) From: Stefano Garzarella To: netdev@vger.kernel.org Cc: davem@davemloft.net, stefanha@redhat.com Subject: [PATCH RFC v2 0/2] vsock/virtio: fix issues on device hot-unplug Date: Fri, 4 Jan 2019 15:34:09 +0100 Message-Id: <20190104143411.95519-1-sgarzare@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 04 Jan 2019 14:34:16 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org These patches try to handle the hot-unplug of vsock virtio transport device in a proper way. Maybe move the vsock_core_init()/vsock_core_exit() functions in the module_init and module_exit of vsock_virtio_transport module can't be the best way, but the architecture of vsock_core forces us to this approach for now. The vsock_core proto_ops expect a valid pointer to the transport device, so we can't call vsock_core_exit() until there are open sockets. Another (little more complex) approach during the device removal, could be to unregister the AF_VSOCK protocol, then reset all sockets and wait for their destruction. At this point, we can set the transport pointer to NULL. Any suggestions would be helpful. v1 -> v2: - Fixed commit message of patch 1. Stefano Garzarella (2): vsock/virtio: fix kernel panic after device hot-unplug vsock/virtio: reset connected sockets on device removal net/vmw_vsock/virtio_transport.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-)