Skip to contentSkip to conversation

net: call notifiers for mtu change even if iface is not up

PATCH Applied Jiri Pirko 3 participants 7 messages Dec 3, 2012 – Dec 7, 2012

Subsystems (2)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 net: call notifiers for mtu change even if iface is not up

Do the same thing as in set mac. Call notifiers every time.

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +1 -1
index 2f94df2..0685a72 100644
@@ -4971,7 +4971,7 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
 	else
 		dev->mtu = new_mtu;
 
-	if (!err && dev->flags & IFF_UP)
+	if (!err)
 		call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
 	return err;
 }
Signature · 1 line
1.8.0
#1 lore raw
Quoted 12 lines · Jiri Pirko

Do the same thing as in set mac. Call notifiers every time.

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +0 -0
index 2f94df2..0685a72 100644

net/core/dev.c int dev_set_mtu(struct net_device *dev, int new_mtu) · line 4977

Quoted 8 lines
net/core/dev.c +1 -1
@@ -4971,7 +4971,7 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
 	else
 		dev->mtu = new_mtu;
 
-	if (!err && dev->flags & IFF_UP)
+	if (!err)
 		call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
 	return err;
 }

I'm not opposed to this change, but is there something that it expressly fixes? While it doesn't hurt to send around mtu change events, one would presume that listeners would pick up mtu changes when the NETDEV_UP event went' around.

Neil

author
#2 lore raw
Quoted 16 lines · Mon, Dec 03, 2012 at 03:18:23PM CET, [email protected] wrote:
Quoted 15 lines · Jiri Pirko

Do the same thing as in set mac. Call notifiers every time.

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +0 -0
index 2f94df2..0685a72 100644
@@ -4971,7 +4971,7 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
 	else
 		dev->mtu = new_mtu;
 
Quoted 7 lines

net/core/dev.c int dev_set_mtu(struct net_device *dev, int new_mtu) · line 4977

Quoted 5 lines
net/core/dev.c +1 -1
-	if (!err && dev->flags & IFF_UP)
+	if (!err)
 		call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
 	return err;
 }

I'm not opposed to this change, but is there something that it expressly fixes?

This is about a consistency. To have the same behaviour as set_mac for example.

Quoted 9 lines

While it doesn't hurt to send around mtu change events, one would presume that listeners would pick up mtu changes when the NETDEV_UP event went' around.

Neil

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 25 lines · Jiri Pirko
Quoted 16 lines · Mon, Dec 03, 2012 at 03:18:23PM CET, [email protected] wrote:
Quoted 15 lines · Jiri Pirko

Do the same thing as in set mac. Call notifiers every time.

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +0 -0
index 2f94df2..0685a72 100644
@@ -4971,7 +4971,7 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
 	else
 		dev->mtu = new_mtu;
 
Quoted 7 lines

net/core/dev.c int dev_set_mtu(struct net_device *dev, int new_mtu) · line 4977

Quoted 5 lines
net/core/dev.c +1 -1
-	if (!err && dev->flags & IFF_UP)
+	if (!err)
 		call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
 	return err;
 }

I'm not opposed to this change, but is there something that it expressly fixes?

Quoted 8 lines

This is about a consistency. To have the same behaviour as set_mac for example.

Quoted 5 lines

While it doesn't hurt to send around mtu change events, one would presume that listeners would pick up mtu changes when the NETDEV_UP event went' around.

Neil

I figured, I just wanted to be sure that there wasn't a bug fix that needed documenting in the changelog, or that listeners for this event didn't expect the interface to already be up. It looks pretty clean, with the exception of the TIPC protocol. It appears that it might require enable_bearer to be called prior to any netdevice CHANGEMTU events, so that the eth_bearers array gets filled out, and it looks like that has to get triggered either by user space, or the receipt of a message over the network. Let me know what you think

Neil

Quoted 9 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#4 lore raw
Quoted 34 lines · Mon, Dec 03, 2012 at 04:22:50PM CET, [email protected] wrote:
Quoted 25 lines · Jiri Pirko
Quoted 16 lines · Mon, Dec 03, 2012 at 03:18:23PM CET, [email protected] wrote:
Quoted 15 lines · Jiri Pirko

