Minor refactor fabric.p4

Remove origin_ether_type from fabric.p4
We can use ether_type from VLAN header since ingress_port_vlan table
always push a VLAN header to the packet if there is no VLAN header.

For configured interface, there exists flow rules to push VLAN.
For ports which not configured (infrastructure ports), the segment routing
application installs a rule which pushed internal VLAN to the packet (4094)

Change-Id: Ifae0b79a9d92b73a2a22cb33864e5bd5b6c95bfb
This commit is contained in:
Yi Tseng 2018-07-24 20:57:28 +08:00 committed by Carmelo Cascone
parent 086ad708f4
commit 8235a1a6b0
12 changed files with 78 additions and 224 deletions

View File

@ -33,8 +33,6 @@ public final class FabricConstants {
} }
// Header field IDs // Header field IDs
public static final PiMatchFieldId STANDARD_METADATA_EGRESS_PORT =
PiMatchFieldId.of("standard_metadata.egress_port");
public static final PiMatchFieldId FABRIC_METADATA_L4_SRC_PORT = public static final PiMatchFieldId FABRIC_METADATA_L4_SRC_PORT =
PiMatchFieldId.of("fabric_metadata.l4_src_port"); PiMatchFieldId.of("fabric_metadata.l4_src_port");
public static final PiMatchFieldId SPGW_META_S1U_SGW_ADDR = public static final PiMatchFieldId SPGW_META_S1U_SGW_ADDR =
@ -51,16 +49,18 @@ public final class FabricConstants {
PiMatchFieldId.of("hdr.ethernet.src_addr"); PiMatchFieldId.of("hdr.ethernet.src_addr");
public static final PiMatchFieldId HDR_ICMP_ICMP_TYPE = public static final PiMatchFieldId HDR_ICMP_ICMP_TYPE =
PiMatchFieldId.of("hdr.icmp.icmp_type"); PiMatchFieldId.of("hdr.icmp.icmp_type");
public static final PiMatchFieldId STANDARD_METADATA_EGRESS_PORT =
PiMatchFieldId.of("standard_metadata.egress_port");
public static final PiMatchFieldId FABRIC_METADATA_NEXT_ID = public static final PiMatchFieldId FABRIC_METADATA_NEXT_ID =
PiMatchFieldId.of("fabric_metadata.next_id"); PiMatchFieldId.of("fabric_metadata.next_id");
public static final PiMatchFieldId HDR_IPV4_DST_ADDR =
PiMatchFieldId.of("hdr.ipv4.dst_addr");
public static final PiMatchFieldId FABRIC_METADATA_L4_DST_PORT = public static final PiMatchFieldId FABRIC_METADATA_L4_DST_PORT =
PiMatchFieldId.of("fabric_metadata.l4_dst_port"); PiMatchFieldId.of("fabric_metadata.l4_dst_port");
public static final PiMatchFieldId HDR_VLAN_TAG_ETHER_TYPE =
PiMatchFieldId.of("hdr.vlan_tag.ether_type");
public static final PiMatchFieldId STANDARD_METADATA_INGRESS_PORT = public static final PiMatchFieldId STANDARD_METADATA_INGRESS_PORT =
PiMatchFieldId.of("standard_metadata.ingress_port"); PiMatchFieldId.of("standard_metadata.ingress_port");
public static final PiMatchFieldId FABRIC_METADATA_ORIGINAL_ETHER_TYPE = public static final PiMatchFieldId HDR_IPV4_DST_ADDR =
PiMatchFieldId.of("fabric_metadata.original_ether_type"); PiMatchFieldId.of("hdr.ipv4.dst_addr");
public static final PiMatchFieldId IPV4_DST_ADDR = public static final PiMatchFieldId IPV4_DST_ADDR =
PiMatchFieldId.of("ipv4.dst_addr"); PiMatchFieldId.of("ipv4.dst_addr");
public static final PiMatchFieldId HDR_VLAN_TAG_IS_VALID = public static final PiMatchFieldId HDR_VLAN_TAG_IS_VALID =
@ -235,4 +235,4 @@ public final class FabricConstants {
PiControlMetadataId.of("ingress_port"); PiControlMetadataId.of("ingress_port");
public static final PiControlMetadataId EGRESS_PORT = public static final PiControlMetadataId EGRESS_PORT =
PiControlMetadataId.of("egress_port"); PiControlMetadataId.of("egress_port");
} }

