Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934038AbeAHPEH (ORCPT + 1 other); Mon, 8 Jan 2018 10:04:07 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:37520 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932121AbeAHPEG (ORCPT ); Mon, 8 Jan 2018 10:04:06 -0500 Subject: Re: [Xen-devel] [PATCH] xen-netfront: enable device after manual module load To: Eduardo Otubo , linux-kernel@vger.kernel.org Cc: jgross@suse.com, netdev@vger.kernel.org, xen-devel@lists.xenproject.org, mgamal@redhat.com, cavery@redhat.com, vkuznets@redhat.com References: <20180105084216.21719-1-otubo@redhat.com> From: Boris Ostrovsky Message-ID: <471397aa-7070-b4fe-991a-f35fa5d3b1f7@oracle.com> Date: Mon, 8 Jan 2018 10:03:55 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180105084216.21719-1-otubo@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8767 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801080217 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/05/2018 03:42 AM, Eduardo Otubo wrote: > 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 Reviewed-by: Boris Ostrovsky Should this go to stable trees as well? -boris > --- > 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: