diff options
author | Darragh O'Reilly <darragh.oreilly@hp.com> | 2014-11-17 10:20:58 +0000 |
---|---|---|
committer | Dave Walker <email@daviey.com> | 2014-11-25 14:55:47 +0000 |
commit | 56b0029014ff7e844c2fde45f7b52b7f115757e8 (patch) | |
tree | 050254870281b03e25b6a95067221effd072653b | |
parent | 463eb73e2a99ad1af2c1f8bba466654b6468af5b (diff) | |
download | neutron-56b0029014ff7e844c2fde45f7b52b7f115757e8.tar.gz |
linuxbridge-agent: make vxlan unicast check more efficent
A list with the full range of vxlan VNIs (1 to 2**24) was using
over 300MB of memory. This patch uses xrange instead of range.
Closes-Bug: #1393362
Change-Id: I21ccab758e7911712690fd5e732f64361e809264
(cherry picked from commit 0bf69ad80fb77773e767e116357cf6e1666b3f5d)
-rwxr-xr-x | neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py b/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py index 8011c0d4bd..d9f7f686f5 100755 --- a/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py +++ b/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py @@ -27,6 +27,7 @@ import eventlet eventlet.monkey_patch() from oslo.config import cfg +from six import moves from neutron.agent import l2population_rpc as l2pop_rpc from neutron.agent.linux import ip_lib @@ -523,7 +524,7 @@ class LinuxBridgeManager: 'command': 'bridge fdb', 'mode': 'VXLAN UCAST'}) return False - for segmentation_id in range(1, constants.MAX_VXLAN_VNI + 1): + for segmentation_id in moves.xrange(1, constants.MAX_VXLAN_VNI + 1): if not ip_lib.device_exists( self.get_vxlan_device_name(segmentation_id)): break |