]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Avoid unnecessarily checking the existence of a device
authorCarl Baldwin <carl.baldwin@hp.com>
Thu, 16 Jan 2014 21:12:23 +0000 (21:12 +0000)
committerThomas Goirand <thomas@goirand.fr>
Thu, 13 Mar 2014 07:20:44 +0000 (15:20 +0800)
commit80c521c6d86be2f83cf6e41916083bf86cd51386
tree878f1b95339f666c540495d6c5011c80b3573ff9
parentf071c0766b64e7dc65ed86accc88335b42aa41eb
Avoid unnecessarily checking the existence of a device

Plugging a device usually involves checking for the existence of the
device twice, once before calling plug and once after.  It turns out
that these calls are expensive, often taking a half second or more
each.  For that reason, it is worth the effort to make sure we check
only once.

The device driver is now responsible for cleanly plugging/unplugging
the device without knowing whether it exists or not.  Pushing this
responsibility to the device driver allows implementing it more
efficiently in terms of calls made out to the operating system.

This is targetted at the neutron-tempest-parallel bp because it shaves
time off the time to set up a router, something that hinders parallel
performance.

Change-Id: I391fafe68b76e1c620d2b25e8613ba507fd25dfd
Partial-Bug: #1287824
neutron/agent/l3_agent.py
neutron/agent/linux/interface.py
neutron/tests/unit/test_l3_agent.py
neutron/tests/unit/test_linux_interface.py