]> git.entuzijast.net Git - imunes.git/commitdiff
Bring back to life ng_pipe insertion on our links. For this to work
authormarko <marko>
Tue, 21 Aug 2007 07:54:15 +0000 (07:54 +0000)
committermarko <marko>
Tue, 21 Aug 2007 07:54:15 +0000 (07:54 +0000)
you'll need to fetch the latest kernel sources from my home dir
at imunes.tel.fer.hr or from p4.  Note that the scheduler for ng_pipe
in -CURRENT at this point in time cannot provide resolution better than
kernel tick intervals, so you'll probably wish to configure your kernels
with high HZ setting - default in -CURRENT is 1000 HZ which should be
fine for proof-of-concept experiments.

Note that ng_pipe in -CURRENT is stripped off of XCP and [GA]RED
functions, but we never used those directly in IMUNES anyway so noone
should be hurt...

Bug found by:
Submitted by:
Reviewed by:
Approved by:
Obtained from:

exec.tcl

index 76ab57dde83dc245e5f1975417541423acf41839..5c8183ee6793fbac5fb81bd3b9c0b43ebbee624b 100755 (executable)
--- a/exec.tcl
+++ b/exec.tcl
@@ -1,4 +1,4 @@
-# $Id: exec.tcl,v 1.54 2007/08/18 18:41:43 marko Exp $
+# $Id: exec.tcl,v 1.55 2007/08/21 07:54:15 marko Exp $
 
 # Copyright 2004, 2005 University of Zagreb, Croatia.  All rights reserved.
 #
@@ -561,7 +561,34 @@ proc deployCfg {} {
            [lindex [[typemodel $lnode1].nghook $eid $lnode1 $ifname1] 1]
        set nghook2 \
            [lindex [[typemodel $lnode2].nghook $eid $lnode2 $ifname2] 1]
-       nexec ngctl connect $ngpeer1: $ngpeer2: $nghook1 $nghook2
+       nexec ngctl mkpeer $ngpeer1: pipe $nghook1 upper
+       nexec ngctl name $ngpeer1:$nghook1 $lname
+       nexec ngctl connect $lname: $ngpeer2: lower $nghook2
+
+       # Ethernet frame has a 14-byte header - this is a temp. hack!!!
+       nexec ngctl msg $lname: setcfg "{ header_offset=14 }"
+
+       # Link parameters
+       nexec ngctl msg $lname: setcfg \
+           "{ bandwidth=$bandwidth delay=$delay \
+           upstream={ BER=$ber duplicate=$dup } \
+           downstream={ BER=$ber duplicate=$dup } }"
+
+       # Queues
+       foreach node [list $lnode1 $lnode2] {
+           if { $node == $lnode1 } {
+               set ifc $ifname1
+           } else {
+               set ifc $ifname2
+           }
+
+           if { [nodeType $lnode1] != "rj45" && \
+               [nodeType $lnode2] != "rj45" } {
+               execSetIfcQDisc $eid $node $ifc [getIfcQDisc $node $ifc]
+               execSetIfcQDrop $eid $node $ifc [getIfcQDrop $node $ifc]
+               execSetIfcQLen $eid $node $ifc [getIfcQLen $node $ifc]
+           }
+       }
     }
 
     nexec rm -fr /var/run/quagga