Merge "Add support for pmd auto balance parameters in open_vswitch"

This commit is contained in:
Zuul 2021-06-01 23:24:54 +00:00 committed by Gerrit Code Review
commit 3686b38145
6 changed files with 121 additions and 0 deletions

View File

@ -95,6 +95,34 @@ Role Defaults
- **Default**: ``false`` - **Default**: ``false``
- **Examples**: ``true`` - **Examples**: ``true``
- ``tripleo_ovs_dpdk_pmd_load_threshold``
- **Description**: (*Optional*) Minimum PMD thread load threshold, in range
0 to 100. Its a string with a number, specifies the minimum
PMD thread load threshold (% of used cycles) of any non-isolated PMD threads
when a PMD Auto Load Balance may be triggered.
- **Default**: ``''``
- **Examples**: ``'50'``
- ``tripleo_ovs_dpdk_pmd_improvement_threshold``
- **Description**: (*Optional*) PMD load variance improvement threshold, in range
0 to 100. Its a string with a number, specifies the minimum evaluated % improvement
in load distribution across the non-isolated PMD threads that will allow
a PMD Auto Load Balance to occur.
Note, setting this parameter to 0 will always allow an auto load balance to occur
regardless of estimated improvement or not.
- **Default**: ``''``
- **Examples**: ``'10'``
- ``tripleo_ovs_dpdk_pmd_rebal_interval``
- **Description**: (*Optional*) PMD auto load balancing interval, in range
0 to 20,000. Its a string with a number, specifies the minimum time (in minutes)
between 2 consecutive PMD Auto Load Balancing iterations. The defaul value is 1 min.
- **Default**: ``''``
- **Examples**: ``'5'``
Modules Modules
------- -------

View File

@ -29,3 +29,6 @@ tripleo_ovs_dpdk_handler_cores: ""
tripleo_ovs_dpdk_emc_insertion_probablity: "" tripleo_ovs_dpdk_emc_insertion_probablity: ""
tripleo_ovs_dpdk_enable_tso: false tripleo_ovs_dpdk_enable_tso: false
tripleo_ovs_dpdk_pmd_auto_lb: false tripleo_ovs_dpdk_pmd_auto_lb: false
tripleo_ovs_dpdk_pmd_load_threshold: ""
tripleo_ovs_dpdk_pmd_improvement_threshold: ""
tripleo_ovs_dpdk_pmd_rebal_interval: ""

View File

@ -75,3 +75,18 @@ def test_positive_emc_prob(host):
def test_positive_enable_tso(host): def test_positive_enable_tso(host):
other_config = get_config(host) other_config = get_config(host)
assert 'userspace-tso-enable' not in other_config assert 'userspace-tso-enable' not in other_config
def test_positive_pmd_load_threshold(host):
other_config = get_config(host)
assert 'pmd-auto-lb-load-threshold' not in other_config
def test_positive_pmd_improvement_threshold(host):
other_config = get_config(host)
assert 'pmd-auto-lb-improvement-threshold' not in other_config
def test_positive_pmd_rebal_interval(host):
other_config = get_config(host)
assert 'pmd-auto-lb-rebal-interval' not in other_config

View File

@ -31,3 +31,6 @@
tripleo_ovs_dpdk_handler_cores: 2 tripleo_ovs_dpdk_handler_cores: 2
tripleo_ovs_dpdk_emc_insertion_probablity: 0 tripleo_ovs_dpdk_emc_insertion_probablity: 0
tripleo_ovs_dpdk_enable_tso: true tripleo_ovs_dpdk_enable_tso: true
tripleo_ovs_dpdk_pmd_load_threshold: 50
tripleo_ovs_dpdk_pmd_improvement_threshold: 10
tripleo_ovs_dpdk_pmd_rebal_interval: 5

View File

@ -80,3 +80,21 @@ def test_positive_enable_tso(host):
other_config = get_config(host) other_config = get_config(host)
tso_enabled = other_config['userspace-tso-enable'].replace('"', '') tso_enabled = other_config['userspace-tso-enable'].replace('"', '')
assert tso_enabled == "true" assert tso_enabled == "true"
def test_positive_pmd_load_threshold(host):
other_config = get_config(host)
pmd_load_threshold = other_config['pmd-auto-lb-load-threshold'].replace('"', '')
assert pmd_load_threshold == "50"
def test_positive_pmd_improvement_threshold(host):
other_config = get_config(host)
pmd_improvement_threshold = other_config['pmd-auto-lb-improvement-threshold'].replace('"', '')
assert pmd_improvement_threshold == "10"
def test_positive_pmd_rebal_interval(host):
other_config = get_config(host)
pmd_rebal_interval = other_config['pmd-auto-lb-rebal-interval'].replace('"', '')
assert pmd_rebal_interval == "5"

View File

@ -161,3 +161,57 @@
col: other_config col: other_config
key: pmd-auto-lb key: pmd-auto-lb
when: not tripleo_ovs_dpdk_pmd_auto_lb|bool when: not tripleo_ovs_dpdk_pmd_auto_lb|bool
- name: Set minimum PMD thread load threshold
openvswitch_db:
table: open_vswitch
record: .
col: other_config
key: pmd-auto-lb-load-threshold
value: "{{ tripleo_ovs_dpdk_pmd_load_threshold }}"
when: tripleo_ovs_dpdk_pmd_load_threshold|string
- name: Remove minimum PMD thread load threshold
openvswitch_db:
state: absent
table: open_vswitch
record: .
col: other_config
key: pmd-auto-lb-load-threshold
when: not tripleo_ovs_dpdk_pmd_load_threshold|string
- name: Set PMD load variance improvement threshold
openvswitch_db:
table: open_vswitch
record: .
col: other_config
key: pmd-auto-lb-improvement-threshold
value: "{{ tripleo_ovs_dpdk_pmd_improvement_threshold }}"
when: tripleo_ovs_dpdk_pmd_improvement_threshold|string
- name: Remove PMD load variance improvement threshold
openvswitch_db:
state: absent
table: open_vswitch
record: .
col: other_config
key: pmd-auto-lb-improvement-threshold
when: not tripleo_ovs_dpdk_pmd_improvement_threshold|string
- name: Set PMD auto load balancing interval
openvswitch_db:
table: open_vswitch
record: .
col: other_config
key: pmd-auto-lb-rebal-interval
value: "{{ tripleo_ovs_dpdk_pmd_rebal_interval }}"
when: tripleo_ovs_dpdk_pmd_rebal_interval|string
- name: Remove PMD auto load balancing interval
openvswitch_db:
state: absent
table: open_vswitch
record: .
col: other_config
key: pmd-auto-lb-rebal-interval
when: not tripleo_ovs_dpdk_pmd_rebal_interval|string