summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xansible/roles/enable_hugepages_on_boot/tasks/main.yml4
-rw-r--r--ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml35
-rw-r--r--samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml3
-rw-r--r--yardstick/network_services/helpers/samplevnf_helper.py20
4 files changed, 49 insertions, 13 deletions
diff --git a/ansible/roles/enable_hugepages_on_boot/tasks/main.yml b/ansible/roles/enable_hugepages_on_boot/tasks/main.yml
index c5c615bb3..29432d2e4 100755
--- a/ansible/roles/enable_hugepages_on_boot/tasks/main.yml
+++ b/ansible/roles/enable_hugepages_on_boot/tasks/main.yml
@@ -58,3 +58,7 @@
- service:
name: procps
enabled: yes
+
+- include: manual_modify_grub.yml
+ # only tested on Ubuntu, kernel line is probably different on other distros
+ when: ansible_distribution == "Ubuntu"
diff --git a/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml b/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml
new file mode 100644
index 000000000..cac10e80e
--- /dev/null
+++ b/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml
@@ -0,0 +1,35 @@
+# Copyright (c) 2017 Intel Corporation
+#
+# 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+---
+- name: find boot grub.cfg
+ find:
+ paths: /boot
+ file_type: file
+ patterns: 'grub*.cfg'
+ recurse: yes
+ register: grub_files
+
+
+- name: added hugepages to grub manually because we can't run update-grub in chroot
+ replace:
+ dest: "{{ item.path }}"
+ # console= should end the line
+ regexp: '(linux\s+/boot/vmlinuz.*console=\S+$)'
+ # default_hugepagesz=1G hugepagesz=1G hugepages=8
+ replace: '\1 default_hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepages={{ num_hugepages }}'
+ with_items: "{{ grub_files.files }}"
+
+
+
+
diff --git a/samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml b/samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml
index 0904ace2c..8ec063657 100644
--- a/samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml
+++ b/samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml
@@ -16,7 +16,7 @@
schema: yardstick:task:0.1
scenarios:
- type: NSPerf
- traffic_profile: ../../traffic_profiles/ipv4_throughput-4.yaml
+ traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml
topology: vfw-tg-topology-4port.yaml
nodes:
tg__0: trafficgen_1.yardstick
@@ -43,3 +43,4 @@ context:
type: Node
name: yardstick
nfvi_type: baremetal
+ file: /etc/yardstick/nodes/pod_4.yaml
diff --git a/yardstick/network_services/helpers/samplevnf_helper.py b/yardstick/network_services/helpers/samplevnf_helper.py
index 5f87f788d..8159ec9f2 100644
--- a/yardstick/network_services/helpers/samplevnf_helper.py
+++ b/yardstick/network_services/helpers/samplevnf_helper.py
@@ -226,7 +226,7 @@ class MultiPortConfig(object):
self.tmp_file = os.path.join("/tmp", tmp_file)
self.pktq_out_os = []
self.socket = socket
- self.start_core = ""
+ self.start_core = 0
self.pipeline_counter = ""
self.txrx_pipeline = ""
self._port_pairs = None
@@ -268,9 +268,8 @@ class MultiPortConfig(object):
def update_timer(self):
timer_tpl = self.get_config_tpl_data('TIMER')
- timer_tpl['core'] = self.gen_core(self.start_core)
+ timer_tpl['core'] = self.gen_core(0)
self.update_write_parser(timer_tpl)
- self.start_core += 1
def get_config_tpl_data(self, type_value):
for section in self.read_parser.sections():
@@ -289,7 +288,6 @@ class MultiPortConfig(object):
def init_write_parser_template(self, type_value='ARPICMP'):
for section in self.read_parser.sections():
if type_value == self.parser_get(self.read_parser, section, 'type', object()):
- self.start_core = self.read_parser.getint(section, 'core')
self.pipeline_counter = self.read_parser.getint(section, 'core')
self.txrx_pipeline = self.read_parser.getint(section, 'core')
return
@@ -385,7 +383,7 @@ class MultiPortConfig(object):
self.port_pair_list)
arpicmp_data = {
- 'core': self.gen_core(self.start_core),
+ 'core': self.gen_core(0),
'pktq_in': swq_in_str,
'pktq_out': swq_out_str,
# we need to disable ports_mac_list?
@@ -416,7 +414,7 @@ class MultiPortConfig(object):
return arpicmp_data
- def generate_final_txrx_data(self):
+ def generate_final_txrx_data(self, core=0):
swq_start = self.swq - self.ports_len * self.worker_threads
txq_start = 0
@@ -431,7 +429,7 @@ class MultiPortConfig(object):
'pktq_in': swq_str,
'pktq_out': txq_str,
'pipeline_txrx_type': 'TXTX',
- 'core': self.gen_core(self.start_core),
+ 'core': self.gen_core(core),
}
pktq_in = rxtx_data['pktq_in']
pktq_in = '{0} {1}'.format(pktq_in, self.pktq_out_os[self.lb_index - 1])
@@ -452,7 +450,7 @@ class MultiPortConfig(object):
'core': self.gen_core(self.start_core),
}
self.pipeline_counter += 1
- return txrx_data
+ return self.start_core, txrx_data
def generate_lb_data(self):
pktq_in = self.make_range_str('SWQ{}', self.swq, offset=self.ports_len)
@@ -519,7 +517,6 @@ class MultiPortConfig(object):
self.arpicmp_tpl.update(arpicmp_data)
self.update_write_parser(self.arpicmp_tpl)
- self.start_core += 1
if self.vnf_type == 'CGNAPT':
self.pipeline_counter += 1
self.update_timer()
@@ -536,7 +533,7 @@ class MultiPortConfig(object):
self.ports_len = port_pair_count * 2
self.set_priv_que_handler()
if self.lb_config == 'SW':
- txrx_data = self.generate_initial_txrx_data()
+ core, txrx_data = self.generate_initial_txrx_data()
self.txrx_tpl.update(txrx_data)
self.update_write_parser(self.txrx_tpl)
self.start_core += 1
@@ -560,10 +557,9 @@ class MultiPortConfig(object):
self.generate_next_core_id()
if self.lb_config == 'SW':
- txrx_data = self.generate_final_txrx_data()
+ txrx_data = self.generate_final_txrx_data(core)
self.txrx_tpl.update(txrx_data)
self.update_write_parser(self.txrx_tpl)
- self.start_core += 1
self.vnf_tpl = self.get_config_tpl_data(self.vnf_type)
def generate_config(self):