MCPcopy Create free account
hub / github.com/mininet/mininet / TCReapply

Method TCReapply

mininet/node.py:1033–1055  ·  view source on GitHub ↗

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 )

Source from the content-addressed store, hash-verified

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.

Callers 1

startMethod · 0.95

Calls 2

tcMethod · 0.80
configMethod · 0.45

Tested by

no test coverage detected