Test debug function
This commit is contained in:
		
					parent
					
						
							
								4e8da01250
							
						
					
				
			
			
				commit
				
					
						28b2bc46f2
					
				
			
		
					 3 changed files with 4 additions and 3 deletions
				
			
		|  | @ -150,7 +150,7 @@ class L2Controller(object): | |||
|             self.controller.table_add("v6_networks", "set_egress_port", [net], [v6route['port']]) | ||||
| 
 | ||||
|         net = str(self.info['ndp_multicast']) | ||||
|         self.controller.table_add("v6_networks", "controller_reply", [net]) | ||||
|         self.controller.table_add("v6_networks", "controller_debug", [net]) | ||||
| 
 | ||||
| 
 | ||||
|         self.controller.table_clear("v4_routing") | ||||
|  |  | |||
|  | @ -120,6 +120,7 @@ struct headers { | |||
| struct metadata { | ||||
|     bit<16> tcp_length; | ||||
|     bit<16> ethertype; /* we use this, if we are cloning */ | ||||
|     bit<1> ether_modified; | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
|  | @ -27,12 +27,12 @@ control MyIngress(inout headers hdr, | |||
| 	} | ||||
| 
 | ||||
|     action controller_debug() { | ||||
|         meta.ether_modified = 1; | ||||
|         meta.ethertype = TYPE_DEBUG; | ||||
|         clone3(CloneType.I2E, 100, meta); | ||||
|     } | ||||
| 
 | ||||
|     action controller_reply() { | ||||
|         meta.ethertype = TYPE_CPU; | ||||
|         clone3(CloneType.I2E, 100, meta); | ||||
|     } | ||||
| 
 | ||||
|  | @ -205,7 +205,7 @@ control MyEgress(inout headers hdr, | |||
|         // hdr.tcp.setValid(); | ||||
| 
 | ||||
|         // If ingress clone | ||||
|         if (standard_metadata.instance_type == 1){ | ||||
|         if (standard_metadata.instance_type == 1 && meta.ether_modified == 1){ | ||||
|             hdr.ethernet.ethertype = meta.ethertype; | ||||
| 
 | ||||
|         //     hdr.cpu.setValid(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue