Skip to content

Commit

Permalink
T7066: VPP CPU workers should be calculated and verified
Browse files Browse the repository at this point in the history
  • Loading branch information
natali-rs1985 committed Jan 28, 2025
1 parent 1c8e9d5 commit 6d07e0f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/conf_mode/vpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,19 @@ def verify(config):
if 'cpu' in config['settings']:
if (
'corelist_workers' in config['settings']['cpu']
and 'main_core' not in config['settings']['cpu']
):
or 'workers' in config['settings']['cpu']
) and 'main_core' not in config['settings']['cpu']:
raise ConfigError('"cpu main-core" is required but not set!')

cpus = int(get_core_count())
if 'workers' in config['settings']['cpu']:
# number of worker threads must be not more than
# available CPUs in the system - 2 (1 for main thread and at least 1 for system processes)
workers = int(config['settings']['cpu']['workers'])
available_workers = cpus - 2
if workers > available_workers:
raise ConfigError(f'"cpu workers" cannot be not more than {available_workers}')

verify_memory(config['settings'])

# Check if deleted interfaces are not xconnect memebrs
Expand Down Expand Up @@ -428,6 +437,7 @@ def generate(config):


def apply(config):

# Open persistent config
# It is required for operations with interfaces
persist_config = JSONStorage('vpp_conf')
Expand Down

0 comments on commit 6d07e0f

Please sign in to comment.