X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVppConfigGenerator.py;h=9663fdc34382fc1dd9bd34dbdb1c54c9e98917c5;hb=cbd47fbe97945e9dc6584d08cd2266e3a7536a68;hp=53ae6ac8cc4701480ef8b4dcc73211f30ebaffc1;hpb=8c12ff59f1a5e750151f5eb0e806dcc80e91c3c2;p=csit.git diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py index 53ae6ac8cc..9663fdc343 100644 --- a/resources/libraries/python/VppConfigGenerator.py +++ b/resources/libraries/python/VppConfigGenerator.py @@ -52,8 +52,12 @@ cpu {{ dpdk {{ socket-mem {socketmemconfig} + dev default {{ + {rxqueuesconfig} + {txqueuesconfig} + }} {pciconfig} -{rssconfig} +{nomultiseg} }} """ # End VPP configuration template. @@ -162,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: @@ -176,11 +180,30 @@ 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_no_multi_seg_config(self, node): + """Add No Multi Seg configuration for node. + + :param node: DUT node. + :type node: dict + :return: nothing + """ + if node['type'] != NodeType.DUT: + raise ValueError('Node type is not a DUT') + hostname = Topology.get_node_hostname(node) + if not hostname in self._nodeconfig: + self._nodeconfig[hostname] = {} + 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. @@ -242,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 @@ -253,8 +276,23 @@ 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_no_multi_seg_config(self, node): + """Remove No Multi Seg configuration from node. + + :param node: DUT node. + :type node: dict + :return: nothing + """ + if node['type'] != NodeType.DUT: + raise ValueError('Node type is not a DUT') + hostname = Topology.get_node_hostname(node) + if hostname in self._nodeconfig: + 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): @@ -279,7 +317,9 @@ class VppConfigGenerator(object): pciconfig = "" socketmemconfig = DEFAULT_SOCKETMEM_CONFIG heapsizeconfig = "" - rssconfig = "" + rxqueuesconfig = "" + txqueuesconfig = "" + nomultiseg = "" if hostname in self._nodeconfig: cfg = self._nodeconfig[hostname] @@ -296,14 +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 '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) + rxqueuesconfig=rxqueuesconfig, + txqueuesconfig=txqueuesconfig, + nomultiseg = nomultiseg) logger.debug('Writing VPP config to host {}: "{}"'.format(hostname, vppconfig))