]> 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)
committerCarl Baldwin <carl.baldwin@hp.com>
Tue, 4 Mar 2014 17:55:53 +0000 (17:55 +0000)
commit2541ff7cad19941b62dace7e9951a56a16e53f3e
treec59e4b55b8cda18e79ac77adb1ae23a008d24bcf
parentfe76c155fd7c3b5b6b4fd4abb6867525b84ca2cb
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