View File

@ -108,16 +108,12 @@ public class FabricInterpreter extends AbstractHandlerBehaviour
.put(Criterion.Type.IN_PORT, FabricConstants.STANDARD_METADATA_INGRESS_PORT) .put(Criterion.Type.IN_PORT, FabricConstants.STANDARD_METADATA_INGRESS_PORT)
.put(Criterion.Type.ETH_DST, FabricConstants.HDR_ETHERNET_DST_ADDR) .put(Criterion.Type.ETH_DST, FabricConstants.HDR_ETHERNET_DST_ADDR)
.put(Criterion.Type.ETH_SRC, FabricConstants.HDR_ETHERNET_SRC_ADDR) .put(Criterion.Type.ETH_SRC, FabricConstants.HDR_ETHERNET_SRC_ADDR)
.put(Criterion.Type.ETH_TYPE, FabricConstants.FABRIC_METADATA_ORIGINAL_ETHER_TYPE) .put(Criterion.Type.ETH_TYPE, FabricConstants.HDR_VLAN_TAG_ETHER_TYPE)
.put(Criterion.Type.MPLS_LABEL, FabricConstants.HDR_MPLS_LABEL) .put(Criterion.Type.MPLS_LABEL, FabricConstants.HDR_MPLS_LABEL)
.put(Criterion.Type.VLAN_VID, FabricConstants.HDR_VLAN_TAG_VLAN_ID) .put(Criterion.Type.VLAN_VID, FabricConstants.HDR_VLAN_TAG_VLAN_ID)
.put(Criterion.Type.IPV4_DST, FabricConstants.HDR_IPV4_DST_ADDR) .put(Criterion.Type.IPV4_DST, FabricConstants.HDR_IPV4_DST_ADDR)
.put(Criterion.Type.IPV4_SRC, FabricConstants.HDR_IPV4_SRC_ADDR) .put(Criterion.Type.IPV4_SRC, FabricConstants.HDR_IPV4_SRC_ADDR)
.put(Criterion.Type.IPV6_DST, FabricConstants.HDR_IPV6_DST_ADDR) .put(Criterion.Type.IPV6_DST, FabricConstants.HDR_IPV6_DST_ADDR)
.put(Criterion.Type.TCP_SRC, FabricConstants.FABRIC_METADATA_L4_SRC_PORT)
.put(Criterion.Type.TCP_DST, FabricConstants.FABRIC_METADATA_L4_DST_PORT)
.put(Criterion.Type.UDP_SRC, FabricConstants.FABRIC_METADATA_L4_SRC_PORT)
.put(Criterion.Type.UDP_DST, FabricConstants.FABRIC_METADATA_L4_DST_PORT)
.put(Criterion.Type.IP_PROTO, FabricConstants.FABRIC_METADATA_IP_PROTO) .put(Criterion.Type.IP_PROTO, FabricConstants.FABRIC_METADATA_IP_PROTO)
.put(Criterion.Type.ICMPV6_TYPE, FabricConstants.HDR_ICMP_ICMP_TYPE) .put(Criterion.Type.ICMPV6_TYPE, FabricConstants.HDR_ICMP_ICMP_TYPE)
.put(Criterion.Type.ICMPV6_CODE, FabricConstants.HDR_ICMP_ICMP_CODE) .put(Criterion.Type.ICMPV6_CODE, FabricConstants.HDR_ICMP_ICMP_CODE)
@ -128,7 +124,7 @@ public class FabricInterpreter extends AbstractHandlerBehaviour
.put(FabricConstants.STANDARD_METADATA_INGRESS_PORT, Criterion.Type.IN_PORT) .put(FabricConstants.STANDARD_METADATA_INGRESS_PORT, Criterion.Type.IN_PORT)
.put(FabricConstants.HDR_ETHERNET_DST_ADDR, Criterion.Type.ETH_DST) .put(FabricConstants.HDR_ETHERNET_DST_ADDR, Criterion.Type.ETH_DST)
.put(FabricConstants.HDR_ETHERNET_SRC_ADDR, Criterion.Type.ETH_SRC) .put(FabricConstants.HDR_ETHERNET_SRC_ADDR, Criterion.Type.ETH_SRC)
.put(FabricConstants.FABRIC_METADATA_ORIGINAL_ETHER_TYPE, Criterion.Type.ETH_TYPE) .put(FabricConstants.HDR_VLAN_TAG_ETHER_TYPE, Criterion.Type.ETH_TYPE)
.put(FabricConstants.HDR_MPLS_LABEL, Criterion.Type.MPLS_LABEL) .put(FabricConstants.HDR_MPLS_LABEL, Criterion.Type.MPLS_LABEL)
.put(FabricConstants.HDR_VLAN_TAG_VLAN_ID, Criterion.Type.VLAN_VID) .put(FabricConstants.HDR_VLAN_TAG_VLAN_ID, Criterion.Type.VLAN_VID)
.put(FabricConstants.HDR_IPV4_DST_ADDR, Criterion.Type.IPV4_DST) .put(FabricConstants.HDR_IPV4_DST_ADDR, Criterion.Type.IPV4_DST)

View File

@ -99,7 +99,7 @@ control Filtering (
key = { key = {
standard_metadata.ingress_port: exact; standard_metadata.ingress_port: exact;
hdr.ethernet.dst_addr: exact; hdr.ethernet.dst_addr: exact;
fabric_metadata.original_ether_type: exact; hdr.vlan_tag.ether_type: exact;
} }
actions = { actions = {

View File

@ -130,11 +130,11 @@ control Forwarding (
fabric_metadata.ip_proto: ternary; // 8 fabric_metadata.ip_proto: ternary; // 8
fabric_metadata.l4_src_port: ternary; // 16 fabric_metadata.l4_src_port: ternary; // 16
fabric_metadata.l4_dst_port: ternary; // 16 fabric_metadata.l4_dst_port: ternary; // 16
fabric_metadata.original_ether_type: ternary; //16
hdr.ethernet.dst_addr: ternary; // 48 hdr.ethernet.dst_addr: ternary; // 48
hdr.ethernet.src_addr: ternary; // 48 hdr.ethernet.src_addr: ternary; // 48
hdr.vlan_tag.vlan_id: ternary; // 12 hdr.vlan_tag.vlan_id: ternary; // 12
hdr.vlan_tag.ether_type: ternary; //16
hdr.ipv4.src_addr: ternary; // 32 hdr.ipv4.src_addr: ternary; // 32
hdr.ipv4.dst_addr: ternary; // 32 hdr.ipv4.dst_addr: ternary; // 32
hdr.icmp.icmp_type: ternary; // 8 hdr.icmp.icmp_type: ternary; // 8
@ -150,7 +150,7 @@ control Forwarding (
} }
const default_action = nop(); const default_action = nop();
size = 256; size = 128;
counters = acl_counter; counters = acl_counter;
} }
@ -234,7 +234,6 @@ control Forwarding (
// TODO: IPv6 // TODO: IPv6
hdr.vlan_tag.ether_type = ETHERTYPE_IPV4; hdr.vlan_tag.ether_type = ETHERTYPE_IPV4;
fabric_metadata.original_ether_type = ETHERTYPE_IPV4;
} }
else if (fabric_metadata.fwd_type == FWD_IPV4_UNICAST) unicast_v4.apply(); else if (fabric_metadata.fwd_type == FWD_IPV4_UNICAST) unicast_v4.apply();
#ifdef WITH_MULTICAST #ifdef WITH_MULTICAST

View File

@ -157,7 +157,6 @@ struct fabric_metadata_t {
bit<8> ip_proto; bit<8> ip_proto;
bit<16> l4_src_port; bit<16> l4_src_port;
bit<16> l4_dst_port; bit<16> l4_dst_port;
bit<16> original_ether_type;
#ifdef WITH_SPGW #ifdef WITH_SPGW
spgw_meta_t spgw; spgw_meta_t spgw;
#endif // WITH_SPGW #endif // WITH_SPGW

View File

@ -39,7 +39,6 @@ inout standard_metadata_t standard_metadata) {
state parse_ethernet { state parse_ethernet {
packet.extract(hdr.ethernet); packet.extract(hdr.ethernet);
fabric_metadata.original_ether_type = hdr.ethernet.ether_type;
transition select(hdr.ethernet.ether_type){ transition select(hdr.ethernet.ether_type){
ETHERTYPE_VLAN: parse_vlan_tag; ETHERTYPE_VLAN: parse_vlan_tag;
ETHERTYPE_MPLS: parse_mpls; ETHERTYPE_MPLS: parse_mpls;
@ -54,7 +53,6 @@ inout standard_metadata_t standard_metadata) {
state parse_vlan_tag { state parse_vlan_tag {
packet.extract(hdr.vlan_tag); packet.extract(hdr.vlan_tag);
fabric_metadata.original_ether_type = hdr.vlan_tag.ether_type;
transition select(hdr.vlan_tag.ether_type){ transition select(hdr.vlan_tag.ether_type){
ETHERTYPE_ARP: parse_arp; ETHERTYPE_ARP: parse_arp;
ETHERTYPE_IPV4: parse_ipv4; ETHERTYPE_IPV4: parse_ipv4;

View File

@ -23,7 +23,6 @@
["fabric_metadata_t.ip_proto", 8, false], ["fabric_metadata_t.ip_proto", 8, false],
["fabric_metadata_t.l4_src_port", 16, false], ["fabric_metadata_t.l4_src_port", 16, false],
["fabric_metadata_t.l4_dst_port", 16, false], ["fabric_metadata_t.l4_dst_port", 16, false],
["fabric_metadata_t.original_ether_type", 16, false],
["_padding_1", 6, false] ["_padding_1", 6, false]
] ]
}, },
@ -403,19 +402,6 @@
} }
], ],
"op" : "extract" "op" : "extract"
},
{
"parameters" : [
{
"type" : "field",
"value" : ["scalars", "fabric_metadata_t.original_ether_type"]
},
{
"type" : "field",
"value" : ["ethernet", "ether_type"]
}
],
"op" : "set"
} }
], ],
"transitions" : [ "transitions" : [
@ -474,19 +460,6 @@
} }
], ],
"op" : "extract" "op" : "extract"
},
{
"parameters" : [
{
"type" : "field",
"value" : ["scalars", "fabric_metadata_t.original_ether_type"]
},
{
"type" : "field",
"value" : ["vlan_tag", "ether_type"]
}
],
"op" : "set"
} }
], ],
"transitions" : [ "transitions" : [
@ -967,7 +940,7 @@
"id" : 0, "id" : 0,
"source_info" : { "source_info" : {
"filename" : "include/parser.p4", "filename" : "include/parser.p4",
"line" : 165, "line" : 163,
"column" : 8, "column" : 8,
"source_fragment" : "FabricDeparser" "source_fragment" : "FabricDeparser"
}, },
@ -3828,25 +3801,6 @@
"column" : 31, "column" : 31,
"source_fragment" : "0x0800; ..." "source_fragment" : "0x0800; ..."
} }
},
{
"op" : "assign",
"parameters" : [
{
"type" : "field",
"value" : ["scalars", "fabric_metadata_t.original_ether_type"]
},
{
"type" : "hexstr",
"value" : "0x0800"
}
],
"source_info" : {
"filename" : "include/control/../define.p4",
"line" : 69,
"column" : 31,
"source_fragment" : "0x0800; ..."
}
} }
] ]
}, },
@ -5699,8 +5653,8 @@
}, },
{ {
"match_type" : "exact", "match_type" : "exact",
"name" : "fabric_metadata.original_ether_type", "name" : "hdr.vlan_tag.ether_type",
"target" : ["scalars", "fabric_metadata_t.original_ether_type"], "target" : ["vlan_tag", "ether_type"],
"mask" : null "mask" : null
} }
], ],
@ -6020,12 +5974,6 @@
"target" : ["scalars", "fabric_metadata_t.l4_dst_port"], "target" : ["scalars", "fabric_metadata_t.l4_dst_port"],
"mask" : null "mask" : null
}, },
{
"match_type" : "ternary",
"name" : "fabric_metadata.original_ether_type",
"target" : ["scalars", "fabric_metadata_t.original_ether_type"],
"mask" : null
},
{ {
"match_type" : "ternary", "match_type" : "ternary",
"name" : "hdr.ethernet.dst_addr", "name" : "hdr.ethernet.dst_addr",
@ -6044,6 +5992,12 @@
"target" : ["vlan_tag", "vlan_id"], "target" : ["vlan_tag", "vlan_id"],
"mask" : null "mask" : null
}, },
{
"match_type" : "ternary",
"name" : "hdr.vlan_tag.ether_type",
"target" : ["vlan_tag", "ether_type"],
"mask" : null
},
{ {
"match_type" : "ternary", "match_type" : "ternary",
"name" : "hdr.ipv4.src_addr", "name" : "hdr.ipv4.src_addr",
@ -6071,7 +6025,7 @@
], ],
"match_type" : "ternary", "match_type" : "ternary",
"type" : "simple", "type" : "simple",
"max_size" : 256, "max_size" : 128,
"with_counters" : true, "with_counters" : true,
"support_timeout" : false, "support_timeout" : false,
"direct_meters" : null, "direct_meters" : null,
@ -6821,7 +6775,7 @@
"id" : 11, "id" : 11,
"source_info" : { "source_info" : {
"filename" : "include/control/forwarding.p4", "filename" : "include/control/forwarding.p4",
"line" : 239, "line" : 238,
"column" : 17, "column" : 17,
"source_fragment" : "fabric_metadata.fwd_type == FWD_IPV4_UNICAST" "source_fragment" : "fabric_metadata.fwd_type == FWD_IPV4_UNICAST"
}, },
@ -6847,7 +6801,7 @@
"id" : 12, "id" : 12,
"source_info" : { "source_info" : {
"filename" : "include/control/forwarding.p4", "filename" : "include/control/forwarding.p4",
"line" : 241, "line" : 240,
"column" : 17, "column" : 17,
"source_fragment" : "fabric_metadata.fwd_type == FWD_IPV4_MULTICAST" "source_fragment" : "fabric_metadata.fwd_type == FWD_IPV4_MULTICAST"
}, },
@ -6873,7 +6827,7 @@
"id" : 13, "id" : 13,
"source_info" : { "source_info" : {
"filename" : "include/control/forwarding.p4", "filename" : "include/control/forwarding.p4",
"line" : 244, "line" : 243,
"column" : 17, "column" : 17,
"source_fragment" : "fabric_metadata.fwd_type == FWD_IPV6_UNICAST" "source_fragment" : "fabric_metadata.fwd_type == FWD_IPV6_UNICAST"
}, },
@ -6899,7 +6853,7 @@
"id" : 14, "id" : 14,
"source_info" : { "source_info" : {
"filename" : "include/control/forwarding.p4", "filename" : "include/control/forwarding.p4",
"line" : 246, "line" : 245,
"column" : 17, "column" : 17,
"source_fragment" : "fabric_metadata.fwd_type == FWD_IPV6_MULTICAST" "source_fragment" : "fabric_metadata.fwd_type == FWD_IPV6_MULTICAST"
}, },

View File

@ -141,7 +141,7 @@ tables {
} }
match_fields { match_fields {
id: 3 id: 3
name: "fabric_metadata.original_ether_type" name: "hdr.vlan_tag.ether_type"
bitwidth: 16 bitwidth: 16
match_type: EXACT match_type: EXACT
} }
@ -260,28 +260,28 @@ tables {
} }
match_fields { match_fields {
id: 5 id: 5
name: "fabric_metadata.original_ether_type"
bitwidth: 16
match_type: TERNARY
}
match_fields {
id: 6
name: "hdr.ethernet.dst_addr" name: "hdr.ethernet.dst_addr"
bitwidth: 48 bitwidth: 48
match_type: TERNARY match_type: TERNARY
} }
match_fields { match_fields {
id: 7 id: 6
name: "hdr.ethernet.src_addr" name: "hdr.ethernet.src_addr"
bitwidth: 48 bitwidth: 48
match_type: TERNARY match_type: TERNARY
} }
match_fields { match_fields {
id: 8 id: 7
name: "hdr.vlan_tag.vlan_id" name: "hdr.vlan_tag.vlan_id"
bitwidth: 12 bitwidth: 12
match_type: TERNARY match_type: TERNARY
} }
match_fields {
id: 8
name: "hdr.vlan_tag.ether_type"
bitwidth: 16
match_type: TERNARY
}
match_fields { match_fields {
id: 9 id: 9
name: "hdr.ipv4.src_addr" name: "hdr.ipv4.src_addr"
@ -324,7 +324,7 @@ tables {
} }
const_default_action_id: 16819938 const_default_action_id: 16819938
direct_resource_ids: 318772272 direct_resource_ids: 318772272
size: 256 size: 128
idle_timeout_behavior: NO_TIMEOUT idle_timeout_behavior: NO_TIMEOUT
} }
tables { tables {

View File

@ -23,7 +23,6 @@
["fabric_metadata_t.ip_proto", 8, false], ["fabric_metadata_t.ip_proto", 8, false],
["fabric_metadata_t.l4_src_port", 16, false], ["fabric_metadata_t.l4_src_port", 16, false],
["fabric_metadata_t.l4_dst_port", 16, false], ["fabric_metadata_t.l4_dst_port", 16, false],
["fabric_metadata_t.original_ether_type", 16, false],
["_padding_1", 6, false] ["_padding_1", 6, false]
] ]
}, },
@ -382,19 +381,6 @@
} }
], ],
"op" : "extract" "op" : "extract"
},
{
"parameters" : [
{
"type" : "field",
"value" : ["scalars", "fabric_metadata_t.original_ether_type"]
},
{
"type" : "field",
"value" : ["ethernet", "ether_type"]
}
],
"op" : "set"
} }
], ],
"transitions" : [ "transitions" : [
@ -447,19 +433,6 @@
} }
], ],
"op" : "extract" "op" : "extract"
},
{
"parameters" : [
{
"type" : "field",
"value" : ["scalars", "fabric_metadata_t.original_ether_type"]
},
{
"type" : "field",
"value" : ["vlan_tag", "ether_type"]
}
],
"op" : "set"
} }
], ],
"transitions" : [ "transitions" : [
@ -869,7 +842,7 @@
"id" : 0, "id" : 0,
"source_info" : { "source_info" : {
"filename" : "include/parser.p4", "filename" : "include/parser.p4",
"line" : 165, "line" : 163,
"column" : 8, "column" : 8,
"source_fragment" : "FabricDeparser" "source_fragment" : "FabricDeparser"
}, },
@ -3601,25 +3574,6 @@
"column" : 31, "column" : 31,
"source_fragment" : "0x0800; ..." "source_fragment" : "0x0800; ..."
} }
},
{
"op" : "assign",
"parameters" : [
{
"type" : "field",
"value" : ["scalars", "fabric_metadata_t.original_ether_type"]
},
{
"type" : "hexstr",
"value" : "0x0800"
}
],
"source_info" : {
"filename" : "include/control/../define.p4",
"line" : 69,
"column" : 31,
"source_fragment" : "0x0800; ..."
}
} }
] ]
}, },
@ -5423,8 +5377,8 @@
}, },
{ {
"match_type" : "exact", "match_type" : "exact",
"name" : "fabric_metadata.original_ether_type", "name" : "hdr.vlan_tag.ether_type",
"target" : ["scalars", "fabric_metadata_t.original_ether_type"], "target" : ["vlan_tag", "ether_type"],
"mask" : null "mask" : null
} }
], ],
@ -5621,12 +5575,6 @@
"target" : ["scalars", "fabric_metadata_t.l4_dst_port"], "target" : ["scalars", "fabric_metadata_t.l4_dst_port"],
"mask" : null "mask" : null
}, },
{
"match_type" : "ternary",
"name" : "fabric_metadata.original_ether_type",
"target" : ["scalars", "fabric_metadata_t.original_ether_type"],
"mask" : null
},
{ {
"match_type" : "ternary", "match_type" : "ternary",
"name" : "hdr.ethernet.dst_addr", "name" : "hdr.ethernet.dst_addr",
@ -5645,6 +5593,12 @@
"target" : ["vlan_tag", "vlan_id"], "target" : ["vlan_tag", "vlan_id"],
"mask" : null "mask" : null
}, },
{
"match_type" : "ternary",
"name" : "hdr.vlan_tag.ether_type",
"target" : ["vlan_tag", "ether_type"],
"mask" : null
},
{ {
"match_type" : "ternary", "match_type" : "ternary",
"name" : "hdr.ipv4.src_addr", "name" : "hdr.ipv4.src_addr",
@ -5672,7 +5626,7 @@
], ],
"match_type" : "ternary", "match_type" : "ternary",
"type" : "simple", "type" : "simple",
"max_size" : 256, "max_size" : 128,
"with_counters" : true, "with_counters" : true,
"support_timeout" : false, "support_timeout" : false,
"direct_meters" : null, "direct_meters" : null,
@ -6399,7 +6353,7 @@
"id" : 11, "id" : 11,
"source_info" : { "source_info" : {
"filename" : "include/control/forwarding.p4", "filename" : "include/control/forwarding.p4",
"line" : 247, "line" : 246,
"column" : 17, "column" : 17,
"source_fragment" : "fabric_metadata.fwd_type == FWD_IPV4_UNICAST" "source_fragment" : "fabric_metadata.fwd_type == FWD_IPV4_UNICAST"
}, },

View File

@ -141,7 +141,7 @@ tables {
} }
match_fields { match_fields {
id: 3 id: 3
name: "fabric_metadata.original_ether_type" name: "hdr.vlan_tag.ether_type"
bitwidth: 16 bitwidth: 16
match_type: EXACT match_type: EXACT
} }
@ -260,28 +260,28 @@ tables {
} }
match_fields { match_fields {
id: 5 id: 5
name: "fabric_metadata.original_ether_type"
bitwidth: 16
match_type: TERNARY
}
match_fields {
id: 6
name: "hdr.ethernet.dst_addr" name: "hdr.ethernet.dst_addr"
bitwidth: 48 bitwidth: 48
match_type: TERNARY match_type: TERNARY
} }
match_fields { match_fields {
id: 7 id: 6
name: "hdr.ethernet.src_addr" name: "hdr.ethernet.src_addr"
bitwidth: 48 bitwidth: 48
match_type: TERNARY match_type: TERNARY
} }
match_fields { match_fields {
id: 8 id: 7
name: "hdr.vlan_tag.vlan_id" name: "hdr.vlan_tag.vlan_id"
bitwidth: 12 bitwidth: 12
match_type: TERNARY match_type: TERNARY
} }
match_fields {
id: 8
name: "hdr.vlan_tag.ether_type"
bitwidth: 16
match_type: TERNARY
}
match_fields { match_fields {
id: 9 id: 9
name: "hdr.ipv4.src_addr" name: "hdr.ipv4.src_addr"
@ -324,7 +324,7 @@ tables {
} }
const_default_action_id: 16819938 const_default_action_id: 16819938
direct_resource_ids: 318772272 direct_resource_ids: 318772272
size: 256 size: 128
idle_timeout_behavior: NO_TIMEOUT idle_timeout_behavior: NO_TIMEOUT
} }
tables { tables {

View File

@ -19,7 +19,6 @@
["fabric_metadata_t.ip_proto", 8, false], ["fabric_metadata_t.ip_proto", 8, false],
["fabric_metadata_t.l4_src_port", 16, false], ["fabric_metadata_t.l4_src_port", 16, false],
["fabric_metadata_t.l4_dst_port", 16, false], ["fabric_metadata_t.l4_dst_port", 16, false],
["fabric_metadata_t.original_ether_type", 16, false],
["_padding_0", 2, false] ["_padding_0", 2, false]
] ]
}, },
@ -322,19 +321,6 @@
} }
], ],
"op" : "extract" "op" : "extract"
},
{
"parameters" : [
{
"type" : "field",
"value" : ["scalars", "fabric_metadata_t.original_ether_type"]
},
{
"type" : "field",
"value" : ["ethernet", "ether_type"]
}
],
"op" : "set"
} }
], ],
"transitions" : [ "transitions" : [
@ -387,19 +373,6 @@
} }
], ],
"op" : "extract" "op" : "extract"
},
{
"parameters" : [
{
"type" : "field",
"value" : ["scalars", "fabric_metadata_t.original_ether_type"]
},
{
"type" : "field",
"value" : ["vlan_tag", "ether_type"]
}
],
"op" : "set"
} }
], ],
"transitions" : [ "transitions" : [
@ -694,7 +667,7 @@
"id" : 0, "id" : 0,
"source_info" : { "source_info" : {
"filename" : "include/parser.p4", "filename" : "include/parser.p4",
"line" : 165, "line" : 163,
"column" : 8, "column" : 8,
"source_fragment" : "FabricDeparser" "source_fragment" : "FabricDeparser"
}, },
@ -2683,25 +2656,6 @@
"column" : 31, "column" : 31,
"source_fragment" : "0x0800; ..." "source_fragment" : "0x0800; ..."
} }
},
{
"op" : "assign",
"parameters" : [
{
"type" : "field",
"value" : ["scalars", "fabric_metadata_t.original_ether_type"]
},
{
"type" : "hexstr",
"value" : "0x0800"
}
],
"source_info" : {
"filename" : "include/control/../define.p4",
"line" : 69,
"column" : 31,
"source_fragment" : "0x0800; ..."
}
} }
] ]
}, },
@ -3410,8 +3364,8 @@
}, },
{ {
"match_type" : "exact", "match_type" : "exact",
"name" : "fabric_metadata.original_ether_type", "name" : "hdr.vlan_tag.ether_type",
"target" : ["scalars", "fabric_metadata_t.original_ether_type"], "target" : ["vlan_tag", "ether_type"],
"mask" : null "mask" : null
} }
], ],
@ -3608,12 +3562,6 @@
"target" : ["scalars", "fabric_metadata_t.l4_dst_port"], "target" : ["scalars", "fabric_metadata_t.l4_dst_port"],
"mask" : null "mask" : null
}, },
{
"match_type" : "ternary",
"name" : "fabric_metadata.original_ether_type",
"target" : ["scalars", "fabric_metadata_t.original_ether_type"],
"mask" : null
},
{ {
"match_type" : "ternary", "match_type" : "ternary",
"name" : "hdr.ethernet.dst_addr", "name" : "hdr.ethernet.dst_addr",
@ -3632,6 +3580,12 @@
"target" : ["vlan_tag", "vlan_id"], "target" : ["vlan_tag", "vlan_id"],
"mask" : null "mask" : null
}, },
{
"match_type" : "ternary",
"name" : "hdr.vlan_tag.ether_type",
"target" : ["vlan_tag", "ether_type"],
"mask" : null
},
{ {
"match_type" : "ternary", "match_type" : "ternary",
"name" : "hdr.ipv4.src_addr", "name" : "hdr.ipv4.src_addr",
@ -3659,7 +3613,7 @@
], ],
"match_type" : "ternary", "match_type" : "ternary",
"type" : "simple", "type" : "simple",
"max_size" : 256, "max_size" : 128,
"with_counters" : true, "with_counters" : true,
"support_timeout" : false, "support_timeout" : false,
"direct_meters" : null, "direct_meters" : null,
@ -4190,7 +4144,7 @@
"id" : 3, "id" : 3,
"source_info" : { "source_info" : {
"filename" : "include/control/forwarding.p4", "filename" : "include/control/forwarding.p4",
"line" : 247, "line" : 246,
"column" : 17, "column" : 17,
"source_fragment" : "fabric_metadata.fwd_type == FWD_IPV4_UNICAST" "source_fragment" : "fabric_metadata.fwd_type == FWD_IPV4_UNICAST"
}, },

View File

@ -60,7 +60,7 @@ tables {
} }
match_fields { match_fields {
id: 3 id: 3
name: "fabric_metadata.original_ether_type" name: "hdr.vlan_tag.ether_type"
bitwidth: 16 bitwidth: 16
match_type: EXACT match_type: EXACT
} }
@ -179,28 +179,28 @@ tables {
} }
match_fields { match_fields {
id: 5 id: 5
name: "fabric_metadata.original_ether_type"
bitwidth: 16
match_type: TERNARY
}
match_fields {
id: 6
name: "hdr.ethernet.dst_addr" name: "hdr.ethernet.dst_addr"
bitwidth: 48 bitwidth: 48
match_type: TERNARY match_type: TERNARY
} }
match_fields { match_fields {
id: 7 id: 6
name: "hdr.ethernet.src_addr" name: "hdr.ethernet.src_addr"
bitwidth: 48 bitwidth: 48
match_type: TERNARY match_type: TERNARY
} }
match_fields { match_fields {
id: 8 id: 7
name: "hdr.vlan_tag.vlan_id" name: "hdr.vlan_tag.vlan_id"
bitwidth: 12 bitwidth: 12
match_type: TERNARY match_type: TERNARY
} }
match_fields {
id: 8
name: "hdr.vlan_tag.ether_type"
bitwidth: 16
match_type: TERNARY
}
match_fields { match_fields {
id: 9 id: 9
name: "hdr.ipv4.src_addr" name: "hdr.ipv4.src_addr"
@ -243,7 +243,7 @@ tables {
} }
const_default_action_id: 16819938 const_default_action_id: 16819938
direct_resource_ids: 318772272 direct_resource_ids: 318772272
size: 256 size: 128
idle_timeout_behavior: NO_TIMEOUT idle_timeout_behavior: NO_TIMEOUT
} }
tables { tables {