From 058dfaa4ad10b8fd3df7da7793f4633ac2afe64c Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Wed, 11 May 2016 15:07:06 +0200 Subject: Add test cases with "dpdk no-multi-seg" in vpp startup config - JIRA: CSIT-73 - Add ability to configure no-multi-seg parameter in VPP startup configuration - Add keywords to selectively configure parameters in startup configuration - Modify testcases Change-Id: I3c5c0a1cc2b1156d5a87ff36628b50793dd9ac5f Signed-off-by: Peter Mikus --- resources/libraries/python/VppConfigGenerator.py | 42 +++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'resources/libraries/python') diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py index a9c7618c92..9ca9fc401d 100644 --- a/resources/libraries/python/VppConfigGenerator.py +++ b/resources/libraries/python/VppConfigGenerator.py @@ -55,6 +55,7 @@ dpdk {{ {txqueuesconfig} {pciconfig} {rssconfig} +{nomultiseg} }} """ # End VPP configuration template. @@ -204,6 +205,25 @@ class VppConfigGenerator(object): logger.debug('Setting hostname {} max_tx_queues config to {}'.\ format(hostname, max_tx_queues_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. @@ -294,6 +314,21 @@ class VppConfigGenerator(object): logger.debug('Clearing Max TX Queues 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): """Generate and apply VPP configuration for node. @@ -318,6 +353,7 @@ class VppConfigGenerator(object): heapsizeconfig = "" rssconfig = "" txqueuesconfig = "" + nomultiseg = "" if hostname in self._nodeconfig: cfg = self._nodeconfig[hostname] @@ -341,12 +377,16 @@ class VppConfigGenerator(object): 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) + txqueuesconfig=txqueuesconfig, + nomultiseg = nomultiseg) logger.debug('Writing VPP config to host {}: "{}"'.format(hostname, vppconfig)) -- cgit 1.2.3-korg