ofproto-dpif-monitor: Use heap to order the mport wakeup time.
authorAlex Wang <alexw@nicira.com>
Wed, 16 Oct 2013 03:32:34 +0000 (03:32 +0000)
committerEthan Jackson <ethan@nicira.com>
Thu, 17 Oct 2013 01:08:05 +0000 (18:08 -0700)
commit307464a116abb27d2b66089afe0f9f39fb0ebe9b
treec78f5607585a629ee4b877aa26c3789a730dde3c
parent526d174aaba5f3aa99e4294e89ca41cce96dbd35
ofproto-dpif-monitor: Use heap to order the mport wakeup time.

Before this commit, each time ofproto-dpif-monitor thread wakes up,
all monitored ports will be iterated over.  This adds a huge overhead
to the monitor thread.  This commit uses a heap to order the wakeup
time of monitored ports.  So each time the monitor thread is waken up,
it will only iterate those monitored ports that have timed out.

This commit greatly increases the number of monitored interfaces
openvswitch could support.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofproto/ofproto-dpif-monitor.c