X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVppConfigGenerator.py;h=b769b89acd688b494f6cf85b38d321df5d9dc0f4;hb=79f5ba9bf7656972dd988508eff9465562dde42c;hp=88fbb317c45e7b7aa2e1ceba63a9e4d93e55f213;hpb=d68951ac245150eeefa6e0f4156e4c1b5c9e9325;p=csit.git diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py index 88fbb317c4..b769b89acd 100644 --- a/resources/libraries/python/VppConfigGenerator.py +++ b/resources/libraries/python/VppConfigGenerator.py @@ -55,8 +55,8 @@ class VppConfigGenerator: """Initialize library.""" # VPP Node to apply configuration on self._node = u"" - # VPP Hostname - self._hostname = u"" + # Topology node key + self._node_key = u"" # VPP Configuration self._nodeconfig = dict() # Serialized VPP Configuration @@ -70,11 +70,13 @@ class VppConfigGenerator: # VPP Startup config backup location self._vpp_startup_conf_backup = None - def set_node(self, node): + def set_node(self, node, node_key=None): """Set DUT node. :param node: Node to store configuration on. + :param node_key: Topology node key. :type node: dict + :type node_key: str :raises RuntimeError: If Node type is not DUT. """ if node[u"type"] != NodeType.DUT: @@ -82,7 +84,7 @@ class VppConfigGenerator: u"Startup config can only be applied to DUTnode." ) self._node = node - self._hostname = Topology.get_node_hostname(node) + self._node_key = node_key def set_vpp_logfile(self, logfile): """Set VPP logfile location. @@ -200,7 +202,7 @@ 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_api_segment_gid(self, value=u"vpp"): @@ -239,6 +241,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. @@ -484,6 +495,20 @@ class VppConfigGenerator: path = [u"nat"] 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): """Add TCP pre-allocated connections. @@ -502,6 +527,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. @@ -511,6 +546,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. @@ -612,7 +656,7 @@ class VppConfigGenerator: """ self.write_config(filename=filename) - VPPUtil.restart_vpp_service(self._node) + VPPUtil.restart_vpp_service(self._node, self._node_key) if verify_vpp: VPPUtil.verify_vpp(self._node)