Do the same thing as in set mac. Call notifiers every time.

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +0 -0
index 2f94df2..0685a72 100644
@@ -4971,7 +4971,7 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
 	else
 		dev->mtu = new_mtu;
 
Quoted 7 lines

net/core/dev.c int dev_set_mtu(struct net_device *dev, int new_mtu) · line 4977

Quoted 5 lines
net/core/dev.c +1 -1
-	if (!err && dev->flags & IFF_UP)
+	if (!err)
 		call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
 	return err;
 }

I'm not opposed to this change, but is there something that it expressly fixes?

Quoted 8 lines

This is about a consistency. To have the same behaviour as set_mac for example.

Quoted 5 lines

While it doesn't hurt to send around mtu change events, one would presume that listeners would pick up mtu changes when the NETDEV_UP event went' around.

Neil

Quoted 7 lines

I figured, I just wanted to be sure that there wasn't a bug fix that needed documenting in the changelog, or that listeners for this event didn't expect the interface to already be up. It looks pretty clean, with the exception of the TIPC protocol. It appears that it might require enable_bearer to be called prior to any netdevice CHANGEMTU events, so that the eth_bearers array gets filled out, and it looks like that has to get triggered either by user space, or the receipt of a message over the network. Let me know what you think

I'm looking at the code. What is the difference between CHANGEMTU and CHANGEADDR here? It looks to me that it should work for both in the same way.

Quoted 12 lines

Neil

Quoted 9 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by
#5 lore raw
Quoted 43 lines · Jiri Pirko
Quoted 34 lines · Mon, Dec 03, 2012 at 04:22:50PM CET, [email protected] wrote:
Quoted 25 lines · Jiri Pirko
Quoted 16 lines · Mon, Dec 03, 2012 at 03:18:23PM CET, [email protected] wrote:
Quoted 15 lines · Jiri Pirko

Do the same thing as in set mac. Call notifiers every time.

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +0 -0
index 2f94df2..0685a72 100644
@@ -4971,7 +4971,7 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
 	else
 		dev->mtu = new_mtu;
 
Quoted 7 lines

net/core/dev.c int dev_set_mtu(struct net_device *dev, int new_mtu) · line 4977

Quoted 5 lines
net/core/dev.c +1 -1
-	if (!err && dev->flags & IFF_UP)
+	if (!err)
 		call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
 	return err;
 }

I'm not opposed to this change, but is there something that it expressly fixes?

Quoted 8 lines

This is about a consistency. To have the same behaviour as set_mac for example.

Quoted 5 lines

While it doesn't hurt to send around mtu change events, one would presume that listeners would pick up mtu changes when the NETDEV_UP event went' around.

Neil

Quoted 7 lines

I figured, I just wanted to be sure that there wasn't a bug fix that needed documenting in the changelog, or that listeners for this event didn't expect the interface to already be up. It looks pretty clean, with the exception of the TIPC protocol. It appears that it might require enable_bearer to be called prior to any netdevice CHANGEMTU events, so that the eth_bearers array gets filled out, and it looks like that has to get triggered either by user space, or the receipt of a message over the network. Let me know what you think

Quoted 4 lines

I'm looking at the code. What is the difference between CHANGEMTU and CHANGEADDR here? It looks to me that it should work for both in the same way.

Hmm, they do work in the same way, which likely means that tipc is probably begging to oops there regardless of having your patch or not :)

I'll get around to fixing that shortly. Since your patch then isn't going to break anything that isn't already broken

Quoted 14 lines
Quoted 13 lines

Neil

Quoted 9 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Applied
#6 lore raw

From: Neil Horman <[email protected]>
Date: Fri, 7 Dec 2012 10:07:08 -0500

Quoted 8 lines · Jiri Pirko
Quoted 7 lines
Quoted 6 lines · Mon, Dec 03, 2012 at 04:22:50PM CET, [email protected] wrote:
Quoted 5 lines · Jiri Pirko
Quoted 4 lines · Mon, Dec 03, 2012 at 03:18:23PM CET, [email protected] wrote:
Quoted 3 lines · Jiri Pirko

Do the same thing as in set mac. Call notifiers every time.

...

Quoted 1 line

Applied.