2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

rtnetlink: ignore IFLA_WIRELESS events.

Some older wireless drivers - ones relying on the
old and long deprecated wireless extension ioctl
system - can generate quite a bit of IFLA_WIRELESS
events depending on their configuration and
runtime conditions. These are delivered as
RTNLGRP_LINK via RTM_NEWLINK messages.

These tend to be relatively easily identifiable
because they report the change mask being 0. This
isn't guaranteed but in practice it shouldn't be a
problem. None of the wireless events that I ever
observed actually carry any unique information
about netdev states that ovs-vswitchd is
interested in. Hence ignoring these shouldn't
cause any problems.

These events can be responsible for a significant
CPU churn as ovs-vswitchd attempts to do plenty of
work for each and every netlink message regardless
of what that message carries. On low-end devices
such as consumer-grade routers these can lead to a
lot of CPU cycles being wasted, adding up to heat
output and reducing performance.

It could be argued that wireless drivers in
question should be fixed, but that isn't exactly a
trivial thing to do. Patching ovs seems far more
viable while still making sense.

Signed-off-by: Michal Kazior <michal@plume.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Michal Kazior
2021-03-04 15:32:54 +00:00
committed by Ilya Maximets
parent f9d3039039
commit d90b4f2928
5 changed files with 35 additions and 2 deletions

View File

@@ -742,7 +742,7 @@ netdev_linux_run(const struct netdev_class *netdev_class OVS_UNUSED)
if (!error) {
struct rtnetlink_change change;
if (rtnetlink_parse(&buf, &change)) {
if (rtnetlink_parse(&buf, &change) && !change.irrelevant) {
struct netdev *netdev_ = NULL;
char dev_name[IFNAMSIZ];
@@ -6344,6 +6344,7 @@ netdev_linux_update_via_netlink(struct netdev_linux *netdev)
}
if (rtnetlink_parse(reply, change)
&& !change->irrelevant
&& change->nlmsg_type == RTM_NEWLINK) {
bool changed = false;
error = 0;