X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVppConfigGenerator.py;h=fa8290d9746a70a070781ef4ccd48e07bcf19dde;hb=3289b49cd2f08f9aae43959e0d5778617379388f;hp=b769b89acd688b494f6cf85b38d321df5d9dc0f4;hpb=d79b753c1fde3cd831f60ac5cc0034f613c44b43;p=csit.git diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py index b769b89acd..fa8290d974 100644 --- a/resources/libraries/python/VppConfigGenerator.py +++ b/resources/libraries/python/VppConfigGenerator.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. +# Copyright (c) 2020 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -205,6 +205,20 @@ class VppConfigGenerator: path = [u"socksvr", u"socket-name"] self.add_config_item(self._nodeconfig, socket, path) + def add_graph_node_variant(self, variant=Constants.GRAPH_NODE_VARIANT): + """Add default graph node variant. + + :param value: Graph node variant default value. + :type value: str + """ + if variant == u"": + return + variant_list = [u"hsw", u"skx", u"icl"] + if variant not in variant_list: + raise ValueError("Invalid graph node variant value") + path = [u"node", u"default", u"variant"] + self.add_config_item(self._nodeconfig, variant, path) + def add_api_segment_gid(self, value=u"vpp"): """Add API-SEGMENT gid configuration. @@ -405,13 +419,22 @@ class VppConfigGenerator: path = [u"cpu", u"corelist-workers"] self.add_config_item(self._nodeconfig, value, path) - def add_heapsize(self, value): - """Add Heapsize configuration. + def add_main_heap_size(self, value): + """Add Main Heap Size configuration. - :param value: Amount of heapsize. + :param value: Amount of heap. :type value: str """ - path = [u"heapsize"] + path = [u"memory", u"main-heap-size"] + self.add_config_item(self._nodeconfig, value, path) + + def add_main_heap_page_size(self, value): + """Add Main Heap Page Size configuration. + + :param value: Heap page size. + :type value: str + """ + path = [u"memory", u"main-heap-page-size"] self.add_config_item(self._nodeconfig, value, path) def add_api_trace(self): @@ -437,22 +460,22 @@ class VppConfigGenerator: path = [u"ip6", u"heap-size"] self.add_config_item(self._nodeconfig, value, path) - def add_ip_heap_size(self, value): - """Add IP heap-size configuration. + def add_statseg_size(self, value): + """Add Stats Heap Size configuration. - :param value: IP Heapsize amount. + :param value: Stats heapsize amount. :type value: str """ - path = [u"ip", u"heap-size"] + path = [u"statseg", u"size"] self.add_config_item(self._nodeconfig, value, path) - def add_statseg_size(self, value): - """Add stats segment heap size configuration. + def add_statseg_page_size(self, value): + """Add Stats Heap Page Size configuration. :param value: Stats heapsize amount. :type value: str """ - path = [u"statseg", u"size"] + path = [u"statseg", u"page-size"] self.add_config_item(self._nodeconfig, value, path) def add_statseg_per_node_counters(self, value): @@ -487,12 +510,21 @@ class VppConfigGenerator: self.add_config_item(self._nodeconfig, u"", path) def add_nat(self, value=u"deterministic"): - """Add NAT configuration. + """Add NAT mode configuration. + + :param value: NAT mode. + :type value: str + """ + path = [u"nat", value] + self.add_config_item(self._nodeconfig, u"", path) + + def add_nat_max_translations_per_thread(self, value): + """Add NAT max. translations per thread number configuration. :param value: NAT mode. :type value: str """ - path = [u"nat"] + path = [u"nat", u"max translations per thread"] self.add_config_item(self._nodeconfig, value, path) def add_nsim_poll_main_thread(self):