diff --git a/doc/ws_main.py b/doc/ws_main.py index 71aa3d7d8..8904dba7a 100755 --- a/doc/ws_main.py +++ b/doc/ws_main.py @@ -28,9 +28,9 @@ except: from html.parser import HTMLParser - + # HTML injector for TOC and DISQUS -from HTMLInjector import HTMLInjector +from HTMLInjector import HTMLInjectors class CTocNode: @@ -43,7 +43,7 @@ def __init__ (self, link_fmt = None): # by default, link_fmt will formatted as in-page links self.link_fmt = link_fmt if link_fmt else lambda x: '#' + x - + def get_link (self): if self.link==None: name=self.name @@ -53,11 +53,11 @@ def get_link (self): for c in l: if c.isalpha() or c.isspace(): s+=c - + link = '_'.join(s.lower().split()); else: link = self.link - + return self.link_fmt(link) @@ -114,10 +114,10 @@ def __init__ (self, link_fmt = None): def set_level (self,level,node): assert(node!=None); - assert(isinstance(node,CTocNode)==True); + assert(isinstance(node,CTocNode)==True); self.d[str(level)]=node - # in case we change from high to low level remove the higher level + # in case we change from high to low level remove the higher level if levelmax_num: - max_num = num + max_num = num return max_num - + def configure(conf): conf.find_program('strings') so = ['/usr/lib/x86_64-linux-gnu/libstdc++.so.6','/usr/lib64/libstdc++.so.6'] @@ -145,7 +145,7 @@ def configure(conf): try: os.system("mv %s %s " %(our_so,d_so)) except Exception as ex: - pass + pass if int(conf.options.gcc6) + int(conf.options.gcc7) + int(conf.options.gcc8) > 1: conf.fatal('--gcc6, --gcc7 and --gcc8 are mutual exclusive') @@ -167,15 +167,15 @@ def configure(conf): else: configure_gcc(conf) - + # first verify CC version rc = verify_cc_version(conf.env, REQUIRED_CC_VERSION) if not rc[0]: print("\nMachine GCC version too low '{0}' - required at least '{1}'".format(rc[1], rc[2])) print( "\n*** please set a compiler using CXX / AR enviorment variables ***\n") exit(-1) - - + + # handle sanitized process if needed configure_sanitized(conf) @@ -215,10 +215,10 @@ def configure_sanitized (conf): # first we turn off SANITIZED conf.env.SANITIZED = False - + # if sanitized is required - check GCC version for sanitizing - conf.start_msg('Build sanitized images (GCC >= {0})'.format(SANITIZE_CC_VERSION)) - + conf.start_msg('Build sanitized images (GCC >= {0})'.format(SANITIZE_CC_VERSION)) + # not required if not conf.options.sanitized: conf.end_msg('no', 'YELLOW') @@ -231,9 +231,9 @@ def configure_sanitized (conf): conf.end_msg('yes', 'GREEN') conf.env.SANITIZED = True - - - + + + bp_sim_main = SrcGroup(dir='src', src_list=['main.cpp']) @@ -327,7 +327,7 @@ def configure_sanitized (conf): ]); cmn_src = SrcGroup(dir='src/common', - src_list=[ + src_list=[ 'gtest-all.cc', 'gtest_main.cc', 'basic_utils.cpp', @@ -339,7 +339,7 @@ def configure_sanitized (conf): 'n_uniform_prob.cpp' ]); - + net_src = SrcGroup(dir='src/common/Network/Packet', src_list=[ 'CPktCmn.cpp', @@ -500,20 +500,20 @@ def configure_sanitized (conf): bp =SrcGroups([ bp_sim_main, bp_sim_gtest, - main_src, + main_src, cmn_src , stubs, net_src , yaml_src, json_src, - + stx_src, stf_src, stateless_src, astf_batch_src, astf_src, md5_src, - + rpc_server_src ]); @@ -547,15 +547,15 @@ def configure_sanitized (conf): ../src/pal/common/ ../src/ ../src/utils/ - + ../src/rpc-server/ - + ../src/hdrh/ ../src/stx/ ../src/stx/common/ ../src/stx/common/rx/ - + ../external_libs/json/ ../external_libs/md5/ ../external_libs/zmq/'''+ march +'''/include/ @@ -587,7 +587,7 @@ def __init__(self, name, src, debug_mode, is_pie, use = None, flags = None, rpat if flags is None: flags = [] if rpath is None: - rpath = [] + rpath = [] self.mode = debug_mode; ##debug,release self.platform = march # aarch64 or x86_64 or ppc64le self.is_pie = is_pie @@ -628,10 +628,10 @@ def is64Platform (self): def isRelease (self): return ( self.mode == RELEASE_); - + def isPIE (self): return self.is_pie - + def update_executable_name (self,name): return self.update_name(name,"-") @@ -713,7 +713,7 @@ def get_rpath (self): return self.rpath def get_link_flags(self, is_sanitized): - + # add here basic flags base_flags = []; if self.isPIE(): @@ -754,10 +754,10 @@ def get_link_flags(self, is_sanitized): def build_prog (bld, build_obj): - + # determine if sanitized image should be built is_sanitized = bld.env.SANITIZED - + cxxflags = build_obj.get_flags(is_sanitized)+['-std=gnu++11',] cflags = build_obj.get_c_flags(is_sanitized) linkflags = build_obj.get_link_flags(is_sanitized) @@ -770,7 +770,7 @@ def build_prog (bld, build_obj): target = build_obj.get_tcp_target() ) - bld.program(features='cxx cxxprogram', + bld.program(features='cxx cxxprogram', includes = includes_path + tcp_includes_path, cxxflags = cxxflags, linkflags = linkflags, @@ -796,7 +796,7 @@ def post_build(bld): def build(bld): if bld.env.SANITIZED and bld.cmd == 'build': Logs.warn("\n******* building sanitized binaries *******\n") - + bld.add_post_fun(post_build); for obj in build_types: build_type(bld,obj); diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py index 3369723eb..4d7b62b30 100644 --- a/linux_dpdk/ws_main.py +++ b/linux_dpdk/ws_main.py @@ -148,7 +148,7 @@ def options(opt): opt.add_option('--no-bnxt', dest='no_bnxt', default=False, action='store_true', help="don't use bnxt dpdk driver. use with ./b configure --no-bnxt. no need to run build with it") opt.add_option('--no-mlx', dest='no_mlx', default=(True if march == 'aarch64' else False), action='store', help="don't use mlx4/mlx5 dpdk driver. use with ./b configure --no-mlx. no need to run build with it") opt.add_option('--with-mana', dest='with_mana', default=False, action='store_true', help="Use Mana dpdk driver. Use with ./b configure --with-mana.") - opt.add_option('--with-ntacc', dest='with_ntacc', default=False, action='store_true', help="Use Napatech dpdk driver. Use with ./b configure --with-ntacc.") + opt.add_option('--with-ntacc', dest='with_ntacc', default=False, action='store_true', help="Use Napatech dpdk driver. Use with ./b configure --with-ntacc.") opt.add_option('--with-bird', default=False, action='store_true', help="Build Bird server. Use with ./b configure --with-bird.") opt.add_option('--new-memory', default=False, action='store_true', help="Build by new DPDK memory subsystem.") opt.add_option('--with-archive', default=False, action='store_true', help="Build with lib archive") @@ -162,7 +162,7 @@ def options(opt): co = opt.option_groups['configure options'] co.add_option('--sanitized', dest='sanitized', default=False, action='store_true', help='for GCC {0}+ use address sanitizer to catch memory errors'.format(SANITIZE_CC_VERSION)) - + co.add_option('--gcc6', dest='gcc6', default=False, action='store_true', help='use GCC 6.2 instead of the machine version') @@ -464,12 +464,12 @@ def configure_dummy_mlx5 (ctx): #define ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT 35 #define ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT 36 #define ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT 37 - #define ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT 38 + #define ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT 38 #define ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT 39 ''' - + f = open(autoconf_path, "w") f.write(dummy_file_data) f.close() @@ -735,12 +735,12 @@ def check_ntapi(ctx): ctx.end_msg('Found needed NTAPI library') return True - + def verify_cc_version (env, min_ver = REQUIRED_CC_VERSION): ver = StrictVersion('.'.join(env['CC_VERSION'])) return (ver >= min_ver, ver, min_ver) - + @conf def get_ld_search_path(ctx): @@ -780,8 +780,8 @@ def check_version_glibc(lib_so): for so in lib_so: cmd = 'strings {}'.format(so) s, lines = getstatusoutput(cmd) - if s ==0: - ls= lines.split('\n') + if s ==0: + ls= lines.split('\n') for line in ls: prefix = 'GLIBCXX_' if line.startswith(prefix): @@ -790,7 +790,7 @@ def check_version_glibc(lib_so): if len(d) == 3: num = int(d[0])*1000 +int(d[1])*100+int(d[2]) if num >max_num: - max_num = num + max_num = num return max_num @@ -806,7 +806,7 @@ def configure(conf): try: os.system("mv %s %s " %(our_so,d_so)) except Exception as ex: - pass + pass conf.load('clang_compilation_database',tooldir=['../external_libs/waf-tools']) @@ -838,10 +838,10 @@ def configure(conf): with_bird = conf.options.with_bird with_sanitized = conf.options.sanitized new_memory = conf.options.new_memory - - + + configure_sanitized(conf, with_sanitized) - + conf.env.NO_MLX = no_mlx conf.env.TAP = conf.options.tap @@ -936,7 +936,7 @@ def configure_gcc(conf, explicit_paths = None): conf.environ['PATH'] = explicit_path load_compiler(conf) finally: - conf.environ['PATH'] = saved + conf.environ['PATH'] = saved @@ -946,7 +946,7 @@ def configure_sanitized (conf, with_sanitized): conf.env.SANITIZED = False # if sanitized is required - check GCC version for sanitizing - conf.start_msg('Build sanitized images (GCC >= {0})'.format(SANITIZE_CC_VERSION)) + conf.start_msg('Build sanitized images (GCC >= {0})'.format(SANITIZE_CC_VERSION)) # not required if not with_sanitized: @@ -1281,7 +1281,7 @@ def getstatusoutput(cmd): 'drivers/net/enic/enic_res.c', 'drivers/net/enic/enic_main.c', - #ICE + #ICE 'drivers/net/ice/base/ice_vlan_mode.c', 'drivers/net/ice/base/ice_acl.c', 'drivers/net/ice/base/ice_acl_ctrl.c', @@ -1391,7 +1391,7 @@ def getstatusoutput(cmd): 'lib/eal/x86/rte_spinlock.c', 'lib/eal/x86/rte_cycles.c', 'lib/eal/x86/rte_hypervisor.c', - + #'lib/librte_security/rte_security.c', #failsafe @@ -1453,7 +1453,7 @@ def getstatusoutput(cmd): dpdk_src_x86_64_tap = SrcGroup(dir='src/dpdk/', src_list=[ - #tap + #tap 'drivers/net/tap/rte_eth_tap.c', 'drivers/net/tap/tap_flow.c', 'drivers/net/tap/tap_netlink.c', @@ -1742,7 +1742,7 @@ def getstatusoutput(cmd): 'lib/ethdev/sff_8079.c', 'lib/ethdev/sff_8472.c', 'lib/ethdev/sff_8636.c', - + 'lib/telemetry/telemetry.c', 'lib/telemetry/telemetry_data.c', 'lib/telemetry/telemetry_legacy.c', @@ -2188,12 +2188,12 @@ def getstatusoutput(cmd): ../src/dpdk/drivers/net/bnxt/tf_ulp/ ../src/dpdk/drivers/net/bnxt/tf_ulp/generic_templates/ ../src/dpdk/drivers/net/memif/ - ../src/dpdk//drivers/common/iavf/ + ../src/dpdk//drivers/common/iavf/ ../src/dpdk/drivers/net/ena/ ../src/dpdk/drivers/net/ena/base/ ../src/dpdk/drivers/net/ena/base/ena_defs/ - + ../src/dpdk/lib/telemetry/ ../src/dpdk/lib/rcu/ @@ -2202,7 +2202,7 @@ def getstatusoutput(cmd): ../src/dpdk/lib/cfgfile/ ../src/dpdk/lib/compat/ ../src/dpdk/lib/eal/ - ../src/dpdk/lib/eal/include/ + ../src/dpdk/lib/eal/include/ ../src/dpdk/lib/eal/common/ ../src/dpdk/lib/eal/common/include/ ../src/dpdk/lib/eal/common/include/arch/ @@ -2229,7 +2229,7 @@ def getstatusoutput(cmd): ../src/dpdk/lib/pcapng/ ../src/dpdk/ - + ../src/dpdk/lib/security/ ../src/dpdk/lib/log/ @@ -2317,11 +2317,11 @@ def set_env(self,env): self.env = env def is_clang(self): - if self.env: + if self.env: if 'clang' in self.env[0]: return True - return False - + return False + def __str__(self): s=self.mode+","+self.platform return (s) @@ -2504,11 +2504,11 @@ def get_cxx_flags (self, is_sanitized): return (flags) - + def get_c_flags (self, is_sanitized): - + flags = self.get_common_flags() - + if self.isRelease () : flags += ['-DNDEBUG'] @@ -2525,7 +2525,7 @@ def get_c_flags (self, is_sanitized): # for C no special flags yet return (flags) - + def get_link_flags(self, is_sanitized): base_flags = ['-rdynamic'] if self.is64Platform() and self.isIntelPlatform(): @@ -2565,7 +2565,7 @@ def build_prog (bld, build_obj): debug_file_list='' #if not build_obj.isRelease (): # debug_file_list +=ef_src.file_list(top) - + build_obj.set_env(bld.env.CXX) cflags = build_obj.get_c_flags(bld.env.SANITIZED) @@ -2590,7 +2590,7 @@ def build_prog (bld, build_obj): dpdk_src_x86_64, dpdk_src_x86_64_ext ]) - + if bld.env.TAP: bp_dpdk.list_group.append(dpdk_src_x86_64_tap) @@ -3122,7 +3122,7 @@ def fix_pkg_include(bld): pkg_include.append('bird') def release(ctx, custom_dir = None): - + bld = Build.BuildContext() bld.load_envs() @@ -3144,9 +3144,9 @@ def release(ctx, custom_dir = None): src_file = '../scripts/'+obj dest_file = exec_p +'/'+obj os.system("cp %s %s " %(src_file,dest_file)) - + os.system("chmod 755 %s " % (exec_p +'/trex-emu')) - + exclude = ' '.join(['--exclude=%s' % exc for exc in pkg_exclude]) fix_pkg_include(bld) for obj in pkg_include: