aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/parse_builtin.c
diff options
context:
space:
mode:
authorMarco Varlese <marco.varlese@suse.com>2017-08-14 16:07:00 +0200
committerSergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>2017-08-15 11:00:53 +0000
commit8ddd518f9a65af77dc3294f1965452aa72cb0eb2 (patch)
treeaa66403d69ccf3649892bf12e59920c7e7f299ba /src/vlib/parse_builtin.c
parentaf095513358cff48df857edee7691f242bcd9237 (diff)
Previous version was still downloading, unpacking and building IPSEC / AES
libraries. This patch addresses the misbehaviour. Change-Id: I41f1ece3ca21c5a8f2c95533ed3d77a535233ea6 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
Diffstat (limited to 'src/vlib/parse_builtin.c')
0 files changed, 0 insertions, 0 deletions
ht .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
import os
import psutil

available_cpus = psutil.Process().cpu_affinity()
num_cpus = len(available_cpus)

max_vpp_cpus = os.getenv("MAX_VPP_CPUS", "auto").lower()

if max_vpp_cpus == "auto":
    max_vpp_cpus = num_cpus
else:
    try:
        max_vpp_cpus = int(max_vpp_cpus)
    except ValueError as e:
        raise ValueError("Invalid MAX_VPP_CPUS value specified, valid "
                         "values are a positive integer or 'auto'") from e
    if max_vpp_cpus <= 0:
        raise ValueError("Invalid MAX_VPP_CPUS value specified, valid "
                         "values are a positive integer or 'auto'")
    if max_vpp_cpus > num_cpus:
        max_vpp_cpus = num_cpus