diff options
-rwxr-xr-x | scripts/dpdk_setup_ports.py | 188 | ||||
-rwxr-xr-x | signedoff/danklein | 135 | ||||
-rwxr-xr-x | src/bp_sim.cpp | 29 | ||||
-rwxr-xr-x | src/bp_sim.h | 12 | ||||
-rw-r--r-- | src/main_dpdk.cpp | 199 |
5 files changed, 363 insertions, 200 deletions
diff --git a/scripts/dpdk_setup_ports.py b/scripts/dpdk_setup_ports.py index 5e3e9a3f..58d58690 100755 --- a/scripts/dpdk_setup_ports.py +++ b/scripts/dpdk_setup_ports.py @@ -16,7 +16,7 @@ from distutils.util import strtobool import getpass class ConfigCreator(object): - mandatory_interface_fields = ['Slot_str', 'src_mac', 'dest_mac', 'Device_str', 'NUMA'] + mandatory_interface_fields = ['Slot_str', 'Device_str', 'NUMA'] _2hex_re = '[\da-fA-F]{2}' mac_re = re.compile('^({0}:){{5}}{0}$'.format(_2hex_re)) @@ -82,7 +82,7 @@ class ConfigCreator(object): interfaces_per_numa = defaultdict(int) for i in range(0, len(self.interfaces), 2): if self.interfaces[i]['NUMA'] != self.interfaces[i+1]['NUMA'] and not ignore_numa: - raise DpdkSetup('NUMA of each pair of interfaces should be same, got NUMA %s for client interface %s, NUMA %s for server interface %s' % + raise DpdkSetup('NUMA of each pair of interfaces should be the same. Got NUMA %s for client interface %s, NUMA %s for server interface %s' % (self.interfaces[i]['NUMA'], self.interfaces[i]['Slot_str'], self.interfaces[i+1]['NUMA'], self.interfaces[i+1]['Slot_str'])) interfaces_per_numa[self.interfaces[i]['NUMA']] += 2 self.lcores_per_numa = lcores_per_numa @@ -99,6 +99,25 @@ class ConfigCreator(object): return ', '.join([('0x%s' % elem).lower() for elem in mac_string.split(':')]) @staticmethod + def _exit_if_bad_ip(ip): + if not ConfigCreator._verify_ip(ip): + print("Got bad IP %s" % ip) + sys.exit(1) + + @staticmethod + def _verify_ip(ip): + a = ip.split('.') + if len(a) != 4: + return False + for x in a: + if not x.isdigit(): + return False + i = int(x) + if i < 0 or i > 255: + return False + return True + + @staticmethod def _verify_devices_same_type(interfaces_list): Device_str = interfaces_list[0]['Device_str'] for interface in interfaces_list: @@ -121,12 +140,18 @@ class ConfigCreator(object): config_str += ' zmq_rpc_port: %s\n' % self.zmq_rpc_port config_str += ' port_info:\n' for index, interface in enumerate(self.interfaces): - config_str += ' '*6 + '- dest_mac: [%s]' % self._convert_mac(interface['dest_mac']) - if interface.get('loopback_dest'): - config_str += " # MAC OF LOOPBACK TO IT'S DUAL INTERFACE\n" + if 'ip' in interface: + self._exit_if_bad_ip(interface['ip']) + self._exit_if_bad_ip(interface['def_gw']) + config_str += ' '*6 + '- ip: %s\n' % interface['ip'] + config_str += ' '*8 + 'default_gw: %s\n' % interface['def_gw'] else: - config_str += '\n' - config_str += ' '*8 + 'src_mac: [%s]\n' % self._convert_mac(interface['src_mac']) + config_str += ' '*6 + '- dest_mac: [%s]' % self._convert_mac(interface['dest_mac']) + if interface.get('loopback_dest'): + config_str += " # MAC OF LOOPBACK TO IT'S DUAL INTERFACE\n" + else: + config_str += '\n' + config_str += ' '*8 + 'src_mac: [%s]\n' % self._convert_mac(interface['src_mac']) if index % 2: config_str += '\n' # dual if barrier if not self.ignore_numa: @@ -399,11 +424,11 @@ Other network devices cpu_topology[numa][core] = [] cpu_topology[numa][core].append(int(lcore_dict['processor'])) if not cpu_topology: - raise DpdkSetup('Cound not determine CPU topology from %s' % cpu_topology_file) + raise DpdkSetup('Could not determine CPU topology from %s' % cpu_topology_file) return cpu_topology # input: list of different descriptions of interfaces: index, pci, name etc. - # binds to dpdk not bound to any driver wanted interfaces + # Binds to dpdk wanted interfaces, not bound to any driver. # output: list of maps of devices in dpdk_* format (self.m_devices.values()) def _get_wanted_interfaces(self, input_interfaces): if type(input_interfaces) is not list: @@ -451,17 +476,47 @@ Other network devices self.run_dpdk_lspci() wanted_interfaces = self._get_wanted_interfaces(map_driver.args.create_interfaces) + ips = map_driver.args.ips + def_gws = map_driver.args.def_gws dest_macs = map_driver.args.dest_macs + if ips: + ip_config = True + if not def_gws: + print("If specifying ips, must specify also def-gws") + sys.exit(1) + if dest_macs: + print("If specifying ips, should not specify dest--macs") + sys.exit(1) + if len(ips) != len(def_gws) or len(ips) != len(wanted_interfaces): + print("Number of given IPs should equal number of given def-gws and number of interfaces") + sys.exit(1) + else: + if dest_macs: + ip_config = False + else: + ip_config = True + for i, interface in enumerate(wanted_interfaces): - if 'MAC' not in interface: - raise DpdkSetup('Cound not determine MAC of interface: %s. Please verify with -t flag.' % interface['Interface_argv']) - interface['src_mac'] = interface['MAC'] - if isinstance(dest_macs, list) and len(dest_macs) > i: - interface['dest_mac'] = dest_macs[i] dual_index = i + 1 - (i % 2) * 2 - if 'dest_mac' not in wanted_interfaces[dual_index]: - wanted_interfaces[dual_index]['dest_mac'] = interface['MAC'] # loopback - wanted_interfaces[dual_index]['loopback_dest'] = True + if ip_config: + if isinstance(ips, list) and len(ips) > i: + interface['ip'] = ips[i] + else: + interface['ip'] = ".".join(list(str(i+1))*4) + if isinstance(def_gws, list) and len(def_gws) > i: + interface['def_gw'] = def_gws[i] + else: + interface['def_gw'] = ".".join(list(str(dual_index+1))*4) + else: + if 'MAC' not in interface: + raise DpdkSetup('Could not determine MAC of interface: %s. Please verify with -t flag.' % interface['Interface_argv']) + interface['src_mac'] = interface['MAC'] + if isinstance(dest_macs, list) and len(dest_macs) > i: + interface['dest_mac'] = dest_macs[i] + + if 'dest_mac' not in wanted_interfaces[dual_index]: + wanted_interfaces[dual_index]['dest_mac'] = interface['MAC'] # loopback + wanted_interfaces[dual_index]['loopback_dest'] = True config = ConfigCreator(self._get_cpu_topology(), wanted_interfaces, include_lcores = map_driver.args.create_include, exclude_lcores = map_driver.args.create_exclude, only_first_thread = map_driver.args.no_ht, ignore_numa = map_driver.args.ignore_numa, @@ -473,22 +528,22 @@ Other network devices cpu_topology = self._get_cpu_topology() total_lcores = sum([len(lcores) for cores in cpu_topology.values() for lcores in cores.values()]) if total_lcores < 1: - print('Script could not determine cores of the system, exiting.') + print('Script could not determine number of cores of the system, exiting.') sys.exit(1) elif total_lcores < 2: - if dpdk_nic_bind.confirm("You have only 1 core and can't run TRex at all. Ignore and continue? (y/N): "): + if dpdk_nic_bind.confirm("You only have 1 core and can't run TRex at all. Ignore and continue? (y/N): "): ignore_numa = True else: sys.exit(1) elif total_lcores < 3: - if dpdk_nic_bind.confirm("You have only 2 cores and will be able to run only Stateful without latency checks.\nIgnore and continue? (y/N): "): + if dpdk_nic_bind.confirm("You only have 2 cores and will be able to run only stateful without latency checks.\nIgnore and continue? (y/N): "): ignore_numa = True else: sys.exit(1) if not self.m_devices: self.run_dpdk_lspci() dpdk_nic_bind.show_table() - print('Please choose even number of interfaces either by ID or PCI or Linux IF (look at columns above).') + print('Please choose even number of interfaces from the list above, either by ID , PCI or Linux IF') print('Stateful will use order of interfaces: Client1 Server1 Client2 Server2 etc. for flows.') print('Stateless can be in any order.') numa = None @@ -496,11 +551,11 @@ Other network devices if numa is None: numa = dev['NUMA'] elif numa != dev['NUMA']: - print('Try to choose each pair of interfaces to be on same NUMA within the pair for performance.') + print('For performance, try to choose each pair of interfaces to be on the same NUMA.') break while True: try: - input = dpdk_nic_bind.read_line('Enter list of interfaces in line (for example: 1 3) : ') + input = dpdk_nic_bind.read_line('Enter list of interfaces separated by space (for example: 1 3) : ') create_interfaces = input.replace(',', ' ').replace(';', ' ').split() wanted_interfaces = self._get_wanted_interfaces(create_interfaces) ConfigCreator._verify_devices_same_type(wanted_interfaces) @@ -516,10 +571,17 @@ Other network devices if not dpdk_nic_bind.confirm('Ignore and continue? (y/N): '): sys.exit(1) + if dpdk_nic_bind.confirm("By default, IP based configuration file will be created. Do you want to change to MAC based config? (y/N)"): + ip_based = False + else: + ip_based = True + ip_addr_digit = 1 + for i, interface in enumerate(wanted_interfaces): - if 'MAC' not in interface: - raise DpdkSetup('Cound not determine MAC of interface: %s. Please verify with -t flag.' % interface['Interface_argv']) - interface['src_mac'] = interface['MAC'] + if not ip_based: + if 'MAC' not in interface: + raise DpdkSetup('Could not determine MAC of interface: %s. Please verify with -t flag.' % interface['Interface_argv']) + interface['src_mac'] = interface['MAC'] dual_index = i + 1 - (i % 2) * 2 dual_int = wanted_interfaces[dual_index] if not ignore_numa and interface['NUMA'] != dual_int['NUMA']: @@ -529,25 +591,53 @@ Other network devices print('') else: return - dest_mac = dual_int['MAC'] - loopback_dest = True - print("For interface %s, assuming loopback to it's dual interface %s." % (interface['Interface_argv'], dual_int['Interface_argv'])) - if dpdk_nic_bind.confirm("Destination MAC is %s. Change it to MAC of DUT? (y/N)." % dest_mac): - while True: - input_mac = dpdk_nic_bind.read_line('Please enter new destination MAC of interface %s: ' % interface['Interface_argv']) - try: - if input_mac: - ConfigCreator._convert_mac(input_mac) # verify format - dest_mac = input_mac - loopback_dest = False + + if ip_based: + loopback_dest = True + if ip_addr_digit % 2 == 0: + dual_ip_digit = ip_addr_digit - 1 + else: + dual_ip_digit = ip_addr_digit + 1 + ip = ".".join(list(str(ip_addr_digit))*4) + def_gw= ".".join(list(str(dual_ip_digit))*4) + ip_addr_digit += 1 + + print("For interface %s, assuming loopback to it's dual interface %s." % (interface['Interface_argv'], dual_int['Interface_argv'])) + if dpdk_nic_bind.confirm("Putting IP %s, default gw %s Change it?(y/N)." % (ip, def_gw)): + while True: + ip = dpdk_nic_bind.read_line('Please enter IP address for interface %s: ' % interface['Interface_argv']) + if not ConfigCreator._verify_ip(ip): + print ("Bad IP address format") + else: + break + while True: + def_gw = dpdk_nic_bind.read_line('Please enter default gateway for interface %s: ' % interface['Interface_argv']) + if not ConfigCreator._verify_ip(def_gw): + print ("Bad IP address format") else: - print('Leaving the loopback MAC.') - except Exception as e: - print(e) - continue - break - wanted_interfaces[i]['dest_mac'] = dest_mac - wanted_interfaces[i]['loopback_dest'] = loopback_dest + break + wanted_interfaces[i]['ip'] = ip + wanted_interfaces[i]['def_gw'] = def_gw + else: + dest_mac = dual_int['MAC'] + loopback_dest = True + print("For interface %s, assuming loopback to it's dual interface %s." % (interface['Interface_argv'], dual_int['Interface_argv'])) + if dpdk_nic_bind.confirm("Destination MAC is %s. Change it to MAC of DUT? (y/N)." % dest_mac): + while True: + input_mac = dpdk_nic_bind.read_line('Please enter new destination MAC of interface %s: ' % interface['Interface_argv']) + try: + if input_mac: + ConfigCreator._convert_mac(input_mac) # verify format + dest_mac = input_mac + loopback_dest = False + else: + print('Leaving the loopback MAC.') + except Exception as e: + print(e) + continue + break + wanted_interfaces[i]['dest_mac'] = dest_mac + wanted_interfaces[i]['loopback_dest'] = loopback_dest config = ConfigCreator(cpu_topology, wanted_interfaces, include_lcores = map_driver.args.create_include, exclude_lcores = map_driver.args.create_exclude, only_first_thread = map_driver.args.no_ht, ignore_numa = map_driver.args.ignore_numa or ignore_numa, @@ -634,7 +724,15 @@ To see more detailed info on interfaces (table): ) parser.add_argument("--dest-macs", nargs='*', default=[], action='store', - help="""Destination MACs to be used in created yaml file. Without them, will be assumed loopback (0<->1, 2<->3 etc.)""", + help="""Destination MACs to be used in created yaml file. Without them, will assume loopback (0<->1, 2<->3 etc.)""", + ) + + parser.add_argument("--ips", nargs='*', default=[], action='store', + help="""IP addresses to be used in created yaml file. Without them, will assume loopback (0<->1, 2<->3 etc.)""", + ) + + parser.add_argument("--def-gws", nargs='*', default=[], action='store', + help="""Default gateways to be used in created yaml file. Without them, will assume loopback (0<->1, 2<->3 etc.)""", ) parser.add_argument("-o", default=None, action='store', metavar='PATH', diff --git a/signedoff/danklein b/signedoff/danklein new file mode 100755 index 00000000..348bcf95 --- /dev/null +++ b/signedoff/danklein @@ -0,0 +1,135 @@ +I, Dan Klein hearby sign-off-by all of my past commits to this repo subject to the Developer Certificate of Origin (DCO), Version 1.1. In the past I have used emails: danklei@cisco.com, danklei@csi-kiwi-03.cisco.com, danklei@danklei-WS04.cisco.com, danklein10@gmail.com. + +My contributions were: + + 3bafb0394c07ef2abb4ce34c7fb4ec01eb09f2df - Dan Klein - danklein10@gmail.com - All unit tests passes with both python 2 and python 3. + 330cf8f7950027efe7b4bbc96a7ee1af3ee0b10a - Dan Klein - danklein10@gmail.com - basic modifications for TRex tui to support toggle filtering on ports + 9e63f57a80722751221e18ae1e42a7f7ac4983ab - Dan Klein - danklein10@gmail.com - added multiple toggle option all test passed! + 6adf866fc403829d5e24603280c6c6917b9fc357 - Dan Klein - danklein10@gmail.com - fixed import issue in test (ugly fix for now) + 195e4bda54d8fd49936213a8f28349b96fb5acd2 - Dan Klein - danklein10@gmail.com - added filters.py ToggleFilter functionality, and its test file + 859a72101c94a26296efcc713882b472caf6ff8e - Dan Klein - danklein10@gmail.com - minor updates + 8e037c2bd51844dc7c42ce7b2339806d9dcb964b - Dan Klein - danklein10@gmail.com - Merge branch 'dan_stateless' + 9fc980b8aa43cf53446eeeb5184f10a86476da28 - Dan Klein - danklein10@gmail.com - Working version of streams view in TRex console. TODO: sync when console crashes isn't integrated yet + 629b54c4c9df9c718d818a004ecf15c2cf6c770a - Dan Klein - danklein10@gmail.com - Merge branch 'master' into dan_stateless + 3757099103ed1bf56f85ccf5bb861a331287cbbb - Dan Klein - danklein10@gmail.com - updated stats + 4ca24cf31919870a684fe78f17c856e0d220e6d5 - Dan Klein - danklein10@gmail.com - Merge branch 'master' into dan_stateless + a7967979b47845a1736e734c1c16f5929ae6fd48 - Dan Klein - danklein10@gmail.com - cleaned the code a little, added load_packet_from_pcap into packet builder functionality. + 1895d21485621c3428d045fa0f5b9daf165c8260 - Dan Klein - danklein10@gmail.com - clear command now works as well.. + 503c10b024aa2ed6d4d8dc7fb5debf4a64bd9b1e - Dan Klein - danklein10@gmail.com - Re-designed the statistic building model based on agreed diagram. WORKING: all polling stats + a609111bc37ef88f14d4f2ebf7cd186b04b86402 - Dan Klein - danklein10@gmail.com - Supports all desired stats option, plus clearing option + 4486f9863e7f541ce5b6b4ff2bce6c6f7c41fcd2 - Dan Klein - danklein10@gmail.com - Merge branch 'master' into dan_stateless + 91f6c24f45cbb0cbf8568a9938059a1a934e6ae6 - Dan Klein - danklein10@gmail.com - Initial implementation of stats prompting + e7cb8b0f6c2fbe08d2086a7408040ac7d12aee5a - Dan Klein - danklein10@gmail.com - Merge branch 'master' into dan_stateless + 84e9d7a4a8bbb3afb4861652e2d56bc27097f794 - Dan Klein - danklein10@gmail.com - History feature is DONE Fixed bugs Cleaned code, more like PEP8 + bb6dec2ed238069b6a0c079d2031246704b717c4 - Dan Klein - danklein10@gmail.com - created general trex console class added dynamic server async support fixed bugs + d04fb533c0843ebcd3eac5fbefa6f418582db7fc - Dan Klein - danklein10@gmail.com - Major progress in parsing, not stable yet Most advanced: start, stop functionality + f6b521fb76e74036c626c10f6ae11ea525ac97b7 - Dan Klein - danklei@cisco.com - Merge remote-tracking branch 'origin/rpc_intg1' into rpc_intg1 + 953a250e6cbaea3040920e7441d2d019705efe51 - Dan Klein - danklei@cisco.com - Extended line parsing options, didn't apply all changes on console YET + 36a9677c0abc038235e7bf706cb2b3dc9e720284 - Dan Klein - danklein10@gmail.com - added custom line parsing class and methods + 1be6a146c9dfaf599528e8fde151c25b0bc9cb70 - Dan Klein - danklein10@gmail.com - Merge remote-tracking branch 'origin/rpc_intg1' into rpc_intg1 + 597f74d8ed10abc3dd9df7e81ecea5ac2f5c714e - Dan Klein - danklein10@gmail.com - updated sync_client + c5078068c4659f5445d9c684c67b55ee2c7e10d6 - Dan Klein - danklein10@gmail.com - Merge branch 'rpc_intg1' into dan_stateless + 0ceddc74c938a023c515be4ed2c37198fd66e87e - Dan Klein - danklein10@gmail.com - first commit for advnaced options + 274bca264036d9cf01b9fcbbb3923b0f28654d82 - Dan Klein - danklein10@gmail.com - Added parsing file for console advanced options + 2636c09cfb74c7981c27d84bcc72d00929fdbbbb - Dan Klein - danklei@cisco.com - Fixed verbose mode More stability fixes removed irrelevand methods + d78150a66de591a77df2496e5de828d3232a931a - Dan Klein - danklei@cisco.com - Awesome working start/stop traffic console Fixed more stability issues :) Ready for merging. + 13c353b9e4f3f0177458c5bef729de31ec03135d - Dan Klein - danklei@cisco.com - fixed console issues after testsing them + aa37a0abb00cbf4cb1611f9c0eefcb1ab850bc45 - Dan Klein - danklein10@gmail.com - Console redesign using trex_stateless_client module + 5377774afbf00b0da0ad0b74d3be207f6eb9124e - Dan Klein - danklein10@gmail.com - Added module for text formatting, such that coloring, bold, underline. + f963facdc949c087c863b8ad81aae537bcf3767b - Dan Klein - danklei@cisco.com - console progress, still SHAKY! + 0c2b3c83f9cc0c25277c39660dce132aad55c3d7 - Dan Klein - danklei@cisco.com - updated more HLTAPI functionality and fixed found bugs. Working: Start/stop traffic, traffic config (semi), connect, clean Missing: stats Next: boost console + fe6e03366eae72376f1201ed68744cb1206773de - Dan Klein - danklein10@gmail.com - more HLTAPI 2 + 3bebf60874ec07d157944088ee3cfd5909eccc0f - Dan Klein - danklei@cisco.com - More HLTAPI + d2453a6b449762b478975418289dfcfc51dcc395 - Dan Klein - danklei@cisco.com - more HLTAPI + a39e4416cd78fc3b147695465c4de1c896b3face - Dan Klein - danklei@cisco.com - more hltapi progress connect working + 4290a0982d510a40e0bb789279c1acd4d2530d6f - Dan Klein - danklei@cisco.com - returning the fix of doc building + d00cf78cdfe093a8e72db48897f700a3ef1d1caa - Dan Klein - danklei@cisco.com - remove fix to test for trex_doc failure + b44239e4c6019f10fa7cf4fe0fef8c3726435033 - Dan Klein - danklei@cisco.com - add disconnect functionality + de90762476583bed8c3a2c1e15158b85e4231ad0 - Dan Klein - danklei@cisco.com - fixed streamlist loading + 7c35235f67b009cb2a9a605c3c89ea39d6f10871 - Dan Klein - danklei@cisco.com - refactor tx_link -> comm_link + 18f99983b868cba14795cce8a8b3a54328ddaab7 - Dan Klein - danklei@cisco.com - Merge branch 'master' into dan_stateless + ebb0b48faca96bad7bfe8da0bf80df7c7c80350d - Dan Klein - danklein10@gmail.com - HLTAPI progress... + ed13067343186b5dad0566962cd308445136f3b7 - Dan Klein - danklei@cisco.com - Fixed importing of packages at documentation building + a2a634fc8b5bac450ea37f29dde521b7d9e740c8 - Dan Klein - danklei@cisco.com - minor updates + f5c4a8051d697c086eb0d1c8ce3ac90ab245d249 - Dan Klein - danklei@cisco.com - Merge branch 'master' into dan_stateless + 876c76572fdb2fb8f0e8db21bc420d284dc05950 - Dan Klein - danklei@cisco.com - Added support for path autocomletion for console methods :) + a55f587db49728685ed5acb6aa906aad01035da2 - Dan Klein - danklei@cisco.com - Merge remote-tracking branch 'origin/master' + 014c1c1757873bbe2b9a9a0d635cb65ea55b67ab - Dan Klein - danklei@cisco.com - Merge branch 'master-demo' + 5abe21ffb26a15c2a63e90b5628d704e8211b599 - Dan Klein - danklei@cisco.com - + Added traffic options at stl directory + updated console to support multiplier on loading + fixed minor issues at yaml_utils and trex_streams objects + console not stable, YET + cf753587ffb7b89cff1863c74ca334b8c41fd0c0 - Dan Klein - danklei@cisco.com - Merge branch 'master' into master-demo + working demo of loading a YAML, and attaching it to server + d09df99769f67819c64a7a025dbdcd39811c7b44 - Dan Klein - danklei@cisco.com - Major progress in console, yaml utils, and trex_streams basically done, minor changes remianing BIG ISSUE LEFT: rewire console to work with trexstateless client module + 80bd7895112cba0b3cbb6d56995def6ffbdccf33 - Dan Klein - danklei@cisco.com - Progress in trex_streams and in yaml_utils. Next, start working on StreamList object + 4a8d34c7548e85e97426bc1d85c670003b1f5870 - Dan Klein - danklein10@gmail.com - more yaml utils, better streams handling + 2c38ad7f49fbddfdc75c150cbb2abdd54e3ede52 - Dan Klein - danklei@cisco.com - Updated YAMLutils and rpc_defaults with relevant progress + 0c5a4348a31e0e8d76dd1fcf378cb2c0a2867f59 - Dan Klein - danklein10@gmail.com - updated yaml utils and stream object + 2dd1a4d85c559ddafe695b6d6d393ee086e1a3de - Dan Klein - danklei@cisco.com - merged jsonrpc client for mock compatibility + 22cab506c9df614f6f74fd3641b1ec8cf084370b - Dan Klein - danklei@cisco.com - Merge branch 'dan_stateless' + 4c797902441d1c61fc9012f56ecf95e17cb26110 - Dan Klein - danklei@cisco.com - Merge remote-tracking branch 'origin/master' + 508703e11a3fad3e44535c5433f803d77f28e245 - Dan Klein - danklei@cisco.com - Fixed trex bugs in Ubuntu disctribution (Firing trex-daemon server) and unresolved domain name handling. + 0951a3e74be22db8726781aae98531668d946656 - Dan Klein - danklei@cisco.com - merged with master + 7482f09b8a5e8945e8b735233ad8f1674e637aef - Dan Klein - danklei@cisco.com - cosmetics + a9ead5815d40dfe42651f6ff2140c94535b6a703 - Dan Klein - danklei@cisco.com - solving conflicts + bd640666c052a1c770c9c1758c809f68d99af010 - Dan Klein - danklei@cisco.com - solving conflicts + 47111637f4989f82fb8ed2dab6240efb5b12713f - Dan Klein - danklei@cisco.com - Merge branch 'master' into dan_latest + 63318b05c360872ccd6d6348a6818ca2929927c9 - Dan Klein - danklei@cisco.com - fixed documentation conflicts + fba9663980d600d9c54c90f5ebd4afc346a007db - Dan Klein - danklei@cisco.com - Merge branch 'dan_stateless' into dan_latest + e6bf849809c1ff84eb887973576611f2457774eb - Dan Klein - danklei@cisco.com - named with nametuples the returnvalue of the "send_raw_msg" method. + a9f60d36e81c25244dad8f4f4c985f1e8e368c7c - Dan Klein - danklei@cisco.com - Updated handlers of getter methods and stats (Global, port, stream). Also, set return values of RPC commands as namedtuples + d1065266e17e514dab4aec87abab729a518cdf26 - Dan Klein - danklein10@gmail.com - Applied some code cosmetics + 086dac9854b9711cebf73d392973cae9358b6b0e - Dan Klein - danklein10@gmail.com - More progress in stateless client. Mainly more mature approach to handling results + c3ced9cd49c609d8a25933012f9aa2e5db9298d9 - Dan Klein - danklein10@gmail.com - Applied port validity on port_id relevant methods + 4f286bfefa6bbb0be4cdcf1fb004c82fc334c21f - Dan Klein - danklein10@gmail.com - progress in TRexStatelessClient module + bafc3ec4b2686cdec4ac1c33f69f7607f368d4ce - Dan Klein - danklein10@gmail.com - updated stats handling implementation + c27d9bf5bc25a1a9e063ca076ce2e99c02dfe31e - Dan Klein - danklein10@gmail.com - Incorporating batch commands in stateless client + 2b5c0e9fc7482584d2259a7f79496ea86bcf4b5a - Dan Klein - danklei@cisco.com - progress in stateless client, added trex_stats + 54fb5cd69e0166073acac1eec08bd29341dbd6be - Dan Klein - danklei@cisco.com - Merge branch 'master' into dan_stateless + 25c528e867b13d8ddaee19f208ddedd8a2e505ca - Dan Klein - danklei@cisco.com - removed any T-Rex string in doc + ada8c62d7393e22cee7fccf9eb1b16b8ebe3c7c8 - Dan Klein - danklei@cisco.com - Removed any "T-Rex" string out of the code and documentation, using GREP! + 9629c9953516281d4bdaad1ed63d145de336a983 - Dan Klein - danklein10@gmail.com - Commiting last night progress + c7ba20f4f7c4521fdf50238c7e4ccc50f13b248e - Dan Klein - danklei@cisco.com - Updated packet export doc + 1c43d1c6eb10ccff6b26fac6d3588bb5a1439997 - Dan Klein - danklei@cisco.com - Updated implementation for packet_builder module + e4484262bbe2566fc1123e399504627a8757fb20 - Dan Klein - danklei@cisco.com - Updated sshpass file to avoid creation of daemon processes + 16e3b19016a0d6e63d9162040811de4386142af0 - Dan Klein - danklei@cisco.com - Updated and added documentation files for packet builder module + 7e1bf3602241fb881531965813c0b6ad09790bee - Dan Klein - danklei@cisco.com - Replaced "outer_packages" with "external_packages" to avoid naming collision + 2af9cd559d9c86e42824e920b5d9168584216e86 - Dan Klein - danklei@cisco.com - Updated .gitignore file to avoid _build compiled documentation + ca479ac9bb1e4d1a5953e9d121ab39a29f7b8b8e - Dan Klein - danklein10@gmail.com - Updated control plain documentation with typos and T-Rex changed to TRex. + 6f12f984a9ef37997a9dd614e2d7436ee1f9875a - Dan Klein - danklei@cisco.com - Merge branch 'master' into dan_latest + ddad1117a1bdc616eb1a5fc4e4e5ef2b8dcf6938 - Dan Klein - danklei@cisco.com - Added dedicated import for enum module in order to overcome doc building import error + c18c5a17ba84e0d30b0ce70b196210c7432f15b4 - Dan Klein - danklei@cisco.com - Merge branch 'dan_latest' (initial fix for doc building bug) + c5280c6866004bd3ff3969a888f8d19557a4e92f - Dan Klein - danklei@cisco.com - updated .gitignore file to ignore control-plane build files + 4651405f6870e31a71b679f30a6ea2d433879d41 - Dan Klein - danklei@cisco.com - Basically finished (minor touches remaining) all VM instructions implementation + 46d15e627e46af8816c061ad33301a8e6a7aab95 - Dan Klein - danklei@cisco.com - cosmetics... + ed46f126c90da83929625a89b5438a11f0e75401 - Dan Klein - danklei@cisco.com - Cosmetics over packet builder module + 186ca35e6ceabfeea7c0899a5ad50158f669243f - Dan Klein - danklein10@gmail.com - Finished implementing the ranging VM of IP Eth and custom fields + 281e2eaaea59bcfa7a0b67dcc3fcbd92a1e11d8c - Dan Klein - danklein10@gmail.com - Progress in ip_range methods + fb408d1f3a92edeb74b86f94aa2dddf5a0743513 - Dan Klein - danklein10@gmail.com - Finished writing infra layer of all VM instructions + b3ac7facbbbc4815388298534fdfdd161ce89534 - Dan Klein - danklei@cisco.com - updated packet builder and stateless client modules + 2965b8f7e7ca924af9ce6d30b2c0b586ec3e21c5 - Dan Klein - danklein10@gmail.com - Updated implementation of add_stream method, created subclasses to reflect vairous objects. + 20a7b8ed2a75debc3f2015d571fb4faf2cfc8b13 - Dan Klein - danklei@cisco.com - minor updated to client API library, adding the CRxStats class + 29de5a33617b44c79982670a984ba46ec0e3a8d8 - Dan Klein - danklei@cisco.com - temporary interactive stateless shell + 28fef018f75b5a54ac69ac7c919127bf47f5b61f - Dan Klein - danklei@csi-kiwi-03.cisco.com - Pushed Stateless progress (along with Packet Builder module) + 56dbd342eb97fc087611157ce8e965088b7f9bf8 - Dan Klein - danklei@cisco.com - Major progress in the packet builder module. Now able to create packets, dump them to JSON of pcap and more features added + ef520c7e3a18aeefe02ba0d3e6b16fafde3c1b91 - Dan Klein - danklei@cisco.com - Major progress in Packet building module and VM instruction sets. added dot1q into dpkt lib First abstractino of HLTAPI layer + 760710869405dbc3b5dadd6ce06015c72ea2ca44 - Dan Klein - danklei@cisco.com - another stateless progress + 68df86e2005dc4693b1270a3e663e2450f81fa93 - Dan Klein - danklei@cisco.com - progress in packet builder module + c2154c0d362ced8f8b5181799c369e1497c958e1 - Dan Klein - danklei@cisco.com - reverting to dpkt v1.8.6 instead of 1.8.6.2 to avoid importing error of pystone modue + f8ac9d14a989c8cf1535e16165551dfa370b0b74 - Dan Klein - danklei@cisco.com - Merge branch 'master' into dan_stateless + fc46f2618332037a8c1b58fbce5d616033bff1c9 - Dan Klein - danklei@cisco.com - Rearranged files and external libraries in two different locations, one for cpp (trex-core/external_libs) and one for python (trex-core/scripts/external_libs) + cdcc62972d42f009f55e6aeb2ca5c60c3acd75eb - Dan Klein - danklei@cisco.com - added dpkt package, initial stateless client implementation + 42053c95419042f36242b19d2416d112f7643e14 - Dan Klein - danklei@cisco.com - Merge branch 'master' into dan_stateless + a628a35b10fbd38211c353f506a8c49c2cc3dd7e - Dan Klein - danklei@cisco.com - Fixed compilation by commenting Itay's rpc-server build + cecaf28ab61882d323cb5f3d813518523f7e836b - Dan Klein - danklei@cisco.com - comment out itay's rpc module + 98bc71b1c21452c3d868c4a4d418a8aeaa5a43af - Dan Klein - danklei@cisco.com - Merge branch 'master' into dan_stateless + 7d3be8c612e295820649779335288c197b80ccb2 - Dan Klein - danklei@cisco.com - Changes location of console and fixed dependencies + dab741a80699f86e86c91718872a052cca9bbb25 - Dan Klein - danklei@cisco.com - Fixed dependencies of Control Plane to use external_lib sources + d3f26ece7d4383df0b22fe9c3cb3e695381ec737 - Dan Klein - danklei@cisco.com - Initial push to external_lib migration + 20eb7d362f9bce1951bd61ad3f78cf8f4267d1d5 - Dan Klein - danklei@cisco.com - Merge branch 'master' into dan_stateless + 651a7d779551e193bd9dbadbe8b2a02bdab231b4 - Dan Klein - danklei@cisco.com - Merge branch 'master' into dan_latest + 84bb24ace632141dd5ece01d5f4985239014f660 - Dan Klein - danklei@cisco.com - changed .gitignore files from idea editor files + 49f6b00b58c3ec734218fcd69259771a42c157bd - Dan Klein - danklei@cisco.com - Added dkpt package, created basic shell for packetGen usage + 405ba254de0c62ac9f4395d04f918a3749635808 - Dan Klein - danklei@danklei-WS04.cisco.com - Added another fix to client interactive example. + f66c121432494744adc75c7df0224326ab3aab4d - Dan Klein - danklein10@gmail.com - Fixed client interactive example of the Python API + 435c8e7f1fd8f4a20d6a0922c62ca520086f8a36 - Dan Klein - danklein10@gmail.com - Update README.asciidoc + 994e396f01588c6e256ce88d428766827bcee4d2 - Dan Klein - danklein10@gmail.com - Update README.asciidoc + a0eea87f97021b439b7d320fcd58336cd845173b - Dan Klein - danklein10@gmail.com - Update LICENSE + fb91da27645c143e527d474b716ad0b30e2b6b04 - Dan Klein - danklein10@gmail.com - Update LICENSE diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp index b276d4ff..c4cb0927 100755 --- a/src/bp_sim.cpp +++ b/src/bp_sim.cpp @@ -745,7 +745,6 @@ void CPreviewMode::Dump(FILE *fd){ fprintf(fd," single core : %d\n", (int)getSingleCore() ); fprintf(fd," flow-flip : %d\n", (int)getClientServerFlowFlip() ); fprintf(fd," no clean close : %d\n", (int)getNoCleanFlowClose() ); - fprintf(fd," 1g mode : %d\n", (int)get_1g_mode() ); fprintf(fd," zmq_publish : %d\n", (int)get_zmq_publish_enable() ); fprintf(fd," vlan_enable : %d\n", (int)get_vlan_mode_enable() ); fprintf(fd," client_cfg : %d\n", (int)get_is_client_cfg_enable() ); @@ -3223,7 +3222,6 @@ bool CNodeGenerator::Create(CFlowGenListPerThread * parent){ m_v_if =0; m_parent=parent; m_socket_id =0; - m_is_realtime =CGlobalInfo::is_realtime(); m_realtime_his.Create(); m_last_sync_time_sec = 0; @@ -3777,17 +3775,34 @@ inline int CNodeGenerator::flush_file_realtime(dsec_t max_time, cur_time = now_sec(); { dsec_t dt = cur_time - n_time ; - if (dt>0) { - state=scWORK; - if (dt > BURST_OFFSET_DTIME) { - handle_time_strech(cur_time, dt, offset, thread); - } + + if (dt > BURST_OFFSET_DTIME) { + state = scSTRECH; + } else if (dt > 0) { + state = scWORK; } else { state = scWAIT; } + } break; + /* a case called when a time strech happens */ + case scSTRECH: + { + dsec_t dt = cur_time - n_time; + handle_time_strech(cur_time, dt, offset, thread); + + /* re-read the top of the queue - it might have changed with messaging */ + node = m_p_queue.top(); + n_time = node->m_time + offset; + + /* go back to INIT */ + state = scINIT; + + } + break; + case scWORK: { int node_count = 0; diff --git a/src/bp_sim.h b/src/bp_sim.h index d28968f6..0af27b95 100755 --- a/src/bp_sim.h +++ b/src/bp_sim.h @@ -531,15 +531,7 @@ public: return (btGetMaskBit32(m_flags,25,25) ? true:false); } - - void set_1g_mode(bool enable){ - btSetMaskBit32(m_flags,26,26,enable?1:0); - } - - bool get_1g_mode(){ - return (btGetMaskBit32(m_flags,26,26) ? true:false); - } - + // bit 26 is free. Was deprecated option. void set_zmq_publish_enable(bool enable){ btSetMaskBit32(m_flags,27,27,enable?1:0); @@ -2032,6 +2024,7 @@ public: typedef enum { scINIT = 0x17, scWORK , scWAIT , + scSTRECH, scTERMINATE } sch_state_t; @@ -2161,7 +2154,6 @@ private: public: pqueue_t m_p_queue; socket_id_t m_socket_id; - bool m_is_realtime; CVirtualIF * m_v_if; CFlowGenListPerThread * m_parent; CPreviewMode m_preview_mode; diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index ef78738b..5cc5f3e9 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -504,14 +504,12 @@ enum { OPT_HELP, OPT_NODE_DUMP, OPT_DUMP_INTERFACES, OPT_UT, - OPT_FILE_OUT, - OPT_REAL_TIME, OPT_CORES, OPT_SINGLE_CORE, OPT_FLIP_CLIENT_SERVER, OPT_FLOW_FLIP_CLIENT_SERVER, OPT_FLOW_FLIP_CLIENT_SERVER_SIDE, - OPT_BW_FACTOR, + OPT_RATE_MULT, OPT_DURATION, OPT_PLATFORM_FACTOR, OPT_PUB_DISABLE, @@ -522,7 +520,6 @@ enum { OPT_HELP, OPT_NO_CLEAN_FLOW_CLOSE, OPT_LATENCY_MASK, OPT_ONLY_LATENCY, - OPT_1G_MODE, OPT_LATENCY_PREVIEW , OPT_WAIT_BEFORE_TRAFFIC, OPT_PCAP, @@ -562,9 +559,7 @@ static CSimpleOpt::SOption parser_options[] = { OPT_MODE_BATCH, "-f", SO_REQ_SEP}, { OPT_MODE_INTERACTIVE, "-i", SO_NONE }, { OPT_PLAT_CFG_FILE, "--cfg", SO_REQ_SEP}, - { OPT_REAL_TIME , "-r", SO_NONE }, { OPT_SINGLE_CORE, "-s", SO_NONE }, - { OPT_FILE_OUT, "-o" , SO_REQ_SEP}, { OPT_FLIP_CLIENT_SERVER,"--flip",SO_NONE }, { OPT_FLOW_FLIP_CLIENT_SERVER,"-p",SO_NONE }, { OPT_FLOW_FLIP_CLIENT_SERVER_SIDE,"-e",SO_NONE }, @@ -577,10 +572,9 @@ static CSimpleOpt::SOption parser_options[] = { OPT_DURATION , "-d", SO_REQ_SEP }, { OPT_PLATFORM_FACTOR , "-pm", SO_REQ_SEP }, { OPT_PUB_DISABLE , "-pubd", SO_NONE }, - { OPT_BW_FACTOR , "-m", SO_REQ_SEP }, + { OPT_RATE_MULT , "-m", SO_REQ_SEP }, { OPT_LATENCY_MASK , "--lm", SO_REQ_SEP }, { OPT_ONLY_LATENCY, "--lo", SO_NONE }, - { OPT_1G_MODE, "-1g", SO_NONE }, { OPT_LATENCY_PREVIEW , "-k", SO_REQ_SEP }, { OPT_WAIT_BEFORE_TRAFFIC , "-w", SO_REQ_SEP }, { OPT_PCAP, "--pcap", SO_NONE }, @@ -610,125 +604,71 @@ static CSimpleOpt::SOption parser_options[] = static int usage(){ - printf(" Usage: t-rex-64 [MODE] [OPTION] -f cfg.yaml -c cores \n"); - printf(" \n"); - printf(" \n"); + printf(" Usage: t-rex-64 [mode] <options>\n\n"); + printf(" mode is one of:\n"); + printf(" -f <file> : YAML file with traffic template configuration (Will run TRex in 'stateful' mode)\n"); + printf(" -i : Run TRex in 'stateless' mode\n"); + printf("\n"); - printf(" mode \n\n"); - printf(" -f [file] : YAML file with template configuration \n"); - printf(" -i : launch TRex in interactive mode (RPC server)\n"); - printf(" \n\n"); - - printf(" options \n\n"); - - printf(" --client_cfg [file] : YAML file which describes clients configuration\n"); - printf(" \n\n"); - printf(" -c [number of threads] : Default is 1. Number of threads to allocate for each port pair. \n"); - printf(" \n"); - printf(" -s : run only one data path core. for debug\n"); - printf(" \n"); - printf(" --flip : flow will be sent from client->server and server->client for maximum throughput \n"); - printf(" \n"); - printf(" -p : flow-flip , send all flow packets from the same interface base of client ip \n"); - printf(" -e : like -p but comply to the generator rules \n"); - - printf(" \n"); - printf(" -l [pkt/sec] : run latency daemon in this rate \n"); - printf(" e.g -l 1000 run 1000 pkt/sec from each interface , zero mean to disable latency check \n"); - printf(" --lm : latency mask \n"); - printf(" 0x1 only port 0 will send traffic \n"); - printf(" --lo :only latency test \n"); - - printf(" \n"); - - printf(" --limit-ports : limit number of ports, must be even e.g. 2,4 \n"); - printf(" \n"); - printf(" --nc : If set, will not wait for all the flows to be closed, terminate faster- see manual for more information \n"); - printf(" \n"); - printf(" -d : duration of the test in sec (default is 3600). look also at --nc \n"); - printf(" \n"); - printf(" -pm : platform factor ,in case you have splitter in the setup you can multiply the total results in this factor \n"); - printf(" e.g --pm 2.0 will multiply all the results bps in this factor \n"); - printf(" \n"); - printf(" -pubd : disable monitors publishers \n"); - - printf(" -m : factor of bandwidth \n"); - printf(" \n"); - printf(" --send-debug-pkt [proto] : Do not run traffic generator. Just send debug packet and dump receive queue."); - printf(" Supported protocols are 1 for icmp, 2 for UDP, 3 for TCP, 4 for ARP, 5 for 9K UDP\n"); - printf(" \n"); - printf(" -k [sec] : run latency test before starting the test. it will wait for x sec sending packet and x sec after that \n"); - printf(" \n"); - printf(" -w [sec] : wait between init of interfaces and sending traffic, default is 1\n"); - printf(" \n"); - - printf(" --cfg [platform_yaml] : load and configure platform using this file see example in cfg/cfg_examplexx.yaml file \n"); - printf(" this file is used to configure/mask interfaces cores affinity and mac addr \n"); - printf(" you can copy this file to /etc/trex_cfg.yaml \n"); - printf(" \n"); - - printf(" --ipv6 : work in ipv6 mode\n"); - printf(" --learn (deprecated). Replaced by --learn-mode. To get older behaviour, use --learn-mode 2\n"); - printf(" --learn-mode [1-3] : Work in NAT environments, learn the dynamic NAT translation and ALG \n"); - printf(" 1 Use TCP ACK in first SYN to pass NAT translation information. Will work only for TCP streams. Initial SYN packet must be first packet in stream.\n"); - printf(" 2 Add special IP option to pass NAT translation information. Will not work on certain firewalls if they drop packets with IP options\n"); - printf(" 3 Like 1, but without support for sequence number randomization in server->clien direction. Performance (flow/second) better than 1\n"); - printf(" --learn-verify : Learn the translation, but intended for verification of the mechanism in cases that NAT does not exist \n"); - printf(" \n"); - printf(" --l-pkt-mode [0-3] : Set mode for sending latency packets.\n"); + printf(" Available options are:\n"); + printf(" --allow-coredump : Allow creation of core dump \n"); + printf(" --arp-refresh-period : Period in seconds between sending of gratuitous ARP for our addresses. Value of 0 means 'never send' \n"); + printf(" -c <num>> : Number of hardware threads to allocate for each port pair. Overrides the 'c' argument from config file \n"); + printf(" --cfg <file> : Use file as TRex config file instead of the default /etc/trex_cfg.yaml \n"); + printf(" --checksum-offload : Enable IP, TCP and UDP tx checksum offloading, using DPDK. This requires all used interfaces to support this \n"); + printf(" --client_cfg <file> : YAML file describing clients configuration \n"); + printf(" --close-at-end : Call rte_eth_dev_stop and close at exit. Calling these functions caused link down issues in older versions, \n"); + printf(" so we do not call them by default for now. Leaving this as option in case someone thinks it is helpful for him \n"); + printf(" This it temporary option. Will be removed in the future \n"); + printf(" -d : Duration of the test in sec (default is 3600). Look also at --nc \n"); + printf(" -e : Like -p but src/dst IP will be chosen according to the port (i.e. on client port send all packets with client src and server dest, and vice versa on server port \n"); + printf(" --flip : Each flow will be sent both from client to server and server to client. This can acheive better port utilization when flow traffic is asymmetric \n"); + printf(" --hops <hops> : If rx check is enabled, the hop number can be assigned. See manual for details \n"); + printf(" --iom <mode> : IO mode for server output [0- silent, 1- normal , 2- short] \n"); + printf(" --ipv6 : Work in ipv6 mode \n"); + printf(" -k <num> : Run 'warm up' traffic for num seconds before starting the test. \n"); + printf(" -l <rate> : In parallel to the test, run latency check, sending packets at rate/sec from each interface \n"); + printf(" Rate of zero means no latency check \n"); + printf(" --learn (deprecated). Replaced by --learn-mode. To get older behaviour, use --learn-mode 2 \n"); + printf(" --learn-mode [1-3] : Work in NAT environments, learn the dynamic NAT translation and ALG \n"); + printf(" 1 Use TCP ACK in first SYN to pass NAT translation information. Will work only for TCP streams. Initial SYN packet must be first packet in stream \n"); + printf(" 2 Add special IP option to pass NAT translation information. Will not work on certain firewalls if they drop packets with IP options \n"); + printf(" 3 Like 1, but without support for sequence number randomization in server->clien direction. Performance (flow/second) better than 1 \n"); + printf(" --learn-verify : Test the NAT translation mechanism. Should be used when there is no NAT in the setup \n"); + printf(" --limit-ports : Limit number of ports used. Must be even number (TRex always uses port pairs) \n"); + printf(" --lm : Hex mask of cores that should send traffic \n"); + printf(" For example: Value of 0x5 will cause only ports 0 and 2 to send traffic \n"); + printf(" --lo : Only run latency test \n"); + printf(" --l-pkt-mode <0-3> : Set mode for sending latency packets \n"); printf(" 0 (default) send SCTP packets \n"); printf(" 1 Send ICMP request packets \n"); printf(" 2 Send ICMP requests from client side, and response from server side (for working with firewall) \n"); printf(" 3 Send ICMP requests with sequence ID 0 from both sides \n"); - printf(" -v [1-3] : verbose mode ( works only on the debug image ! ) \n"); - printf(" 1 show only stats \n"); - printf(" 2 run preview do not write to file \n"); - printf(" 3 run preview write stats file \n"); - printf(" Note in case of verbose mode you don't need to add the output file \n"); - printf(" \n"); - printf(" Warning : This program can generate huge-files (TB ) watch out! try this only on local drive \n"); - printf(" \n"); - printf(" \n"); - printf(" --rx-check [sample] : enable rx check thread, using this thread we sample flows 1/sample and check order,latency and more \n"); - printf(" this feature consume another thread \n"); - printf(" \n"); - printf(" --hops [hops] : If rx check is enabled, the hop number can be assigned. The default number of hops is 1\n"); - printf(" --iom [mode] : io mode for interactive mode [0- silent, 1- normal , 2- short] \n"); - printf(" this feature consume another thread \n"); - printf(" \n"); - printf(" --close-at-end : Call rte_eth_dev_stop and close at exit. Calling these functions caused link down issues in older versions,\n"); - printf(" so we do not call them by default for now. Leaving this as option in case someone thinks it is helpful for him\n"); - printf(" This it temporary option. Will be removed in the future.\n"); - printf(" --no-key : daemon mode, don't get input from keyboard \n"); - printf(" --no-flow-control-change : By default TRex disables flow-control. If this option is given, it does not touch it\n"); - printf(" --prefix : For multi trex, each instance should have a different name \n"); - printf(" --vlan : Relevant only for stateless mode with Intel 82599 10G NIC."); - printf(" When configuring flow stat and latency per stream rules, assume all streams uses VLAN"); + printf(" -m <num> : Rate multiplier. Multiply basic rate of templates by this number \n"); printf(" --mbuf-factor : Factor for packet memory \n"); - printf(" \n"); - printf(" --no-watchdog : Disable watchdog \n"); - printf(" \n"); - printf(" --allow-coredump : Allow a creation of core dump \n"); - printf(" \n"); + printf(" --nc : If set, will not wait for all flows to be closed, before terminating - see manual for more information \n"); + printf(" --no-flow-control-change : By default TRex disables flow-control. If this option is given, it does not touch it \n"); + printf(" --no-key : Daemon mode, don't get input from keyboard \n"); + printf(" --no-watchdog : Disable watchdog \n"); + printf(" -p : Send all flow packets from the same interface (choosed randomly between client ad server ports) without changing their src/dst IP \n"); + printf(" -pm : Platform factor. If you have splitter in the setup, you can multiply the total results by this factor \n"); + printf(" e.g --pm 2.0 will multiply all the results bps in this factor \n"); + printf(" --prefix <nam> : For running multi TRex instances on the same machine. Each instance should have different name \n"); + printf(" -pubd : Disable monitors publishers \n"); + printf(" --rx-check <rate> : Enable rx check. TRex will sample flows at 1/rate and check order, latency and more \n"); + printf(" -s : Single core. Run only one data path core. For debug \n"); + printf(" --send-debug-pkt <proto> : Do not run traffic generator. Just send debug packet and dump receive queues \n"); + printf(" Supported protocols are 1 for icmp, 2 for UDP, 3 for TCP, 4 for ARP, 5 for 9K UDP \n"); + printf(" -v <verbosity level> : The higher the value, print more debug information \n"); + printf(" --vlan : Relevant only for stateless mode with Intel 82599 10G NIC \n"); + printf(" When configuring flow stat and latency per stream rules, assume all streams uses VLAN \n"); printf(" --vm-sim : Simulate vm with driver of one input queue and one output queue \n"); - printf(" \n"); - printf(" --checksum-offload : Enable IP, TCP and UDP tx checksum offloading with DPDK. This requires all used interfaces to support this \n"); - printf(" --arp-refresh-period : Period in seconds between sending of gratuitous ARP for out addresses. Value of 0, means 'never send'\n"); - printf(" \n"); - printf(" Examples: "); - printf(" basic trex run for 10 sec and multiplier of x10 \n"); - printf(" #>t-rex-64 -f cfg.yaml -m 10 -d 10 \n"); - printf(" \n "); - - printf(" preview show csv stats \n"); - printf(" #>t-rex-64 -c 1 -f cfg.yaml -v 1 -p -m 10 -d 10 --nc -l 1000\n"); - printf(" \n "); - - printf(" 5) ! \n"); - printf(" #>t-rex-64 -f cfg.yaml -c 1 --flip \n"); - - printf("\n"); + printf(" -w <num> : Wait num seconds between init of interfaces and sending traffic, default is 1 \n"); printf("\n"); + printf(" Examples: "); + printf(" basic trex run for 20 sec and multiplier of 10 \n"); + printf(" t-rex-64 -f cap2/dns.yaml -m 10 -d 20 \n"); + printf("\n\n"); printf(" Copyright (c) 2015-2016 Cisco Systems, Inc. \n"); printf(" \n"); printf(" Licensed under the Apache License, Version 2.0 (the 'License') \n"); @@ -860,11 +800,6 @@ static int parse_options(int argc, char *argv[], CParserOption* po, bool first_t po->m_l_pkt_mode=(uint8_t)tmp_data; break; - case OPT_REAL_TIME : - printf(" warning -r is deprecated, real time is not needed any more , it is the default \n"); - po->preview.setRealTime(true); - break; - case OPT_NO_FLOW_CONTROL: po->preview.set_disable_flow_control_setting(true); break; @@ -891,9 +826,6 @@ static int parse_options(int argc, char *argv[], CParserOption* po, bool first_t case OPT_FLOW_FLIP_CLIENT_SERVER_SIDE: po->preview.setClientServerFlowFlipAddr(true); break; - case OPT_FILE_OUT: - po->out_file = args.OptionArg(); - break; case OPT_NODE_DUMP: a=atoi(args.OptionArg()); node_dump=1; @@ -915,7 +847,7 @@ static int parse_options(int argc, char *argv[], CParserOption* po, bool first_t case OPT_MBUF_FACTOR: sscanf(args.OptionArg(),"%f", &po->m_mbuf_factor); break; - case OPT_BW_FACTOR : + case OPT_RATE_MULT : sscanf(args.OptionArg(),"%f", &po->m_factor); break; case OPT_DURATION : @@ -937,30 +869,21 @@ static int parse_options(int argc, char *argv[], CParserOption* po, bool first_t case OPT_ONLY_LATENCY : po->preview.setOnlyLatency(true); break; - case OPT_1G_MODE : - po->preview.set_1g_mode(true); - break; - case OPT_NO_WATCHDOG : po->preview.setWDDisable(true); break; - case OPT_ALLOW_COREDUMP : po->preview.setCoreDumpEnable(true); break; - case OPT_LATENCY_PREVIEW : sscanf(args.OptionArg(),"%d", &po->m_latency_prev); break; - case OPT_WAIT_BEFORE_TRAFFIC : sscanf(args.OptionArg(),"%d", &po->m_wait_before_traffic); break; - case OPT_PCAP: po->preview.set_pcap_mode_enable(true); break; - case OPT_RX_CHECK : sscanf(args.OptionArg(),"%d", &tmp_data); po->m_rx_check_sample=(uint16_t)tmp_data; @@ -1045,7 +968,7 @@ static int parse_options(int argc, char *argv[], CParserOption* po, bool first_t /* only first time read the configuration file */ if ( po->platform_cfg_file.length() >0 ) { if ( node_dump ){ - printf("load platform configuration file from %s \n",po->platform_cfg_file.c_str()); + printf("Loading platform configuration file from %s \n",po->platform_cfg_file.c_str()); } global_platform_cfg_info.load_from_yaml_file(po->platform_cfg_file); if ( node_dump ){ |