Skip to contentSkip to conversation

xen-netfront: enable device after manual module load

PATCH Applied Eduardo Otubo 3 participants 5 messages Jan 5, 2018 – Jan 8, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen-netfront: enable device after manual module load

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.

---
 drivers/net/xen-netfront.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/xen-netfront.c +1 -0
index c5a34671abda..9bd7ddeeb6a5 100644
@@ -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:
Signature · 1 line
2.14.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Eduardo Otubo

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

Quoted 8 lines

[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.

Should this go to stable trees as well?

-boris

Quoted 16 lines
---
 drivers/net/xen-netfront.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/xen-netfront.c +1 -0
index c5a34671abda..9bd7ddeeb6a5 100644
@@ -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:
Reviewed-by on v1 1/1
#2 lore raw
In reply to Eduardo Otubo
Quoted 9 lines · Eduardo Otubo

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

Quoted 8 lines

[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.

Should this go to stable trees as well?

-boris

Quoted 9 lines
---
 drivers/net/xen-netfront.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/xen-netfront.c +0 -0
index c5a34671abda..9bd7ddeeb6a5 100644

drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1332

Quoted 7 lines
drivers/net/xen-netfront.c +1 -0
@@ -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:

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

maintainer Applied
#3 lore raw
In reply to Eduardo Otubo

From: Eduardo Otubo <[email protected]>
Date: Fri, 5 Jan 2018 09:42:16 +0100

Quoted 9 lines

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

Quoted 8 lines

[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.

Applied, thank you.

maintainer Applied
#4 lore raw
In reply to Eduardo Otubo

From: Eduardo Otubo <[email protected]>
Date: Fri, 5 Jan 2018 09:42:16 +0100

Quoted 9 lines

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

Quoted 8 lines

[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.

Applied, thank you.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel