mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-14 17:01:02 +02:00
Implement NOP in routing v4 table
Change-Id: Ia238cf88eb1ed5e23309f3b2cab7f1403f30dafe
This commit is contained in:
parent
91ea972a04
commit
cd03f07fb7
@ -177,6 +177,8 @@ public final class FabricConstants {
|
|||||||
PiActionId.of("FabricEgress.process_int_transit.int_set_header_0003_i10");
|
PiActionId.of("FabricEgress.process_int_transit.int_set_header_0003_i10");
|
||||||
public static final PiActionId FABRIC_INGRESS_NEXT_MPLS_ROUTING_V6_SIMPLE =
|
public static final PiActionId FABRIC_INGRESS_NEXT_MPLS_ROUTING_V6_SIMPLE =
|
||||||
PiActionId.of("FabricIngress.next.mpls_routing_v6_simple");
|
PiActionId.of("FabricIngress.next.mpls_routing_v6_simple");
|
||||||
|
public static final PiActionId FABRIC_INGRESS_FORWARDING_NOP_ROUTING_V4 =
|
||||||
|
PiActionId.of("FabricIngress.forwarding.nop_routing_v4");
|
||||||
public static final PiActionId FABRIC_EGRESS_PROCESS_INT_TRANSIT_INT_UPDATE_TOTAL_HOP_CNT =
|
public static final PiActionId FABRIC_EGRESS_PROCESS_INT_TRANSIT_INT_UPDATE_TOTAL_HOP_CNT =
|
||||||
PiActionId.of("FabricEgress.process_int_transit.int_update_total_hop_cnt");
|
PiActionId.of("FabricEgress.process_int_transit.int_update_total_hop_cnt");
|
||||||
public static final PiActionId FABRIC_INGRESS_FILTERING_NOP_INGRESS_PORT_VLAN =
|
public static final PiActionId FABRIC_INGRESS_FILTERING_NOP_INGRESS_PORT_VLAN =
|
||||||
|
@ -58,6 +58,8 @@ final class FabricTreatmentInterpreter {
|
|||||||
.withId(FabricConstants.FABRIC_INGRESS_FILTERING_NOP_INGRESS_PORT_VLAN).build();
|
.withId(FabricConstants.FABRIC_INGRESS_FILTERING_NOP_INGRESS_PORT_VLAN).build();
|
||||||
private static final PiAction NOP_ACL = PiAction.builder()
|
private static final PiAction NOP_ACL = PiAction.builder()
|
||||||
.withId(FabricConstants.FABRIC_INGRESS_FORWARDING_NOP_ACL).build();
|
.withId(FabricConstants.FABRIC_INGRESS_FORWARDING_NOP_ACL).build();
|
||||||
|
private static final PiAction NOP_ROUTING_V4 = PiAction.builder()
|
||||||
|
.withId(FabricConstants.FABRIC_INGRESS_FORWARDING_NOP_ROUTING_V4).build();
|
||||||
|
|
||||||
private static final PiAction POP_VLAN = PiAction.builder()
|
private static final PiAction POP_VLAN = PiAction.builder()
|
||||||
.withId(FabricConstants.FABRIC_EGRESS_EGRESS_NEXT_POP_VLAN)
|
.withId(FabricConstants.FABRIC_EGRESS_EGRESS_NEXT_POP_VLAN)
|
||||||
@ -143,9 +145,12 @@ final class FabricTreatmentInterpreter {
|
|||||||
public static PiAction mapForwardingTreatment(TrafficTreatment treatment, PiTableId tableId)
|
public static PiAction mapForwardingTreatment(TrafficTreatment treatment, PiTableId tableId)
|
||||||
throws PiInterpreterException {
|
throws PiInterpreterException {
|
||||||
// Empty treatment, generate table entry with no action
|
// Empty treatment, generate table entry with no action
|
||||||
if (treatment.equals(DefaultTrafficTreatment.emptyTreatment())) {
|
if (treatment.equals(DefaultTrafficTreatment.emptyTreatment()) ||
|
||||||
|
treatment.allInstructions().isEmpty()) {
|
||||||
if (tableId.equals(FabricConstants.FABRIC_INGRESS_FORWARDING_ACL)) {
|
if (tableId.equals(FabricConstants.FABRIC_INGRESS_FORWARDING_ACL)) {
|
||||||
return NOP_ACL;
|
return NOP_ACL;
|
||||||
|
} else if (tableId.equals(FabricConstants.FABRIC_INGRESS_FORWARDING_ROUTING_V4)) {
|
||||||
|
return NOP_ROUTING_V4;
|
||||||
} else {
|
} else {
|
||||||
return NOP;
|
return NOP;
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,10 @@ control Forwarding (
|
|||||||
routing_v4_counter.count();
|
routing_v4_counter.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
action nop_routing_v4() {
|
||||||
|
routing_v4_counter.count();
|
||||||
|
}
|
||||||
|
|
||||||
table routing_v4 {
|
table routing_v4 {
|
||||||
key = {
|
key = {
|
||||||
hdr.ipv4.dst_addr: lpm;
|
hdr.ipv4.dst_addr: lpm;
|
||||||
@ -91,6 +95,7 @@ control Forwarding (
|
|||||||
|
|
||||||
actions = {
|
actions = {
|
||||||
set_next_id_routing_v4;
|
set_next_id_routing_v4;
|
||||||
|
nop_routing_v4;
|
||||||
}
|
}
|
||||||
counters = routing_v4_counter;
|
counters = routing_v4_counter;
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -225,6 +225,9 @@ tables {
|
|||||||
action_refs {
|
action_refs {
|
||||||
id: 16777434
|
id: 16777434
|
||||||
}
|
}
|
||||||
|
action_refs {
|
||||||
|
id: 16804187
|
||||||
|
}
|
||||||
action_refs {
|
action_refs {
|
||||||
id: 16800567
|
id: 16800567
|
||||||
annotations: "@defaultonly()"
|
annotations: "@defaultonly()"
|
||||||
@ -857,6 +860,13 @@ actions {
|
|||||||
bitwidth: 32
|
bitwidth: 32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
actions {
|
||||||
|
preamble {
|
||||||
|
id: 16804187
|
||||||
|
name: "FabricIngress.forwarding.nop_routing_v4"
|
||||||
|
alias: "nop_routing_v4"
|
||||||
|
}
|
||||||
|
}
|
||||||
actions {
|
actions {
|
||||||
preamble {
|
preamble {
|
||||||
id: 16785374
|
id: 16785374
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -184,6 +184,9 @@ tables {
|
|||||||
action_refs {
|
action_refs {
|
||||||
id: 16777434
|
id: 16777434
|
||||||
}
|
}
|
||||||
|
action_refs {
|
||||||
|
id: 16804187
|
||||||
|
}
|
||||||
action_refs {
|
action_refs {
|
||||||
id: 16800567
|
id: 16800567
|
||||||
annotations: "@defaultonly()"
|
annotations: "@defaultonly()"
|
||||||
@ -757,6 +760,13 @@ actions {
|
|||||||
bitwidth: 32
|
bitwidth: 32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
actions {
|
||||||
|
preamble {
|
||||||
|
id: 16804187
|
||||||
|
name: "FabricIngress.forwarding.nop_routing_v4"
|
||||||
|
alias: "nop_routing_v4"
|
||||||
|
}
|
||||||
|
}
|
||||||
actions {
|
actions {
|
||||||
preamble {
|
preamble {
|
||||||
id: 16785374
|
id: 16785374
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -179,6 +179,9 @@ tables {
|
|||||||
action_refs {
|
action_refs {
|
||||||
id: 16777434
|
id: 16777434
|
||||||
}
|
}
|
||||||
|
action_refs {
|
||||||
|
id: 16804187
|
||||||
|
}
|
||||||
action_refs {
|
action_refs {
|
||||||
id: 16800567
|
id: 16800567
|
||||||
annotations: "@defaultonly()"
|
annotations: "@defaultonly()"
|
||||||
@ -564,6 +567,13 @@ actions {
|
|||||||
bitwidth: 32
|
bitwidth: 32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
actions {
|
||||||
|
preamble {
|
||||||
|
id: 16804187
|
||||||
|
name: "FabricIngress.forwarding.nop_routing_v4"
|
||||||
|
alias: "nop_routing_v4"
|
||||||
|
}
|
||||||
|
}
|
||||||
actions {
|
actions {
|
||||||
preamble {
|
preamble {
|
||||||
id: 16785374
|
id: 16785374
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -138,6 +138,9 @@ tables {
|
|||||||
action_refs {
|
action_refs {
|
||||||
id: 16777434
|
id: 16777434
|
||||||
}
|
}
|
||||||
|
action_refs {
|
||||||
|
id: 16804187
|
||||||
|
}
|
||||||
action_refs {
|
action_refs {
|
||||||
id: 16800567
|
id: 16800567
|
||||||
annotations: "@defaultonly()"
|
annotations: "@defaultonly()"
|
||||||
@ -487,6 +490,13 @@ actions {
|
|||||||
bitwidth: 32
|
bitwidth: 32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
actions {
|
||||||
|
preamble {
|
||||||
|
id: 16804187
|
||||||
|
name: "FabricIngress.forwarding.nop_routing_v4"
|
||||||
|
alias: "nop_routing_v4"
|
||||||
|
}
|
||||||
|
}
|
||||||
actions {
|
actions {
|
||||||
preamble {
|
preamble {
|
||||||
id: 16785374
|
id: 16785374
|
||||||
|
@ -135,7 +135,7 @@ public class FabricInterpreterTest {
|
|||||||
PiAction mappedAction = interpreter.mapTreatment(treatment,
|
PiAction mappedAction = interpreter.mapTreatment(treatment,
|
||||||
FabricConstants.FABRIC_INGRESS_FORWARDING_ROUTING_V4);
|
FabricConstants.FABRIC_INGRESS_FORWARDING_ROUTING_V4);
|
||||||
PiAction expectedAction = PiAction.builder()
|
PiAction expectedAction = PiAction.builder()
|
||||||
.withId(FabricConstants.NOP)
|
.withId(FabricConstants.FABRIC_INGRESS_FORWARDING_NOP_ROUTING_V4)
|
||||||
.build();
|
.build();
|
||||||
assertEquals(expectedAction, mappedAction);
|
assertEquals(expectedAction, mappedAction);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user