1313DEPS_DIR = '%s/deps' % BESS_DIR
1414
1515DPDK_REPO = 'http://dpdk.org/browse/dpdk/snapshot'
16- DPDK_VER = 'dpdk-17.02 '
16+ DPDK_VER = 'dpdk-17.05 '
1717
1818arch = subprocess .check_output ('uname -m' , shell = True ).strip ()
1919if arch == 'x86_64' :
3737
3838
3939def cmd (cmd ):
40- proc = subprocess .Popen (cmd ,
41- stdout = subprocess .PIPE ,
42- stderr = subprocess .STDOUT ,
43- shell = True )
40+ proc = subprocess .Popen (
41+ cmd , stdout = subprocess .PIPE , stderr = subprocess .STDOUT , shell = True )
4442
4543 # err should be None
4644 out , err = proc .communicate ()
@@ -53,10 +51,8 @@ def cmd(cmd):
5351
5452def cmd_success (cmd ):
5553 try :
56- subprocess .check_call (cmd ,
57- stdout = subprocess .PIPE ,
58- stderr = subprocess .STDOUT ,
59- shell = True )
54+ subprocess .check_call (
55+ cmd , stdout = subprocess .PIPE , stderr = subprocess .STDOUT , shell = True )
6056 return True
6157 except subprocess .CalledProcessError :
6258 return False
@@ -111,8 +107,7 @@ def check_c_lib(lib):
111107
112108def required (header_file , lib_name , compiler ):
113109 if not check_header (header_file , compiler ):
114- print ('Error - #include <%s> failed. '
115- 'Did you install "%s" package?'
110+ print ('Error - #include <%s> failed. Did you install "%s" package?'
116111 % (header_file , lib_name ), file = sys .stderr )
117112 sys .exit (1 )
118113
@@ -155,8 +150,7 @@ def check_bnx():
155150 global extra_libs
156151 extra_libs .add ('z' )
157152 else :
158- print (' - "zlib1g-dev" is not available. '
159- 'Disabling BNX2X PMD...' )
153+ print (' - "zlib1g-dev" is not available. Disabling BNX2X PMD...' )
160154 set_config (DPDK_FINAL_CONFIG , 'CONFIG_RTE_LIBRTE_BNX2X_PMD' , 'n' )
161155
162156
@@ -180,8 +174,8 @@ def generate_dpdk_extra_mk():
180174 global extra_libs
181175
182176 with open ('core/extra.dpdk.mk' , 'w' ) as fp :
183- fp .write ('LIBS += %s \n ' %
184- ' ' .join (map (lambda lib : '-l' + lib , extra_libs )))
177+ fp .write (
178+ 'LIBS += %s \n ' % ' ' .join (map (lambda lib : '-l' + lib , extra_libs )))
185179
186180
187181def generate_extra_mk ():
@@ -227,8 +221,8 @@ def build_dpdk():
227221 try :
228222 print ('Decompressing DPDK...' )
229223 cmd ('mkdir -p %s' % DPDK_DIR )
230- cmd ('tar zxf %s -C %s --strip-components 1' %
231- ( DPDK_FILE , DPDK_DIR ))
224+ cmd ('tar zxf %s -C %s --strip-components 1' % ( DPDK_FILE ,
225+ DPDK_DIR ))
232226 except :
233227 cmd ('rm -rf %s' % (DPDK_DIR ))
234228 raise
@@ -261,7 +255,7 @@ def build_bess():
261255
262256 print ('Building BESS daemon...' )
263257 cmd ('bin/bessctl daemon stop 2> /dev/null || true' )
264- cmd ('rm -f core/bessd' ) # force relink as DPDK might have been rebuilt
258+ cmd ('rm -f core/bessd' ) # force relink as DPDK might have been rebuilt
265259 cmd ('make -C core -j`nproc`' )
266260 cmd ('ln -f -s ../core/bessd bin/bessd' )
267261
@@ -319,11 +313,18 @@ def update_benchmark_path(path):
319313def main ():
320314 os .chdir (BESS_DIR )
321315 parser = argparse .ArgumentParser (description = 'Build BESS' )
322- parser .add_argument ('action' , metavar = 'action' , nargs = '?' , default = 'all' ,
323- help = 'Action is one of all, dpdk, bess, kmod, clean'
324- ' dist_clean, help' )
325- parser .add_argument ('--with-benchmark' , dest = 'benchmark_path' , nargs = 1 ,
326- help = 'Location of benchmark library' )
316+ parser .add_argument (
317+ 'action' ,
318+ metavar = 'action' ,
319+ nargs = '?' ,
320+ default = 'all' ,
321+ help = 'Action is one of all, dpdk, bess, kmod, clean'
322+ ' dist_clean, help' )
323+ parser .add_argument (
324+ '--with-benchmark' ,
325+ dest = 'benchmark_path' ,
326+ nargs = 1 ,
327+ help = 'Location of benchmark library' )
327328 args = parser .parse_args ()
328329
329330 if args .benchmark_path :
0 commit comments