Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751416AbeAEImi (ORCPT + 1 other); Fri, 5 Jan 2018 03:42:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36706 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbeAEImh (ORCPT ); Fri, 5 Jan 2018 03:42:37 -0500 From: Eduardo Otubo To: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org, xen-devel@lists.xenproject.org, jgross@suse.com, boris.ostrovsky@oracle.com, vkuznets@redhat.com, mgamal@redhat.com, cavery@redhat.com Subject: [PATCH] xen-netfront: enable device after manual module load Date: Fri, 5 Jan 2018 09:42:16 +0100 Message-Id: <20180105084216.21719-1-otubo@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 05 Jan 2018 08:42:37 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: When loading the module after unloading it, the network interface would not be enabled and thus wouldn't have a backend counterpart and unable to be used by the guest. The guest would face errors like: [root@guest ~]# ethtool -i eth0 Cannot get driver information: No such device [root@guest ~]# ifconfig eth0 eth0: error fetching interface information: Device not found This patch initializes the state of the netfront device whenever it is loaded manually, this state would communicate the netback to create its device and establish the connection between them. Signed-off-by: Eduardo Otubo --- drivers/net/xen-netfront.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index c5a34671abda..9bd7ddeeb6a5 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -1326,6 +1326,7 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev) netif_carrier_off(netdev); + xenbus_switch_state(dev, XenbusStateInitialising); return netdev; exit: -- 2.14.3