]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
defer firewall updates to iptables data structures
authorPeter Feiner <peter@gridcentric.ca>
Wed, 24 Jul 2013 20:12:48 +0000 (20:12 +0000)
committerPeter Feiner <peter@gridcentric.ca>
Mon, 29 Jul 2013 14:23:19 +0000 (14:23 +0000)
commite31c9fd3fed661e850fb149bf3005051e3a7c7f8
treef144a0d9dab80155153025755ec4966eca4543db
parentca421e7e626f2f2e8fe2a3d567fa6f828dbff709
defer firewall updates to iptables data structures

One of two patches that fixes bug #1194438.

In the iptables firewall driver, each port method (update_port_filter,
prepare_port_filter, remove_port_filter) makes O(N) calls, where
N=len(firewall.ports), to IptablesManager methods that update dozens
of data structures. When the firewall methods are called in sequence,
e.g., by SecurityGroupAgentRpcMixin, the calls to IptablesManager's
methods start to add up.

This patch changes IptablesFirewallDriver to defer and coalesce calls
to IptablesManager. Now a sequence of M port method calls results in
O(N) calls to IptablesManager methods instead of O(N*M) as before.

Change-Id: If17eeaec197beae8b8aecffca1f19d4535a7226e
neutron/agent/linux/iptables_firewall.py
neutron/tests/unit/test_iptables_firewall.py