cvs commit: src/sys/dev/virtual/net if_vke.c src/sys/machine/vkernel/include md_var.h src/sys/machine/vkernel/platform init.c
Sepherosa Ziehau
sephe at crater.dragonflybsd.org
Sun Jan 14 06:25:58 PST 2007
sephe 2007/01/14 06:24:56 PST
DragonFly src repository
Modified files:
sys/dev/virtual/net if_vke.c
sys/machine/vkernel/include md_var.h
sys/machine/vkernel/platform init.c
Log:
- Add multi pseudo network interface support for vkernel
- Add two sysctl for vke(4):
o hw.vkeX.intr_rate -- pseudo interrupt rate
o hw.vkeX.tap_unit -- backend real kernel tap(4) interface unit
- Print backend tap(4) interface name in vkernel for 'ifconfig vkeX'
vke(4)s are created according to the following command line option:
-I tap_devname[:expression]
'tap_devname' can be:
1) auto pick up the first unused tap(4) device file in /dev
2) tapX use /dev/tapX as tap(4) device file
3) /path/to/tap_dev use /path/to/tap_dev as tap(4) device file
'expression' is optional and could be:
1) x.x.x.x tap(4)'s address is x.x.x.x
2) x.x.x.x/z tap(4)'s address is x.x.x.x
tap(4)'s netmask len is z
3) x.x.x.x:y.y.y.y tap(4)'s address is x.x.x.x
vke(4)'s address is y.y.y.y
4) x.x.x.x:y.y.y.y/z tap(4)'s address is x.x.x.x
vke(4)'s address is y.y.y.y
tap(4) and vke(4)'s netmask len are z
5) bridgeX tap(4) will be added to bridgeX
6) bridgeX:y.y.y.y tap(4) will be added to bridgeX
vke(4)'s address is y.y.y.y
7) bridgeX:y.y.y.y/z tap(4) will be added to bridgeX
vke(4)'s address is y.y.y.y
vke(4)'s netmask len is z
vke(4)'s unit will be in the same order as the -I command line option,
i.e. first -I option will create vke0, and the second -I option will
create vke1 etc...
If vke(4)'s address/netmask is supplied, then in vkernel 'ifconfig vkeX up'
will assign the supplied address/netmask to vkeX in addition to bringing
vkeX up.
NOTE:
1) bridgeX will not be created if it does not exist yet
2) bridgeX will not be brought up if it is not up yet
3) if_tap.ko and if_bridge.ko will not be loaded automaticly
The main reason for 1) and 2), is that bridgeX will be in its original
state when vkernel is stopped normally or abruptly.
So if you choose to utilize bridged tap(4), before starting vkernel, you
will have to do following to make vke(4) work (suppose we use re0 as real
network interface):
# kldload if_bridge.ko
# kldload if_tap.ko
# ifconfig re0 up
# ifconfig bridge0 create
# ifconfig bridge0 addm re0
# ifconfig bridge0 up
Approved-by: dillon@
Revision Changes Path
1.2 +225 -51 src/sys/dev/virtual/net/if_vke.c
1.14 +11 -2 src/sys/machine/vkernel/include/md_var.h
1.26 +409 -11 src/sys/machine/vkernel/platform/init.c
http://www.dragonflybsd.org/cvsweb/src/sys/dev/virtual/net/if_vke.c.diff?r1=1.1&r2=1.2&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/machine/vkernel/include/md_var.h.diff?r1=1.13&r2=1.14&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/machine/vkernel/platform/init.c.diff?r1=1.25&r2=1.26&f=u
More information about the Commits
mailing list