diff options
author | Luc Provoost <luc.provoost@intel.com> | 2018-02-03 22:47:55 +0100 |
---|---|---|
committer | Deepak S <deepak.s@linux.intel.com> | 2018-02-04 01:52:43 +0000 |
commit | 7fa9c0b506709a683ec8984e19e9ba9deb27e021 (patch) | |
tree | ed893dd0782cb60ae1a0d372d9bb33044bd114ff /VNFs/DPPD-PROX/helper-scripts/openstackrapid | |
parent | d29f8fa251540b48371f76e47ddba6315607d192 (diff) |
Fixed issues with the pkt_size command
Fixed issues with pkt_size. For a 64 byte packet, we need to issue
pkt_size <core> <task> 60
4 extra bytes will be calculated and added automatically by PROX
Also added the missing irq.test and irq.cfg files
Added support for OpenStack systems not using floating IP addresses
Change-Id: I05d775eb858a58dd349ea370a0e34ac6448590c9
Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/openstackrapid')
5 files changed, 219 insertions, 70 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/README b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/README index ec333e38..3123a0e2 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/README +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/README @@ -41,13 +41,15 @@ createrapid.py will use the OpenStack CLI to create the flavor, key-pair, networ stack, ... It will create a <STACK>.env file containing all info that will be used by runrapid.py to actually run the tests. Logging can be found in the CREATE<STACK>.log file +You can use floating IP addresses by specifying the floating IP network +--floating_network NETWORK +or directly connect throught the INTERNAL_NETWORK by using the following parameter: +--floating_network NO Now you can run the runrapid.py file. Use help for more info on the usage: # ./runrapid.py --help The script will connect to all VMs that have been instantiated and it will launch -PROX in all VMs. -This will be done through the floating IP assigned to the VMs. You need to make sure -that floating IPs are working on your OpenStack deployment. +PROX in all VMs. This will be done through the admin IP assigned to the VMs. Once that is done it will connect to the PROX tcp socket and start sending commands to run the actual test. It will print test results on the screen while running. @@ -61,8 +63,8 @@ Notes about prox_user_data.sh script: - huge pages are allocated for DPDK on node 0 (hard-coded) in the VM. Note on using SRIOV ports: -Before running createrapid, it is best to already create the network, subnet and ports -manually by entering the following commands (change the parameters to your needs): +Before running createrapid, make sure the network, subnet and ports are already created +This can be done as follows (change the parameters to your needs): openstack network create --share --external --provider-network-type flat --provider-physical-network physnet2 fast-network openstack subnet create --network fast-network --subnet-range 20.20.20.0/24 --gateway none fast-subnet openstack port create --network fast-network --vnic-type direct --fixed-ip subnet=fast-subnet Port1 diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/createrapid.py b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/createrapid.py index beca11c3..f40cc8b8 100755 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/createrapid.py +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/createrapid.py @@ -31,7 +31,7 @@ from logging import handlers from prox_ctrl import prox_ctrl import ConfigParser -version="17.12.15" +version="18.2.3" stack = "rapid" #Default string for stack yaml = "rapid.yaml" #Default string for yaml file key = "prox" # This is also the default in the yaml file.... @@ -76,7 +76,7 @@ def usage(): print(" --subnet DP_SUBNET Specify the subnet name to be used for the dataplane. Default is %s."%subnet) print(" --subnet_cidr SUBNET_CIDR Specify the subnet CIDR to be used for the dataplane. Default is %s."%subnet_cidr) print(" --internal_network NETWORK Specify the network name to be used for the control plane. Default is %s."%internal_network) - print(" --floating_network NETWORK Specify the external floating ip network name. Default is %s."%floating_network) + print(" --floating_network NETWORK Specify the external floating ip network name. Default is %s. NO if no floating ip used."%floating_network) print(" --log Specify logging level for log file output, screen output level is hard coded") print(" -h, --help Show help message and exit.") print("") @@ -205,16 +205,17 @@ else: raise Exception("Control plane network " + internal_network + " not existing") # Checking if the floating ip network already exists, if not, stop the script -log.debug("Checking floating ip network: "+floating_network) -cmd = 'openstack network show '+floating_network -log.debug (cmd) -cmd = cmd + ' |grep "status " | tr -s " " | cut -d" " -f 4' -NetworkExist = subprocess.check_output(cmd , shell=True).strip() -if NetworkExist == 'ACTIVE': - log.info("Floating ip network ("+floating_network+") already active") -else: - log.exception("Floating ip network " + floating_network + " not existing") - raise Exception("Floating ip network " + floating_network + " not existing") +if floating_network <>'NO': + log.debug("Checking floating ip network: "+floating_network) + cmd = 'openstack network show '+floating_network + log.debug (cmd) + cmd = cmd + ' |grep "status " | tr -s " " | cut -d" " -f 4' + NetworkExist = subprocess.check_output(cmd , shell=True).strip() + if NetworkExist == 'ACTIVE': + log.info("Floating ip network ("+floating_network+") already active") + else: + log.exception("Floating ip network " + floating_network + " not existing") + raise Exception("Floating ip network " + floating_network + " not existing") # Checking if the image already exists, if not create it log.debug("Checking image: "+image) @@ -357,9 +358,14 @@ for vm in range(1, int(total_number_of_VMs)+1): searchString = '.*vm%d_dataplane_ip.*?([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)' % vm matchObj = re.search(searchString, output, re.DOTALL) vmDPIP.append(matchObj.group(1)) - searchString = '.*vm%d_public_ip.*?([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)' % vm - matchObj = re.search(searchString, output, re.DOTALL) - vmAdminIP.append(matchObj.group(1)) + if floating_network <> 'NO': + searchString = '.*vm%d_public_ip.*?([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)' % vm + matchObj = re.search(searchString, output, re.DOTALL) + vmAdminIP.append(matchObj.group(1)) + else: + searchString = '.*vm%d_private_ip.*?([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)' % vm + matchObj = re.search(searchString, output, re.DOTALL) + vmAdminIP.append(matchObj.group(1)) searchString = '.*vm%d_dataplane_mac.*?([a-fA-F0-9:]{17})' % vm matchObj = re.search(searchString, output, re.DOTALL) vmDPmac.append(matchObj.group(1)) diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/irq.cfg b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/irq.cfg new file mode 100644 index 00000000..3ae539c5 --- /dev/null +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/irq.cfg @@ -0,0 +1,42 @@ +;; +;; Copyright (c) 2010-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. +;; + +[eal options] +-n=4 ; force number of memory channels +no-output=no ; disable DPDK debug output + +[lua] +dofile("parameters.lua") + +[port 0] +name=p0 + +[variables] +$mbs=8 + +[defaults] +mempool size=4K + +[global] +name=${name} + +[core 0] +mode=master + +[core ${group1}] +name=irq +task=0 +mode=irq diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/irq.test b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/irq.test new file mode 100644 index 00000000..c53a31b9 --- /dev/null +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/irq.test @@ -0,0 +1,52 @@ +## +## Copyright (c) 2010-2018 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. +## + +[DEFAULT] +name = BasicSwapTesting +number_of_tests = 1 +total_number_of_vms = 1 +init_code= not_used +dest_vm = not_used +gw_vm = not_used +script_control = false +group1cores = not_used +group2cores = not_used +group3cores = not_used + + +[VM1] +name = InterruptTesting +config_file = irq.cfg +group1cores = [1,2,3] + +[VM2] +name = InterruptTesting +config_file = irq.cfg +group1cores = [1,2,3] + +[VM3] +name = InterruptTesting +config_file = irq.cfg +group1cores = [1,2,3] + + +[test1] +cmd=run_irqtest(sock[0]) +[test2] +cmd=run_irqtest(sock[1]) +[test3] +cmd=run_irqtest(sock[2]) + diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/runrapid.py b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/runrapid.py index 22181b96..7b999523 100755 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/runrapid.py +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/runrapid.py @@ -32,15 +32,15 @@ from prox_ctrl import prox_ctrl import ConfigParser import ast -version="17.12.15" -stack = "rapid" #Default string for stack +version="18.2.3" +env = "rapid" #Default string for environment test = "basicrapid" #Default string for test loglevel="DEBUG" # sets log level for writing to file runtime=10 # time in seconds for 1 test run def usage(): print("usage: runrapid [--version] [-v]") - print(" [--stack STACK_NAME]") + print(" [--env ENVIRONMENT_NAME]") print(" [--test TEST_NAME]") print(" [--runtime TIME_FOR_TEST]") print(" [--log DEBUG|INFO|WARNING|ERROR|CRITICAL]") @@ -50,7 +50,7 @@ def usage(): print("") print("optional arguments:") print(" -v, --version Show program's version number and exit") - print(" --stack STACK_NAME Parameters will be read from STACK_NAME.env Default is %s."%stack) + print(" --env ENVIRONMENT_NAME Parameters will be read from ENVIRONMENT_NAME.env Default is %s."%env) print(" --test TEST_NAME Test cases will be read from TEST_NAME.test Default is %s."%test) print(" --runtime Specify time in seconds for 1 test run") print(" --log Specify logging level for log file output, screen output level is hard coded") @@ -58,7 +58,7 @@ def usage(): print("") try: - opts, args = getopt.getopt(sys.argv[1:], "vh", ["version","help", "stack=", "test=","runtime=","log="]) + opts, args = getopt.getopt(sys.argv[1:], "vh", ["version","help", "env=", "test=","runtime=","log="]) except getopt.GetoptError as err: print("===========================================") print(str(err)) @@ -75,9 +75,9 @@ for opt, arg in opts: if opt in ("-v", "--version"): print("Rapid Automated Performance Indication for Dataplane "+version) sys.exit() - if opt in ("--stack"): - stack = arg - print ("Using '"+stack+"' as name for the stack") + if opt in ("--env"): + env = arg + print ("Using '"+env+"' as name for the environment") if opt in ("--test"): test = arg print ("Using '"+test+".test' for test case definition") @@ -114,7 +114,7 @@ console_handler.setFormatter(screen_formatter) # create a file handler # and set its log level to DEBUG # -log_file = 'RUN' +stack+'.'+test+'.log' +log_file = 'RUN' +env+'.'+test+'.log' file_handler = logging.handlers.RotatingFileHandler(log_file, backupCount=10) #file_handler = log.handlers.TimedRotatingFileHandler(log_file, 'D', 1, 5) file_handler.setLevel(numeric_level) @@ -177,7 +177,7 @@ def connect_client(client): def run_iteration(gensock,sutsock): gensock.start(gencores) - time.sleep(1) + time.sleep(3) if sutsock!='none': old_sut_rx, old_sut_tx, old_sut_drop, old_sut_tsc, sut_tsc_hz = sutsock.core_stats(sutstatcores) old_rx, old_tx, old_drop, old_tsc, tsc_hz = gensock.core_stats(genstatcores) @@ -202,7 +202,7 @@ def run_iteration(gensock,sutsock): sut_tx = new_sut_tx - old_sut_tx sut_tsc = new_sut_tsc - old_sut_tsc pps_sut_tx = round(sut_tx*sut_tsc_hz*1.0/(sut_tsc*1000000),3) - pps_sut_tx_str = str(pps_sut_tx) + pps_sut_tx_str = '{:>9.2f}'.format(pps_sut_tx) else: pps_sut_tx = 0 pps_sut_tx_str = 'NO MEAS.' @@ -211,19 +211,28 @@ def run_iteration(gensock,sutsock): raise Exception("TX = 0") return(pps_req_tx,pps_tx,pps_sut_tx_str,pps_rx,lat_avg) -def new_speed(speed,drop_rate): +def new_speed(speed,minspeed,maxspeed,drop_rate): # Following calculates the ratio for the new speed to be applied # On the Y axis, we will find the ratio, a number between 0 and 1 # On the x axis, we find the % of dropped packets, a number between 0 and 100 # 2 lines are drawn and we take the minumun of these lines to calculate the ratio # One line goes through (0,y0) and (p,q) # The second line goes through (p,q) and (100,y100) - y0=0.99 - y100=0.1 - p=1 - q=.99 - ratio = min((q-y0)/p*drop_rate+y0,(q-y100)/(p-100)*drop_rate+q-p*(q-y100)/(p-100)) - return (int(speed*ratio*100)+0.5)/100.0 +# y0=0.99 +# y100=0.1 +# p=1 +# q=.99 +# ratio = min((q-y0)/p*drop_rate+y0,(q-y100)/(p-100)*drop_rate+q-p*(q-y100)/(p-100)) +# return (int(speed*ratio*100)+0.5)/100.0 + if drop_rate < DROP_RATE_TRESHOLD: + minspeed = speed + else: + maxspeed = speed + newspeed = (maxspeed+minspeed)/2.0 + return (newspeed,minspeed,maxspeed) + +def get_pps(speed,size): + return (speed * 100.0 / (8*(size+24))) def get_drop_rate(speed,pps_rx,size): # pps_rx are all the packets that are received by the generator. That is substracted @@ -232,7 +241,7 @@ def get_drop_rate(speed,pps_rx,size): # that the speed variable is already expressed in % so we only take 100 and not 10000) # divided by the number of bits in 1 packet. That is 8 bits in a byte times the size of # a frame (=our size + 24 bytes overhead). - tried_to_send = speed * 100.0 / (8*(size+24)) + tried_to_send = get_pps(speed,size) return (100.0*(tried_to_send - pps_rx)/tried_to_send) def run_speedtest(gensock,sutsock): @@ -242,9 +251,16 @@ def run_speedtest(gensock,sutsock): log.info("| Test | Speed requested | Sent to NIC | Sent by Gen | Forward by SUT | Rec. by Gen | Avg. Latency | Result |") log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+------------+") speed = 100 - size=64 + maxspeed = speed + minspeed = 0 + size=60 attempts = 0 - while (speed > 0.1): + endpps_sut_tx_str = 'NO_RESULTS' + gensock.set_size(gencores,0,size) # This is setting the frame size + gensock.set_value(gencores,0,16,(size-18),2) # 18 is the difference between the frame size and IP size = size of (MAC addresses, ethertype and FCS) + gensock.set_value(gencores,0,38,(size-38),2) # 38 is the difference between the frame size and UDP size = 18 + size of IP header (=20) + # This will only work when using sending UDP packets. For different protocls and ehternet types, we would need a differnt calculation + while (maxspeed-minspeed > 1): attempts += 1 print('Measurement ongoing at speed: ' + str(round(speed,2)) + '% ',end='\r') sys.stdout.flush() @@ -254,16 +270,23 @@ def run_speedtest(gensock,sutsock): # Get statistics now that the generation is stable and NO ARP messages any more pps_req_tx,pps_tx,pps_sut_tx_str,pps_rx,lat_avg = run_iteration(gensock,sutsock) drop_rate = get_drop_rate(speed,pps_rx,size) - if ((drop_rate) < 1): - # This will stop the test when number of dropped packets is below a certain percentage - log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+------------+") - log.info('|{:>7}'.format(str(attempts))+" | "+ '{:>14}'.format(str(round(speed,2))) + '% | '+ '{:>9}'.format(str(pps_req_tx))+' Mpps | '+ '{:>9}'.format(str(pps_tx)) +' Mpps | ' + '{:>9}'.format(pps_sut_tx_str) +' Mpps | '+ '{:>9}'.format(str(pps_rx))+' Mpps | '+ '{:>9}'.format(str(lat_avg))+" us | SUCCESS |") - log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+------------+") - break + if (drop_rate < DROP_RATE_TRESHOLD): + log.info('|{:>7}'.format(str(attempts))+" | "+ '{:>10.2f}'.format(get_pps(speed,size)) + ' Mpps | '+ '{:>9.2f}'.format(pps_req_tx)+' Mpps | '+ '{:>9.2f}'.format(pps_tx) +' Mpps | ' + '{:>9}'.format(pps_sut_tx_str) +' Mpps | '+ '{:>9.2f}'.format(pps_rx)+' Mpps | '+ '{:>9.0f}'.format(lat_avg)+" us | SUCCESS |") + endspeed = speed + endpps_req_tx = pps_req_tx + endpps_tx = pps_tx + endpps_sut_tx_str = pps_sut_tx_str + endpps_rx = pps_rx + endlat_avg = lat_avg else: - log.info('|{:>7}'.format(str(attempts))+" | "+ '{:>14}'.format(str(round(speed,2))) + '% | '+ '{:>9}'.format(str(pps_req_tx))+' Mpps | '+ '{:>9}'.format(str(pps_tx)) +' Mpps | ' + '{:>9}'.format(pps_sut_tx_str) +' Mpps | '+ '{:>9}'.format(str(pps_rx))+' Mpps | '+ '{:>9}'.format(str(lat_avg))+" us | FAILED |") - speed = new_speed(speed,drop_rate) - time.sleep(2) + log.info('|{:>7}'.format(str(attempts))+" | "+ '{:>10.2f}'.format(get_pps(speed,size)) + ' Mpps | '+ '{:>9.2f}'.format(pps_req_tx)+' Mpps | '+ '{:>9.2f}'.format(pps_tx) +' Mpps | ' + '{:>9}'.format(pps_sut_tx_str) +' Mpps | '+ '{:>9.2f}'.format(pps_rx)+' Mpps | '+ '{:>9.0f}'.format(lat_avg)+" us | FAILED |") + speed,minspeed,maxspeed = new_speed(speed,minspeed,maxspeed,drop_rate) + if endpps_sut_tx_str <> 'NO_RESULTS': + log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+------------+") + log.info('|{:>7}'.format("END")+" | "+ '{:>10.2f}'.format(get_pps(endspeed,size)) + ' Mpps | '+ '{:>9.2f}'.format(endpps_req_tx)+' Mpps | '+ '{:>9.2f}'.format(endpps_tx) +' Mpps | ' + '{:>9}'.format(endpps_sut_tx_str) +' Mpps | '+ '{:>9.2f}'.format(endpps_rx)+' Mpps | '+ '{:>9.0f}'.format(endlat_avg)+" us | SUCCESS |") + log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+------------+") + else: + log.debug('| Speed 0 or close to 0') def run_flowtest(gensock,sutsock): log.info("+---------------------------------------------------------------------------------------------------------------+") @@ -272,10 +295,14 @@ def run_flowtest(gensock,sutsock): log.info("| Flows | Speed requested | Sent to NIC | Sent by Gen | Forward by SUT | Rec. by Gen | Avg. Latency |") log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+") speed = 100 - size=64 + size=60 # To generate a desired number of flows, PROX will randomize the bits in source and destination ports, as specified by the bit masks in the flows variable. flows={128:['1000000000000XXX','100000000000XXXX'],1024:['10000000000XXXXX','10000000000XXXXX'],8192:['1000000000XXXXXX','100000000XXXXXXX'],65535:['10000000XXXXXXXX','10000000XXXXXXXX'],524280:['1000000XXXXXXXXX','100000XXXXXXXXXX']} # flows={524280:['1000000XXXXXXXXX','100000XXXXXXXXXX']} + gensock.set_size(gencores,0,size) # This is setting the frame size + gensock.set_value(gencores,0,16,(size-18),2) # 18 is the difference between the frame size and IP size = size of (MAC addresses, ethertype and FCS) + gensock.set_value(gencores,0,38,(size-38),2) # 38 is the difference between the frame size and UDP size = 18 + size of IP header (=20) + # This will only work when using sending UDP packets. For different protocls and ehternet types, we would need a differnt calculation for flow_number in sorted(flows.iterkeys()): #speed = 100 Commented out: Not starting from 100% since we are trying more flows, so speed will not be higher than the speed achieved in previous loop gensock.reset_stats() @@ -284,7 +311,10 @@ def run_flowtest(gensock,sutsock): source_port,destination_port = flows[flow_number] gensock.set_random(gencores,0,34,source_port,2) gensock.set_random(gencores,0,36,destination_port,2) - while (speed > 0.1): + endpps_sut_tx_str = 'NO_RESULTS' + maxspeed = speed + minspeed = 0 + while (maxspeed-minspeed > 1): print(str(flow_number)+' flows: Measurement ongoing at speed: ' + str(round(speed,2)) + '% ',end='\r') sys.stdout.flush() # Start generating packets at requested speed (in % of a 10Gb/s link) @@ -293,13 +323,19 @@ def run_flowtest(gensock,sutsock): # Get statistics now that the generation is stable and NO ARP messages any more pps_req_tx,pps_tx,pps_sut_tx_str,pps_rx,lat_avg = run_iteration(gensock,sutsock) drop_rate = get_drop_rate(speed,pps_rx,size) - if ((drop_rate) < 1): - # This will stop the test when number of dropped packets is below a certain percentage - log.info('|{:>7}'.format(str(flow_number))+" | "+ '{:>14}'.format(str(round(speed,2))) + '% | '+ '{:>9}'.format(str(pps_req_tx))+' Mpps | '+ '{:>9}'.format(str(pps_tx)) +' Mpps | ' + '{:>9}'.format(pps_sut_tx_str) +' Mpps | '+ '{:>9}'.format(str(pps_rx))+" Mpps |"+ '{:>10}'.format(str(lat_avg))+" us |") - log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+") - break - speed = new_speed(speed,drop_rate) - time.sleep(2) + if (drop_rate < DROP_RATE_TRESHOLD): + endspeed = speed + endpps_req_tx = pps_req_tx + endpps_tx = pps_tx + endpps_sut_tx_str = pps_sut_tx_str + endpps_rx = pps_rx + endlat_avg = lat_avg + speed,minspeed,maxspeed = new_speed(speed,minspeed,maxspeed,drop_rate) + if endpps_sut_tx_str <> 'NO_RESULTS': + log.info('|{:>7}'.format(str(flow_number))+" | "+ '{:>10.2f}'.format(get_pps(endspeed,size)) + ' Mpps | '+ '{:>9.2f}'.format(endpps_req_tx)+' Mpps | '+ '{:>9.2f}'.format(endpps_tx) +' Mpps | ' + '{:>9}'.format(endpps_sut_tx_str) +' Mpps | '+ '{:>9.2f}'.format(endpps_rx)+' Mpps | '+ '{:>9.0f}'.format(endlat_avg)+' us |{:>7.1f}%'.format(speed)) + log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+") + else: + log.debug('|{:>7}'.format(str(flow_number))+" | Speed 0 or close to 0") def run_sizetest(gensock,sutsock): log.info("+---------------------------------------------------------------------------------------------------------------+") @@ -309,7 +345,8 @@ def run_sizetest(gensock,sutsock): log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+") speed = 100 # PROX will use different packet sizes as defined in sizes[] - sizes=[1400,1024,512,256,128,64] +# sizes=[1496,1020,508,252,124,60] + sizes=[1020,508,252,124,60] for size in sizes: #speed = 100 Commented out: Not starting from 100% since we are trying smaller packets, so speed will not be higher than the speed achieved in previous loop gensock.reset_stats() @@ -319,22 +356,30 @@ def run_sizetest(gensock,sutsock): gensock.set_value(gencores,0,16,(size-18),2) # 18 is the difference between the frame size and IP size = size of (MAC addresses, ethertype and FCS) gensock.set_value(gencores,0,38,(size-38),2) # 38 is the difference between the frame size and UDP size = 18 + size of IP header (=20) # This will only work when using sending UDP packets. For different protocls and ehternet types, we would need a differnt calculation - while (speed > 0.1): + endpps_sut_tx_str = 'NO_RESULTS' + maxspeed = speed + minspeed = 0 + while (maxspeed-minspeed > 1): print(str(size)+' bytes: Measurement ongoing at speed: ' + str(round(speed,2)) + '% ',end='\r') sys.stdout.flush() # Start generating packets at requested speed (in % of a 10Gb/s link) gensock.speed(speed, gencores) - time.sleep(1) # Get statistics now that the generation is stable and NO ARP messages any more pps_req_tx,pps_tx,pps_sut_tx_str,pps_rx,lat_avg = run_iteration(gensock,sutsock) drop_rate = get_drop_rate(speed,pps_rx,size) - if ((drop_rate) < 1): - # This will stop the test when number of dropped packets is below a certain percentage - log.info('|{:>7}'.format(str(size))+" | "+ '{:>14}'.format(str(round(speed,2))) + '% | '+ '{:>9}'.format(str(pps_req_tx))+' Mpps | '+ '{:>9}'.format(str(pps_tx)) +' Mpps | ' + '{:>9}'.format(pps_sut_tx_str) +' Mpps | '+ '{:>9}'.format(str(pps_rx))+" Mpps |"+ '{:>10}'.format(str(lat_avg))+" us |") - log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+") - break - speed = new_speed(speed,drop_rate) - time.sleep(2) + if (drop_rate < DROP_RATE_TRESHOLD): + endspeed = speed + endpps_req_tx = pps_req_tx + endpps_tx = pps_tx + endpps_sut_tx_str = pps_sut_tx_str + endpps_rx = pps_rx + endlat_avg = lat_avg + speed,minspeed,maxspeed = new_speed(speed,minspeed,maxspeed,drop_rate) + if endpps_sut_tx_str <> 'NO_RESULTS': + log.info('|{:>7d}'.format(size+4)+" | "+ '{:>10.2f}'.format(get_pps(endspeed,size)) + ' Mpps | '+ '{:>9.2f}'.format(endpps_req_tx)+' Mpps | '+ '{:>9.2f}'.format(endpps_tx) +' Mpps | ' + '{:>9}'.format(endpps_sut_tx_str) +' Mpps | '+ '{:>9.2f}'.format(endpps_rx)+' Mpps | '+ '{:>9.0f}'.format(endlat_avg)+' us | {:>7.1f}%'.format(speed)) + log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+") + else: + log.debug('|{:>7}'.format(str(size))+" | Speed 0 or close to 0") def run_irqtest(sock): log.info("+----------------------------------------------------------------------------------------------------------------------------") @@ -383,6 +428,8 @@ global genstatcores global latcores global gencores global irqcores +global DROP_RATE_TRESHOLD +DROP_RATE_TRESHOLD = 1 vmDPIP =[] vmAdminIP =[] vmDPmac =[] @@ -394,7 +441,7 @@ testconfig = ConfigParser.RawConfigParser() testconfig.read(test+'.test') required_number_of_VMs = testconfig.get('DEFAULT', 'total_number_of_vms') config = ConfigParser.RawConfigParser() -config.read(stack+'.env') +config.read(env+'.env') key = config.get('OpenStack', 'key') total_number_of_VMs = config.get('rapid', 'total_number_of_VMs') if int(required_number_of_VMs) > int(total_number_of_VMs): |