netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen-netfront: enable device after manual module load
@ 2018-01-05  8:42 Eduardo Otubo
  2018-01-08 15:03 ` [Xen-devel] " Boris Ostrovsky
  2018-01-08 19:17 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Eduardo Otubo @ 2018-01-05  8:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: netdev, xen-devel, jgross, boris.ostrovsky, vkuznets, mgamal,
	cavery

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 <otubo@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Xen-devel] [PATCH] xen-netfront: enable device after manual module load
  2018-01-05  8:42 [PATCH] xen-netfront: enable device after manual module load Eduardo Otubo
@ 2018-01-08 15:03 ` Boris Ostrovsky
  2018-01-08 19:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Ostrovsky @ 2018-01-08 15:03 UTC (permalink / raw)
  To: Eduardo Otubo, linux-kernel
  Cc: jgross, netdev, xen-devel, mgamal, cavery, vkuznets

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 <otubo@redhat.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

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:

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen-netfront: enable device after manual module load
  2018-01-05  8:42 [PATCH] xen-netfront: enable device after manual module load Eduardo Otubo
  2018-01-08 15:03 ` [Xen-devel] " Boris Ostrovsky
@ 2018-01-08 19:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-01-08 19:17 UTC (permalink / raw)
  To: otubo
  Cc: linux-kernel, netdev, xen-devel, jgross, boris.ostrovsky,
	vkuznets, mgamal, cavery

From: Eduardo Otubo <otubo@redhat.com>
Date: Fri,  5 Jan 2018 09:42:16 +0100

> 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 <otubo@redhat.com>

Applied, thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-08 19:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-05  8:42 [PATCH] xen-netfront: enable device after manual module load Eduardo Otubo
2018-01-08 15:03 ` [Xen-devel] " Boris Ostrovsky
2018-01-08 19:17 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).