rtnetlink: Cleanup user notifications for netdev events
Subsystems (2)
v2 cover rtnetlink: Cleanup user notifications for netdev events
Vlad's recent patch to add the event type to rtnetlink notifications points out a number of redundant or unnecessary notifications sent to userspace for events that are essentially internal to the kernel. Trim the list to put a dent in the notification storm.
v2
- rebased to top of net-next with IFLA_EVENT patch reverted
- dropped removal NETDEV_CHANGEINFODATA since it is intentionally only to send a message to userspace
- dropped NOTIFY_PEERS since Vlad's says it is needed for macvlans
- add patches to remove NETDEV_CHANGEUPPER and NETDEV_CHANGE_TX_QUEUE_LEN from the event list
David Ahern (8):
rtnetlink: Do not generate notifications for MTU events
rtnetlink: Do not generate notification for UDP_TUNNEL_PUSH_INFO
rtnetlink: Do not generate notifications for CHANGEADDR event
rtnetlink: Do not generate notifications for POST_TYPE_CHANGE event
rtnetlink: Do not generate notifications for PRECHANGEUPPER event
rtnetlink: Do not generate notifications for CHANGELOWERSTATE event
rtnetlink: Do not generate notifications for NETDEV_CHANGEUPPER event
rtnetlink: Do not generate notifications for
NETDEV_CHANGE_TX_QUEUE_LEN event
net/core/rtnetlink.c | 9 --------- 1 file changed, 9 deletions(-)
Signature · 1 line
2.1.4
PATCH v2 1/8 rtnetlink: Do not generate notifications for MTU events
Changing MTU on a link currently causes 3 messages to be sent to userspace:
[LINK]11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1490 qdisc noqueue state UNKNOWN group default
link/ether f2:52:5c:6d:21:f3 brd ff:ff:ff:ff:ff:ff
[LINK]11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
link/ether f2:52:5c:6d:21:f3 brd ff:ff:ff:ff:ff:ff
[LINK]11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
link/ether f2:52:5c:6d:21:f3 brd ff:ff:ff:ff:ff:ff
Remove the messages sent for PRE_CHANGE_MTU and CHANGE_MTU netdev events.
--- net/core/rtnetlink.c | 2 -- 1 file changed, 2 deletions(-)
net/core/rtnetlink.c +0 -2
@@ -4117,7 +4117,6 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voiswitch (event) {case NETDEV_REBOOT : -case NETDEV_CHANGEMTU :case NETDEV_CHANGEADDR :case NETDEV_CHANGENAME :case NETDEV_FEAT_CHANGE :
@@ -4126,7 +4125,6 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voicase NETDEV_NOTIFY_PEERS :case NETDEV_CHANGEUPPER :case NETDEV_RESEND_IGMP : -case NETDEV_PRECHANGEMTU :case NETDEV_CHANGEINFODATA :case NETDEV_PRECHANGEUPPER :case NETDEV_CHANGELOWERSTATE :
Signature · 1 line
2.1.4
PATCH v2 2/8 rtnetlink: Do not generate notification for UDP_TUNNEL_PUSH_INFO
In reply to David AhernNETDEV_UDP_TUNNEL_PUSH_INFO is an internal notifier; nothing userspace can do so don't generate a netlink notification.
--- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-)
net/core/rtnetlink.c +0 -1
@@ -4128,7 +4128,6 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voicase NETDEV_CHANGEINFODATA :case NETDEV_PRECHANGEUPPER :case NETDEV_CHANGELOWERSTATE : -case NETDEV_UDP_TUNNEL_PUSH_INFO :case NETDEV_CHANGE_TX_QUEUE_LEN :rtmsg_ifinfo (RTM_NEWLINK , dev,0 ,GFP_KERNEL );break ;
Signature · 1 line
2.1.4
PATCH v2 3/8 rtnetlink: Do not generate notifications for CHANGEADDR event
In reply to David AhernChanging hardware address generates redundant messages:
[LINK]11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
[LINK]11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
Do not send a notification for the CHANGEADDR notifier.
--- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-)
net/core/rtnetlink.c +0 -1
@@ -4117,7 +4117,6 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voiswitch (event) {case NETDEV_REBOOT : -case NETDEV_CHANGEADDR :case NETDEV_CHANGENAME :case NETDEV_FEAT_CHANGE :case NETDEV_BONDING_FAILOVER :
Signature · 1 line
2.1.4
PATCH v2 4/8 rtnetlink: Do not generate notifications for POST_TYPE_CHANGE event
In reply to David AhernChanging the master device for a link generates many messages; the one generated for POST_TYPE_CHANGE is redundant:
[LINK]11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master br1 state UNKNOWN group default
link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ff
[LINK]11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master br1 state UNKNOWN group default
link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ffRemove POST_TYPE_CHANGE from the list of notifiers that generate notifications.
--- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-)
net/core/rtnetlink.c +0 -1
@@ -4120,7 +4120,6 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voicase NETDEV_CHANGENAME :case NETDEV_FEAT_CHANGE :case NETDEV_BONDING_FAILOVER : -case NETDEV_POST_TYPE_CHANGE :case NETDEV_NOTIFY_PEERS :case NETDEV_CHANGEUPPER :case NETDEV_RESEND_IGMP :
Signature · 1 line
2.1.4
PATCH v2 5/8 rtnetlink: Do not generate notifications for PRECHANGEUPPER event
In reply to David AhernPRECHANGEUPPER is an internal event; do not generate userspace notifications.
--- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-)
net/core/rtnetlink.c +0 -1
@@ -4124,7 +4124,6 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voicase NETDEV_CHANGEUPPER :case NETDEV_RESEND_IGMP :case NETDEV_CHANGEINFODATA : -case NETDEV_PRECHANGEUPPER :case NETDEV_CHANGELOWERSTATE :case NETDEV_CHANGE_TX_QUEUE_LEN :rtmsg_ifinfo (RTM_NEWLINK , dev,0 ,GFP_KERNEL );
Signature · 1 line
2.1.4
PATCH v2 6/8 rtnetlink: Do not generate notifications for CHANGELOWERSTATE event
In reply to David AhernCHANGELOWERSTATE is an internal event; do not generate userspace notifications.
--- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-)
net/core/rtnetlink.c +0 -1
@@ -4124,7 +4124,6 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voicase NETDEV_CHANGEUPPER :case NETDEV_RESEND_IGMP :case NETDEV_CHANGEINFODATA : -case NETDEV_CHANGELOWERSTATE :case NETDEV_CHANGE_TX_QUEUE_LEN :rtmsg_ifinfo (RTM_NEWLINK , dev,0 ,GFP_KERNEL );break ;
Signature · 1 line
2.1.4
PATCH v2 7/8 rtnetlink: Do not generate notifications for NETDEV_CHANGEUPPER event
In reply to David AhernNETDEV_CHANGEUPPER is an internal event; do not generate userspace notifications.
--- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-)
net/core/rtnetlink.c +0 -1
@@ -4121,7 +4121,6 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voicase NETDEV_FEAT_CHANGE :case NETDEV_BONDING_FAILOVER :case NETDEV_NOTIFY_PEERS : -case NETDEV_CHANGEUPPER :case NETDEV_RESEND_IGMP :case NETDEV_CHANGEINFODATA :case NETDEV_CHANGE_TX_QUEUE_LEN :
Signature · 1 line
2.1.4
PATCH v2 8/8 rtnetlink: Do not generate notifications for NETDEV_CHANGE_TX_QUEUE_LEN event
In reply to David AhernChanging tx queue length generates identical messages:
[LINK]22: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
link/ether 02:04:f4:b7:5c:d2 brd ff:ff:ff:ff:ff:ff promiscuity 0
dummy numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
[LINK]22: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
link/ether 02:04:f4:b7:5c:d2 brd ff:ff:ff:ff:ff:ff promiscuity 0
dummy numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
Remove NETDEV_CHANGE_TX_QUEUE_LEN from the list of notifiers that generate notifications.
--- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-)
net/core/rtnetlink.c +0 -1
@@ -4123,7 +4123,6 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voicase NETDEV_NOTIFY_PEERS :case NETDEV_RESEND_IGMP :case NETDEV_CHANGEINFODATA : -case NETDEV_CHANGE_TX_QUEUE_LEN :rtmsg_ifinfo (RTM_NEWLINK , dev,0 ,GFP_KERNEL );break ;default :
Signature · 1 line
2.1.4
David Miller
maintainerFrom: David Ahern <[email protected]>
Date: Tue, 11 Apr 2017 17:02:39 -0700
Quoted 5 lines
Vlad's recent patch to add the event type to rtnetlink notifications points out a number of redundant or unnecessary notifications sent to userspace for events that are essentially internal to the kernel. Trim the list to put a dent in the notification storm.
Quoted 7 lines
v2
- rebased to top of net-next withIFLA_EVENTpatch reverted
- dropped removalNETDEV_CHANGEINFODATAsince it is intentionally only to send a message to userspace
- droppedNOTIFY_PEERSsince Vlad's says it is needed for macvlans
- add patches to removeNETDEV_CHANGEUPPERandNETDEV_CHANGE_TX_QUEUE_LENfrom the event list
Series applied, thanks David.