@@ -49,6 +49,7 @@ def get_network_config(workers):
49
49
config ['tap{}' .format (2 * i )] = {
50
50
'mid' : i ,
51
51
'mac' : '56:b4:44:e9:62:d{:x}' .format (i ),
52
+ 'ip' : f"172.31.0.1{ i } "
52
53
}
53
54
return config
54
55
@@ -215,8 +216,10 @@ def build_kernel(args):
215
216
build_args = ['build' , '--target' , KERNEL_TARGET ]
216
217
if args .no_kfeatures :
217
218
build_args += ["--no-default-features" ]
219
+ log (" - enable feature --no-default-features" )
218
220
for feature in args .kfeatures :
219
221
build_args += ['--features' , feature ]
222
+ log (" - enable feature {}" .format (feature ))
220
223
build_args += CARGO_DEFAULT_ARGS
221
224
build_args += CARGO_NOSTD_BUILD_ARGS
222
225
if args .verbose :
@@ -233,6 +236,16 @@ def build_user_libraries(args):
233
236
build_args += ["--features" , "rumprt" ]
234
237
if args .nic == "virtio-net-pci" :
235
238
build_args += ["--features" , "virtio" ]
239
+ log (" - enable feature virtio" )
240
+
241
+ for featurelist in args .ufeatures :
242
+ for feature in featurelist .split (',' ) :
243
+ if ':' in feature :
244
+ mod_part , feature_part = feature .split (':' )
245
+ if "libvibrio" == mod_part :
246
+ log (" - enable feature {}" .format (feature_part ))
247
+ build_args += ['--features' , feature_part ]
248
+
236
249
# else: use e1000 / wm0
237
250
build_args += CARGO_DEFAULT_ARGS
238
251
build_args += CARGO_NOSTD_BUILD_ARGS
@@ -259,18 +272,21 @@ def build_userspace(args):
259
272
if not (USR_PATH / module ).exists ():
260
273
log ("User module {} not found, skipping." .format (module ))
261
274
continue
275
+ log ("build user-space module {}" .format (module ))
262
276
with local .cwd (USR_PATH / module ):
263
277
with local .env (RUSTFLAGS = USER_RUSTFLAGS ):
264
278
with local .env (RUST_TARGET_PATH = USR_PATH .absolute ()):
265
279
build_args = build_args_default .copy ()
266
- for feature in args .ufeatures :
267
- if ':' in feature :
268
- mod_part , feature_part = feature .split (':' )
269
- if module == mod_part :
270
- build_args += ['--features' , feature_part ]
271
- else :
272
- build_args += ['--features' , feature ]
273
- log ("Build user-module {}" .format (module ))
280
+ for featurelist in args .ufeatures :
281
+ for feature in featurelist .split (',' ) :
282
+ if ':' in feature :
283
+ mod_part , feature_part = feature .split (':' )
284
+ if module == mod_part :
285
+ log (" - enable feature {}" .format (feature_part ))
286
+ build_args += ['--features' , feature_part ]
287
+ else :
288
+ log (" - enable feature {}" .format (feature ))
289
+ build_args += ['--features' , feature ]
274
290
if args .verbose :
275
291
print ("cd {}" .format (USR_PATH / module ))
276
292
print ("RUSTFLAGS={} RUST_TARGET_PATH={} cargo " .format (
@@ -742,8 +758,10 @@ def configure_network(args):
742
758
assert args .workers <= MAX_WORKERS , "Too many workers, can't configure network"
743
759
sudo [ip [['link' , 'add' , 'br0' , 'type' , 'bridge' ]]]()
744
760
sudo [ip [['addr' , 'add' , NETWORK_INFRA_IP , 'brd' , '+' , 'dev' , 'br0' ]]]()
761
+
745
762
for _ , ncfg in zip (range (0 , args .workers ), NETWORK_CONFIG ):
746
763
sudo [tunctl [['-t' , ncfg , '-u' , user , '-g' , group ]]]()
764
+ sudo [ip [['link' , 'set' , 'address' , NETWORK_CONFIG [ncfg ]['mac' ], 'dev' , ncfg ]]]()
747
765
sudo [ip [['link' , 'set' , ncfg , 'up' ]]](retcode = (0 , 1 ))
748
766
sudo [brctl [['addif' , 'br0' , ncfg ]]]()
749
767
sudo [ip [['link' , 'set' , 'br0' , 'up' ]]](retcode = (0 , 1 ))
0 commit comments