X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVppConfigGenerator.py;h=9663fdc34382fc1dd9bd34dbdb1c54c9e98917c5;hb=bcf99a0eb0e8770f28c2e3c8c0965ad6c0acba94;hp=a9c7618c92947dd3f539966136ac485758f5a05b;hpb=807afe3f73ef9f6170e72f922338d0a726028ec6;p=csit.git diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py index a9c7618c92..9663fdc343 100644 --- a/resources/libraries/python/VppConfigGenerator.py +++ b/resources/libraries/python/VppConfigGenerator.py @@ -52,9 +52,12 @@ cpu {{ dpdk {{ socket-mem {socketmemconfig} -{txqueuesconfig} + dev default {{ + {rxqueuesconfig} + {txqueuesconfig} + }} {pciconfig} -{rssconfig} +{nomultiseg} }} """ # End VPP configuration template. @@ -163,13 +166,13 @@ class VppConfigGenerator(object): logger.debug('Setting hostname {} Heap Size config to {}'. format(hostname, heapsize_config)) - def add_rss_config(self, node, rss_config): - """Add RSS configuration for node. + def add_rxqueues_config(self, node, rxqueues_config): + """Add Rx Queues configuration for node. :param node: DUT node. - :param rss_config: RSS configuration, as a string. + :param rxqueues_config: Rxqueues configuration, as a string. :type node: dict - :type rss_config: str + :type rxqueues_config: str :return: nothing """ if node['type'] != NodeType.DUT: @@ -177,19 +180,17 @@ class VppConfigGenerator(object): hostname = Topology.get_node_hostname(node) if not hostname in self._nodeconfig: self._nodeconfig[hostname] = {} - if not 'rss_config' in self._nodeconfig[hostname]: - self._nodeconfig[hostname]['rss_config'] = [] - self._nodeconfig[hostname]['rss_config'].append(rss_config) - logger.debug('Setting hostname {} RSS config to {}'.\ - format(hostname, rss_config)) + if not 'rxqueues_config' in self._nodeconfig[hostname]: + self._nodeconfig[hostname]['rxqueues_config'] = [] + self._nodeconfig[hostname]['rxqueues_config'].append(rxqueues_config) + logger.debug('Setting hostname {} rxqueues config to {}'.\ + format(hostname, rxqueues_config)) - def add_max_tx_queues_config(self, node, max_tx_queues_config): - """Add Max TX Queues configuration for node. + def add_no_multi_seg_config(self, node): + """Add No Multi Seg configuration for node. :param node: DUT node. - :param max_tx_queues_config: Max TX Queues configuration, as a string. :type node: dict - :type max_tx_queues_config: str :return: nothing """ if node['type'] != NodeType.DUT: @@ -197,12 +198,12 @@ class VppConfigGenerator(object): hostname = Topology.get_node_hostname(node) if not hostname in self._nodeconfig: self._nodeconfig[hostname] = {} - if not 'max_tx_queues_config' in self._nodeconfig[hostname]: - self._nodeconfig[hostname]['max_tx_queues_config'] = [] - self._nodeconfig[hostname]['max_tx_queues_config'].append( - max_tx_queues_config) - logger.debug('Setting hostname {} max_tx_queues config to {}'.\ - format(hostname, max_tx_queues_config)) + if not 'no_multi_seg_config' in self._nodeconfig[hostname]: + self._nodeconfig[hostname]['no_multi_seg_config'] = [] + self._nodeconfig[hostname]['no_multi_seg_config'].append( + "no-multi-seg") + logger.debug('Setting hostname {} config with {}'.\ + format(hostname, "no-multi-seg")) def remove_all_pci_devices(self, node): """Remove PCI device configuration from node. @@ -264,8 +265,8 @@ class VppConfigGenerator(object): logger.debug('Clearing Heap Size config for hostname {}.'. format(hostname)) - def remove_rss_config(self, node): - """Remove RSS configuration from node. + def remove_rxqueues_config(self, node): + """Remove Rxqueues configuration from node. :param node: DUT node. :type node: dict @@ -275,12 +276,12 @@ class VppConfigGenerator(object): raise ValueError('Node type is not a DUT') hostname = Topology.get_node_hostname(node) if hostname in self._nodeconfig: - self._nodeconfig[hostname]['rss_config'] = [] - logger.debug('Clearing RSS config for hostname {}.'.\ + self._nodeconfig[hostname]['rxqueues_config'] = [] + logger.debug('Clearing rxqueues config for hostname {}.'.\ format(hostname)) - def remove_max_tx_queues_config(self, node): - """Remove Max TX Queues configuration from node. + def remove_no_multi_seg_config(self, node): + """Remove No Multi Seg configuration from node. :param node: DUT node. :type node: dict @@ -290,8 +291,8 @@ class VppConfigGenerator(object): raise ValueError('Node type is not a DUT') hostname = Topology.get_node_hostname(node) if hostname in self._nodeconfig: - self._nodeconfig[hostname]['max_tx_queues_config'] = [] - logger.debug('Clearing Max TX Queues config for hostname {}.'.\ + self._nodeconfig[hostname]['no_multi_seg_config'] = [] + logger.debug('Clearing No Multi Seg config for hostname {}.'.\ format(hostname)) def apply_config(self, node, waittime=5, retries=12): @@ -316,8 +317,9 @@ class VppConfigGenerator(object): pciconfig = "" socketmemconfig = DEFAULT_SOCKETMEM_CONFIG heapsizeconfig = "" - rssconfig = "" + rxqueuesconfig = "" txqueuesconfig = "" + nomultiseg = "" if hostname in self._nodeconfig: cfg = self._nodeconfig[hostname] @@ -334,19 +336,19 @@ class VppConfigGenerator(object): heapsizeconfig = "\nheapsize {}\n".\ format(cfg['heapsize_config']) - if 'rss_config' in cfg: - rssconfig = " " + "\n ".join(cfg['rss_config']) + if 'rxqueues_config' in cfg: + rxqueuesconfig = " " + "\n ".join(cfg['rxqueues_config']) - if 'max_tx_queues_config' in cfg: - txqueuesconfig = " " + "\n ".join( - cfg['max_tx_queues_config']) + if 'no_multi_seg_config' in cfg: + nomultiseg = " " + "\n ".join(cfg['no_multi_seg_config']) vppconfig = VPP_CONFIG_TEMPLATE.format(cpuconfig=cpuconfig, pciconfig=pciconfig, socketmemconfig=socketmemconfig, heapsizeconfig=heapsizeconfig, - rssconfig=rssconfig, - txqueuesconfig=txqueuesconfig) + rxqueuesconfig=rxqueuesconfig, + txqueuesconfig=txqueuesconfig, + nomultiseg = nomultiseg) logger.debug('Writing VPP config to host {}: "{}"'.format(hostname, vppconfig))