Browse Source

'tripleo_ovs_dpdk_lcore_list' should be optional

This parameter should be optional as only the first core in the mask
will be used to repin all ovs-vswitchd threads.
Leaving this parameter blank (and as a consequence, not setting
'dpdk-lcore-mask') allows all non-dpdk threads to float on the original
cpu set.

Change-Id: Ia9e001e2b1987f00a960cdf106eaa8e84dc4d71a
Signed-off-by: Christophe Fontaine <cfontain@redhat.com>
changes/60/711360/6
Christophe Fontaine 2 years ago
parent
commit
71eb4ba2fa
  1. 8
      doc/source/roles/role-tripleo-ovs-dpdk.rst
  2. 6
      tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/default/converge.yml
  3. 11
      tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/default/tests/test_default.py
  4. 16
      tripleo_ansible/roles/tripleo_ovs_dpdk/tasks/config.yml

8
doc/source/roles/role-tripleo-ovs-dpdk.rst

@ -22,14 +22,18 @@ Role Defaults
- ``tripleo_ovs_dpdk_pmd_core_list``
- **Description**: (*Mandatory*) List of PMD Cores for DPDK. Its a
comma-separated string of logical cores.
comma-separated string of logical cores. These core should be part
of ``isolcpus`` kernel parameter and be excluded from ``NovaComputeCpuDedicatedSet``
and from ``NovaComputeCpuSharedSet``
- **Default**: ``''``
- **Examples**: ``'1,13'``
- ``tripleo_ovs_dpdk_lcore_list``
- **Description**: (*Mandatory*) List of lcores for DPDK. Its a
- **Description**: (*Optional*) List of lcores for DPDK. Its a
comma-separated string of logical cores.
All ovs-vswitchd threads will be pinned to the first core declared
in the mask.
- **Default**: ``''``
- **Examples**: ``'0,12'``

6
tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/default/converge.yml

@ -27,8 +27,9 @@
tripleo_ovs_dpdk_socket_memory: "1024,1024"
tripleo_ovs_dpdk_emc_insertion_probablity: 10
# By removing tripleo_ovs_dpdk_emc_insertion_probablity from the vars,
# which was set by earlier play, should remove this key from the ovs db.
# By removing tripleo_ovs_dpdk_emc_insertion_probablity and
# tripleo_ovs_dpdk_lcore_list from the vars, which were set by earlier play,
# should remove these keys from the ovs db.
- name: Converge
hosts: all
tasks:
@ -37,5 +38,4 @@
tasks_from: "config.yml"
vars:
tripleo_ovs_dpdk_pmd_core_list: "1,13-15"
tripleo_ovs_dpdk_lcore_list: "0,12"
tripleo_ovs_dpdk_socket_memory: "1024,1024"

11
tripleo_ansible/roles/tripleo_ovs_dpdk/molecule/default/tests/test_default.py

@ -46,18 +46,17 @@ def test_positive_pmd(host):
assert val == "e002"
def test_positive_lcore(host):
other_config = get_config(host)
val = other_config['dpdk-lcore-mask'].replace('"', '')
assert val == "1001"
def test_positive_socket_mem(host):
other_config = get_config(host)
val = other_config['dpdk-socket-mem'].replace('"', '')
assert val == "1024,1024"
def test_positive_lcore(host):
other_config = get_config(host)
assert 'dpdk-lcore-mask' not in other_config
def test_positive_validator_threads(host):
other_config = get_config(host)
assert 'n-revalidator-threads' not in other_config

16
tripleo_ansible/roles/tripleo_ovs_dpdk/tasks/config.yml

@ -19,11 +19,6 @@
msg: "List of PMD cores cannot be empty - tripleo_ovs_dpdk_pmd_core_list"
when: not tripleo_ovs_dpdk_pmd_core_list|string or tripleo_ovs_dpdk_pmd_core_list == 'null'
- name: Check valid input for tripleo_ovs_dpdk_lcore_list
fail:
msg: "List of DPDK lcores cannot be empty - tripleo_ovs_dpdk_lcore_list"
when: not tripleo_ovs_dpdk_lcore_list|string or tripleo_ovs_dpdk_lcore_list == 'null'
- name: Check valid input for tripleo_ovs_dpdk_socket_memory
fail:
msg: "Socket Memory cannot be empty - tripleo_ovs_dpdk_socket_memory"
@ -38,7 +33,7 @@
value: "{{ tripleo_ovs_dpdk_pmd_core_list | cpu_mask }}"
when: tripleo_ovs_dpdk_pmd_core_list|string
- name: Apply DPDK lcores config
- name: Set DPDK lcores config
openvswitch_db:
table: open_vswitch
record: .
@ -47,6 +42,15 @@
value: "{{ tripleo_ovs_dpdk_lcore_list | cpu_mask }}"
when: tripleo_ovs_dpdk_lcore_list|string
- name: Remove DPDK lcores config
openvswitch_db:
state: absent
table: open_vswitch
record: .
col: other_config
key: dpdk-lcore-mask
when: not tripleo_ovs_dpdk_lcore_list|string or tripleo_ovs_dpdk_lcore_list == 'null'
- name: Add memory channels to dpdk extra
set_fact:
tripleo_ovs_dpdk_extra_internal: "{{ tripleo_ovs_dpdk_extra }} -n {{ tripleo_ovs_dpdk_memory_channels }}"

Loading…
Cancel
Save