Skip to contentSkip to conversation

Remove NETIF_F_NETNS_LOCAL from software devices.

RFC PATCH In review Rami Rosen 2 participants 6 messages Jan 7, 2013

Subsystems (4)
lore
Share & tools
lore

Rami Rosen

author
#0 lore raw

v2 cover Remove NETIF_F_NETNS_LOCAL from software devices.

When NETIF_F_NETNS_LOCAL feature is set in some network device, we do not allow this device to be moved from one network namespace to another (see dev_change_net_namespace()). Vlan device is not considered a local device and does not have the NETIF_F_NETNS_LOCAL feature. There is no reason that software devices like ppp and bridge will set the NETIF_F_NETNS_LOCAL feature. This patchset removes NETIF_F_NETNS_LOCAL from ppp and bridge devices.

* Changes from v1
Do not remove NETIF_F_NETNS_LOCAL from vxlan devices. Moving vxlan device to a different namesapce does not move the state of the UDP socket related to this vxlan device (Following Stephen Hemminger comment).

Rami Rosen (2):
[RFC PATCH v2 net-next 1/3] ppp: remove NETIF_F_NETNS_LOCAL from ppp
device features.
[RFC PATCH v2 net-next 2/3] bridge: remove NETIF_F_NETNS_LOCAL from
bridge device features.

 drivers/net/ppp/ppp_generic.c | 1 -
 net/bridge/br_device.c        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
Signature · 1 line
1.7.11.7
author
#1 lore raw

RFC PATCH v2 1/2 ppp: remove NETIF_F_NETNS_LOCAL from ppp device features.

There is no need for NETIF_F_NETNS_LOCAL for ppp device; this patch removes it.

---
 drivers/net/ppp/ppp_generic.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ppp/ppp_generic.c +0 -1
index 0b2706a..89b6fc5 100644
@@ -1073,7 +1073,6 @@ static void ppp_setup(struct net_device *dev)
 	dev->tx_queue_len = 3;
 	dev->type = ARPHRD_PPP;
 	dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
-	dev->features |= NETIF_F_NETNS_LOCAL;
 	dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
 }
 
Signature · 1 line
1.7.11.7
#2 lore raw

Re: [RFC PATCH v2 net-next 1/2] ppp: remove NETIF_F_NETNS_LOCAL from ppp device features.

Quoted 2 lines · Rami Rosen

There is no need for NETIF_F_NETNS_LOCAL for ppp device; this patch removes it.

At least pppoe_rcv_core assumes that the ppp socket and the network devices are all in the same network namespace. So it looks like NETIF_F_NETNS_LOCAL is needed.

Eric

Quoted 16 lines
---
 drivers/net/ppp/ppp_generic.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ppp/ppp_generic.c +0 -1
index 0b2706a..89b6fc5 100644
@@ -1073,7 +1073,6 @@ static void ppp_setup(struct net_device *dev)
 	dev->tx_queue_len = 3;
 	dev->type = ARPHRD_PPP;
 	dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
-	dev->features |= NETIF_F_NETNS_LOCAL;
 	dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
 }
author
#3 lore raw

RFC PATCH v2 2/2 bridge: remove NETIF_F_NETNS_LOCAL from bridge device features.

In reply to Rami Rosen

There is no need for NETIF_F_NETNS_LOCAL for bridge device; this patch removes it.

---
 net/bridge/br_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_device.c +1 -1
index e1bc090..0f88d21 100644
@@ -344,7 +344,7 @@ void br_dev_setup(struct net_device *dev)
 
 	dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
 			NETIF_F_GSO_MASK | NETIF_F_HW_CSUM | NETIF_F_LLTX |
-			NETIF_F_NETNS_LOCAL | NETIF_F_HW_VLAN_TX;
+			NETIF_F_HW_VLAN_TX;
 	dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
 			   NETIF_F_GSO_MASK | NETIF_F_HW_CSUM |
 			   NETIF_F_HW_VLAN_TX;
Signature · 1 line
1.7.11.7
#4 lore raw

Re: [RFC PATCH v2 net-next 2/2] bridge: remove NETIF_F_NETNS_LOCAL from bridge device features.

Quoted 2 lines · Rami Rosen

There is no need for NETIF_F_NETNS_LOCAL for bridge device; this patch removes it.

At the very least add_del_if assumes are network devices are in the same network namespace as the bridge. So removing NETIF_F_NETNS_LOCAL is not safe.

Eric

#5 lore raw
In reply to Rami Rosen
Quoted 7 lines · Rami Rosen

When NETIF_F_NETNS_LOCAL feature is set in some network device, we do not allow this device to be moved from one network namespace to another (see dev_change_net_namespace()). Vlan device is not considered a local device and does not have the NETIF_F_NETNS_LOCAL feature. There is no reason that software devices like ppp and bridge will set the NETIF_F_NETNS_LOCAL feature. This patchset removes NETIF_F_NETNS_LOCAL from ppp and bridge devices.

After you saw the case for vxlan I am disappointed you respun this patchset without asking the question: Could other devices suffer from the same class of problem.

It didn't take me more than a few minutes of looking to see that the bridge and the ppp network device have the same class of issue as vxlan.

Quoted 14 lines

* Changes from v1
Do not remove NETIF_F_NETNS_LOCAL from vxlan devices. Moving vxlan device to a different namesapce does not move the state of the UDP socket related to this vxlan device (Following Stephen Hemminger comment).

Rami Rosen (2):
[RFC PATCH v2 net-next 1/3] ppp: remove NETIF_F_NETNS_LOCAL from ppp
device features.
[RFC PATCH v2 net-next 2/3] bridge: remove NETIF_F_NETNS_LOCAL from
bridge device features.

 drivers/net/ppp/ppp_generic.c | 1 -
 net/bridge/br_device.c        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)