Unfortunately user switch and Mininet are fighting over tc queuing disciplines. To resolve the conflict, we re-create the user switch's configuration, but as a leaf of the TCIntf-created configuration.
( intf )
| 1031 | |
| 1032 | @staticmethod |
| 1033 | def TCReapply( intf ): |
| 1034 | """Unfortunately user switch and Mininet are fighting |
| 1035 | over tc queuing disciplines. To resolve the conflict, |
| 1036 | we re-create the user switch's configuration, but as a |
| 1037 | leaf of the TCIntf-created configuration.""" |
| 1038 | if isinstance( intf, TCIntf ): |
| 1039 | ifspeed = 10000000000 # 10 Gbps |
| 1040 | minspeed = ifspeed * 0.001 |
| 1041 | |
| 1042 | res = intf.config( **intf.params ) |
| 1043 | |
| 1044 | if res is None: # link may not have TC parameters |
| 1045 | return |
| 1046 | |
| 1047 | # Re-add qdisc, root, and default classes user switch created, but |
| 1048 | # with new parent, as setup by Mininet's TCIntf |
| 1049 | parent = res['parent'] |
| 1050 | intf.tc( "%s qdisc add dev %s " + parent + |
| 1051 | " handle 1: htb default 0xfffe" ) |
| 1052 | intf.tc( "%s class add dev %s classid 1:0xffff parent 1: htb rate " |
| 1053 | + str(ifspeed) ) |
| 1054 | intf.tc( "%s class add dev %s classid 1:0xfffe parent 1:0xffff " + |
| 1055 | "htb rate " + str(minspeed) + " ceil " + str(ifspeed) ) |
| 1056 | |
| 1057 | def start( self, controllers ): |
| 1058 | """Start OpenFlow reference user datapath. |