netdev: Globally track port status changes
authorJoe Stringer <joestringer@nicira.com>
Fri, 13 Dec 2013 03:33:46 +0000 (03:33 +0000)
committerEthan Jackson <ethan@nicira.com>
Thu, 12 Dec 2013 23:03:19 +0000 (15:03 -0800)
commitda4a619179d6d6e9e6a82977c41cfcc2d1533ad8
tree22fd2aa4e22f381d2a0861be943a317629aa04c5
parent2ffe6042ad994ec5428922370052b0ed13923c9a
netdev: Globally track port status changes

Previously, we tracked status changes for ofports on a per-device basis.
Each time in the main thread's loop, we would inspect every ofport
to determine whether the status had changed for corresponding devices.

This patch replaces the per-netdev change_seq with a global 'struct seq'
which tracks status change for all ports. In the average case where
ports are not constantly going up or down, this allows us to check the
sequence once per main loop and not poll any ports. In the worst case,
execution is expected to be similar to how it is currently.

In a test environment of 5000 internal ports and 50 tunnel ports with
bfd, this reduces average CPU usage of the main thread from about 40% to
about 35%.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
14 files changed:
lib/automake.mk
lib/connectivity.c [new file with mode: 0644]
lib/connectivity.h [new file with mode: 0644]
lib/netdev-bsd.c
lib/netdev-dummy.c
lib/netdev-linux.c
lib/netdev-provider.h
lib/netdev-vport.c
lib/netdev.c
lib/netdev.h
ofproto/bond.c
ofproto/ofproto-provider.h
ofproto/ofproto.c
ofproto/tunnel.c