Skip to content

Commit

Permalink
Merge "Add realtime mask as parameter"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Jun 12, 2024
2 parents 96f1b2d + e8ffa78 commit bab334d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions devstack/plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function configure {
iniset $TEMPEST_CONFIG whitebox-hardware cpu_topology "$WHITEBOX_CPU_TOPOLOGY"
iniset $TEMPEST_CONFIG whitebox-hardware dedicated_cpus_per_numa "$WHITEBOX_DEDICATED_CPUS_PER_NUMA"
iniset $TEMPEST_CONFIG whitebox-hardware shared_cpus_per_numa "$WHITEBOX_SHARED_CPUS_PER_NUMA"
iniset $TEMPEST_CONFIG whitebox-hardware realtime_mask "$WHITEBOX_REALTIME_MASK"
iniset $TEMPEST_CONFIG whitebox-hardware configured_hugepage_sizes "$WHITEBOX_CONFIGURED_HUGEPAGES"

iniset $TEMPEST_CONFIG compute-feature-enabled virtio_rng "$COMPUTE_FEATURE_VIRTIO_RNG"
Expand Down
1 change: 1 addition & 0 deletions devstack/settings
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ WHITEBOX_HUGEPAGE_GUEST_RAM_SIZE=${WHITEBOX_HUGEPAGE_GUEST_RAM_SIZE:-1024}
WHITEBOX_CPU_TOPOLOGY=${WHITEBOX_CPU_TOPOLOGY:-''}
WHITEBOX_DEDICATED_CPUS_PER_NUMA=${WHITEBOX_DEDICATED_CPUS_PER_NUMA:-4}
WHITEBOX_SHARED_CPUS_PER_NUMA=${WHITEBOX_SHARED_CPUS_PER_NUMA:-2}
WHITEBOX_REALTIME_MASK=${WHITEBOX_REALTIME_MASK:-'1-2'}
WHITEBOX_CONFIGURED_HUGEPAGES=${WHITEBOX_CONFIGURED_HUGEPAGES:-'2048,1048576'}

COMPUTE_FEATURE_VIRTIO_RNG=${COMPUTE_FEATURE_VIRTIO_RNG:-'True'}
Expand Down
8 changes: 6 additions & 2 deletions whitebox_tempest_plugin/api/compute/test_cpu_pinning.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,20 @@ def test_cpu_dedicated(self):
cpu_pinnings_a,
cpu_pinnings_b))

@testtools.skipUnless(CONF.whitebox_hardware.realtime_mask,
'Realtime mask was not provided.')
def test_realtime_cpu(self):
realtime_mask = '1-2'
realtime_mask = CONF.whitebox_hardware.realtime_mask
realtime_set = hardware.parse_cpu_spec(realtime_mask)
vcpu_count = len(realtime_set) + 1

specs = self.dedicated_cpu_policy.copy()
specs.update({
'hw:cpu_realtime': 'yes',
'hw:cpu_realtime_mask': realtime_mask,
})

flavor = self.create_flavor(vcpus=3, extra_specs=specs)
flavor = self.create_flavor(vcpus=vcpu_count, extra_specs=specs)
server = self.create_test_server(
flavor=flavor['id'], wait_until='ACTIVE')

Expand Down
4 changes: 4 additions & 0 deletions whitebox_tempest_plugin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@
'shared_cpus_per_numa',
default=0,
help='Number of pCPUs allocated for cpu_shared_set per NUMA'),
cfg.StrOpt(
'realtime_mask',
default=None,
help='CPU mask used when configuring hw:cpu_realtime_mask'),
cfg.StrOpt(
'sriov_physnet',
default=None,
Expand Down

0 comments on commit bab334d

Please sign in to comment.