X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVppConfigGenerator.py;h=68a4e22e6b52d4ea710425897d8054b888c742cc;hb=e08706e85b412b1307df3789fdbe747b43c2bd95;hp=02f7cf725dfa9c2bd0339bba82ab98505671c0b3;hpb=3d5a75be5a88931690898e0fe52e4f48bc67c5ed;p=csit.git diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py index 02f7cf725d..68a4e22e6b 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: @@ -202,9 +202,23 @@ class VppConfigGenerator: def add_socksvr(self, socket=Constants.SOCKSVR_PATH): """Add socksvr configuration.""" - path = ['socksvr', u"socket-name"] + 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. @@ -241,6 +255,15 @@ class VppConfigGenerator: path = [u"buffers", u"buffers-per-numa"] self.add_config_item(self._nodeconfig, value, path) + def add_buffers_default_data_size(self, value): + """Increase buffers data-size allocated. + + :param value: Buffers data-size allocated. + :type value: int + """ + path = [u"buffers", u"default data-size"] + self.add_config_item(self._nodeconfig, value, path) + def add_dpdk_dev(self, *devices): """Add DPDK PCI device configuration. @@ -478,12 +501,35 @@ 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): + """Add NSIM poll-main-thread configuration.""" + path = [u"nsim", u"poll-main-thread"] + self.add_config_item(self._nodeconfig, u"", path) + + def add_tcp_congestion_control_algorithm(self, value=u"cubic"): + """Add TCP congestion control algorithm. + + :param value: The congestion control algorithm to use. Example: cubic + :type value: str + """ + path = [u"tcp", u"cc-algo"] self.add_config_item(self._nodeconfig, value, path) def add_tcp_preallocated_connections(self, value): @@ -504,6 +550,16 @@ class VppConfigGenerator: path = [u"tcp", u"preallocated-half-open-connections"] self.add_config_item(self._nodeconfig, value, path) + def add_session_enable(self): + """Add session enable.""" + path = [u"session", u"enable"] + self.add_config_item(self._nodeconfig, u"", path) + + def add_session_event_queues_memfd_segment(self): + """Add session event queue memfd segment.""" + path = [u"session", u"evt_qs_memfd_seg"] + self.add_config_item(self._nodeconfig, u"", path) + def add_session_event_queue_length(self, value): """Add session event queue length. @@ -513,6 +569,15 @@ class VppConfigGenerator: path = [u"session", u"event-queue-length"] self.add_config_item(self._nodeconfig, value, path) + def add_session_event_queues_segment_size(self, value): + """Add session event queue length. + + :param value: Session event queue segment size. + :type value: str + """ + path = [u"session", u"evt_qs_seg_size"] + self.add_config_item(self._nodeconfig, value, path) + def add_session_preallocated_sessions(self, value): """Add the number of pre-allocated sessions.