First stab at BNG support in fabric.p4
This implementation is derived from Deutsche Telekom contribution:
https://github.com/opencord/p4se
It supports basic upstream and downstream termination based on double
VLAN tags and PPPoE, including counters and downstream metering.
Change-Id: I940959f2338d7319654cf665f6cfe2de7200616b
diff --git a/pipelines/fabric/src/main/resources/p4c-out/fabric-full/bmv2/default/p4info.txt b/pipelines/fabric/src/main/resources/p4c-out/fabric-full/bmv2/default/p4info.txt
index 1f9c03c..eaff419 100644
--- a/pipelines/fabric/src/main/resources/p4c-out/fabric-full/bmv2/default/p4info.txt
+++ b/pipelines/fabric/src/main/resources/p4c-out/fabric-full/bmv2/default/p4info.txt
@@ -45,6 +45,258 @@
}
tables {
preamble {
+ id: 33584710
+ name: "FabricIngress.bng_ingress.upstream.t_line_map"
+ alias: "t_line_map"
+ }
+ match_fields {
+ id: 1
+ name: "s_tag"
+ bitwidth: 12
+ match_type: EXACT
+ }
+ match_fields {
+ id: 2
+ name: "c_tag"
+ bitwidth: 12
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16819938
+ annotations: "@defaultonly"
+ scope: DEFAULT_ONLY
+ }
+ action_refs {
+ id: 16829434
+ }
+ const_default_action_id: 16819938
+ size: 8192
+}
+tables {
+ preamble {
+ id: 33603300
+ name: "FabricIngress.bng_ingress.upstream.t_pppoe_cp"
+ alias: "t_pppoe_cp"
+ }
+ match_fields {
+ id: 1
+ name: "pppoe_code"
+ bitwidth: 8
+ match_type: EXACT
+ }
+ match_fields {
+ id: 2
+ name: "pppoe_protocol"
+ bitwidth: 16
+ match_type: TERNARY
+ }
+ action_refs {
+ id: 16830893
+ }
+ action_refs {
+ id: 16819938
+ annotations: "@defaultonly"
+ scope: DEFAULT_ONLY
+ }
+ const_default_action_id: 16819938
+ size: 16
+}
+tables {
+ preamble {
+ id: 33595047
+ name: "FabricIngress.bng_ingress.upstream.t_pppoe_term_v4"
+ alias: "t_pppoe_term_v4"
+ }
+ match_fields {
+ id: 1
+ name: "line_id"
+ bitwidth: 32
+ match_type: EXACT
+ }
+ match_fields {
+ id: 2
+ name: "ipv4_src"
+ bitwidth: 32
+ match_type: EXACT
+ }
+ match_fields {
+ id: 3
+ name: "pppoe_session_id"
+ bitwidth: 16
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16780562
+ }
+ action_refs {
+ id: 16785853
+ annotations: "@defaultonly"
+ scope: DEFAULT_ONLY
+ }
+ const_default_action_id: 16785853
+ size: 32768
+}
+tables {
+ preamble {
+ id: 33579386
+ name: "FabricIngress.bng_ingress.upstream.t_pppoe_term_v6"
+ alias: "t_pppoe_term_v6"
+ }
+ match_fields {
+ id: 1
+ name: "line_id"
+ bitwidth: 32
+ match_type: EXACT
+ }
+ match_fields {
+ id: 2
+ name: "ipv6_src_net_id"
+ bitwidth: 64
+ match_type: EXACT
+ }
+ match_fields {
+ id: 3
+ name: "pppoe_session_id"
+ bitwidth: 16
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16824882
+ }
+ action_refs {
+ id: 16785853
+ annotations: "@defaultonly"
+ scope: DEFAULT_ONLY
+ }
+ const_default_action_id: 16785853
+ size: 32768
+}
+tables {
+ preamble {
+ id: 33555367
+ name: "FabricIngress.bng_ingress.downstream.t_line_map_v4"
+ alias: "t_line_map_v4"
+ }
+ match_fields {
+ id: 1
+ name: "ipv4_dst"
+ bitwidth: 32
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16819938
+ annotations: "@defaultonly"
+ scope: DEFAULT_ONLY
+ }
+ action_refs {
+ id: 16798636
+ }
+ action_refs {
+ id: 16842299
+ }
+ const_default_action_id: 16819938
+ size: 32768
+}
+tables {
+ preamble {
+ id: 33572185
+ name: "FabricIngress.bng_ingress.downstream.t_line_map_v6"
+ alias: "t_line_map_v6"
+ }
+ match_fields {
+ id: 1
+ name: "ipv6_dst_net_id"
+ bitwidth: 64
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16819938
+ annotations: "@defaultonly"
+ scope: DEFAULT_ONLY
+ }
+ action_refs {
+ id: 16798636
+ }
+ action_refs {
+ id: 16842299
+ }
+ const_default_action_id: 16819938
+ size: 32768
+}
+tables {
+ preamble {
+ id: 33602462
+ name: "FabricIngress.bng_ingress.downstream.t_qos_v4"
+ alias: "t_qos_v4"
+ }
+ match_fields {
+ id: 1
+ name: "line_id"
+ bitwidth: 32
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 2
+ name: "ipv4_src"
+ bitwidth: 32
+ match_type: LPM
+ }
+ match_fields {
+ id: 3
+ name: "ipv4_dscp"
+ bitwidth: 6
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 4
+ name: "ipv4_ecn"
+ bitwidth: 2
+ match_type: TERNARY
+ }
+ action_refs {
+ id: 16830304
+ }
+ action_refs {
+ id: 16804676
+ }
+ const_default_action_id: 16804676
+ size: 256
+}
+tables {
+ preamble {
+ id: 33616597
+ name: "FabricIngress.bng_ingress.downstream.t_qos_v6"
+ alias: "t_qos_v6"
+ }
+ match_fields {
+ id: 1
+ name: "line_id"
+ bitwidth: 32
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 2
+ name: "ipv6_src"
+ bitwidth: 128
+ match_type: LPM
+ }
+ match_fields {
+ id: 3
+ name: "ipv6_traffic_class"
+ bitwidth: 8
+ match_type: TERNARY
+ }
+ action_refs {
+ id: 16830304
+ }
+ action_refs {
+ id: 16804676
+ }
+ const_default_action_id: 16804676
+ size: 256
+}
+tables {
+ preamble {
id: 33581620
name: "FabricIngress.process_set_source_sink.tb_set_source"
alias: "tb_set_source"
@@ -505,6 +757,32 @@
}
tables {
preamble {
+ id: 33576241
+ name: "FabricEgress.bng_egress.downstream.t_session_encap"
+ alias: "t_session_encap"
+ }
+ match_fields {
+ id: 1
+ name: "line_id"
+ bitwidth: 32
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16819938
+ annotations: "@defaultonly"
+ scope: DEFAULT_ONLY
+ }
+ action_refs {
+ id: 16784000
+ }
+ action_refs {
+ id: 16801306
+ }
+ const_default_action_id: 16819938
+ size: 8192
+}
+tables {
+ preamble {
id: 33612258
name: "FabricEgress.process_int_main.process_int_source.tb_int_source"
alias: "tb_int_source"
@@ -645,6 +923,89 @@
}
actions {
preamble {
+ id: 16829434
+ name: "FabricIngress.bng_ingress.upstream.set_line"
+ alias: "set_line"
+ }
+ params {
+ id: 1
+ name: "line_id"
+ bitwidth: 32
+ }
+}
+actions {
+ preamble {
+ id: 16830893
+ name: "FabricIngress.bng_ingress.upstream.punt_to_cpu"
+ alias: "upstream.punt_to_cpu"
+ }
+}
+actions {
+ preamble {
+ id: 16785853
+ name: "FabricIngress.bng_ingress.upstream.term_disabled"
+ alias: "term_disabled"
+ }
+}
+actions {
+ preamble {
+ id: 16780562
+ name: "FabricIngress.bng_ingress.upstream.term_enabled_v4"
+ alias: "term_enabled_v4"
+ }
+}
+actions {
+ preamble {
+ id: 16824882
+ name: "FabricIngress.bng_ingress.upstream.term_enabled_v6"
+ alias: "term_enabled_v6"
+ }
+}
+actions {
+ preamble {
+ id: 16798636
+ name: "FabricIngress.bng_ingress.downstream.set_line_next"
+ alias: "set_line_next"
+ }
+ params {
+ id: 1
+ name: "line_id"
+ bitwidth: 32
+ }
+ params {
+ id: 2
+ name: "next_id"
+ bitwidth: 32
+ }
+}
+actions {
+ preamble {
+ id: 16842299
+ name: "FabricIngress.bng_ingress.downstream.set_line_drop"
+ alias: "set_line_drop"
+ }
+ params {
+ id: 1
+ name: "line_id"
+ bitwidth: 32
+ }
+}
+actions {
+ preamble {
+ id: 16830304
+ name: "FabricIngress.bng_ingress.downstream.qos_prio"
+ alias: "qos_prio"
+ }
+}
+actions {
+ preamble {
+ id: 16804676
+ name: "FabricIngress.bng_ingress.downstream.qos_besteff"
+ alias: "qos_besteff"
+ }
+}
+actions {
+ preamble {
id: 16778827
name: "FabricIngress.process_set_source_sink.int_set_source"
alias: "int_set_source"
@@ -766,7 +1127,7 @@
preamble {
id: 16829684
name: "FabricIngress.acl.punt_to_cpu"
- alias: "punt_to_cpu"
+ alias: "acl.punt_to_cpu"
}
}
actions {
@@ -969,6 +1330,40 @@
}
actions {
preamble {
+ id: 16784000
+ name: "FabricEgress.bng_egress.downstream.encap_v4"
+ alias: "encap_v4"
+ }
+ params {
+ id: 1
+ name: "c_tag"
+ bitwidth: 12
+ }
+ params {
+ id: 2
+ name: "pppoe_session_id"
+ bitwidth: 16
+ }
+}
+actions {
+ preamble {
+ id: 16801306
+ name: "FabricEgress.bng_egress.downstream.encap_v6"
+ alias: "encap_v6"
+ }
+ params {
+ id: 1
+ name: "c_tag"
+ bitwidth: 12
+ }
+ params {
+ id: 2
+ name: "pppoe_session_id"
+ bitwidth: 16
+ }
+}
+actions {
+ preamble {
id: 16785857
name: "FabricEgress.process_int_main.process_int_source.int_source_dscp"
alias: "int_source_dscp"
@@ -1058,6 +1453,50 @@
}
counters {
preamble {
+ id: 302022672
+ name: "FabricIngress.bng_ingress.upstream.c_terminated"
+ alias: "c_terminated"
+ }
+ spec {
+ unit: PACKETS
+ }
+ size: 8192
+}
+counters {
+ preamble {
+ id: 302043418
+ name: "FabricIngress.bng_ingress.upstream.c_dropped"
+ alias: "c_dropped"
+ }
+ spec {
+ unit: PACKETS
+ }
+ size: 8192
+}
+counters {
+ preamble {
+ id: 302008909
+ name: "FabricIngress.bng_ingress.upstream.c_control"
+ alias: "c_control"
+ }
+ spec {
+ unit: PACKETS
+ }
+ size: 8192
+}
+counters {
+ preamble {
+ id: 302004781
+ name: "FabricIngress.bng_ingress.downstream.c_line_rx"
+ alias: "c_line_rx"
+ }
+ spec {
+ unit: BOTH
+ }
+ size: 8192
+}
+counters {
+ preamble {
id: 302011205
name: "FabricIngress.port_counters_control.egress_port_counter"
alias: "egress_port_counter"
@@ -1078,6 +1517,17 @@
}
size: 511
}
+counters {
+ preamble {
+ id: 302046535
+ name: "FabricEgress.bng_egress.downstream.c_line_tx"
+ alias: "c_line_tx"
+ }
+ spec {
+ unit: BOTH
+ }
+ size: 8192
+}
direct_counters {
preamble {
id: 318781522
@@ -1265,6 +1715,28 @@
}
direct_table_id: 33599342
}
+meters {
+ preamble {
+ id: 335569952
+ name: "FabricIngress.bng_ingress.downstream.m_besteff"
+ alias: "m_besteff"
+ }
+ spec {
+ unit: BYTES
+ }
+ size: 8192
+}
+meters {
+ preamble {
+ id: 335568260
+ name: "FabricIngress.bng_ingress.downstream.m_prio"
+ alias: "m_prio"
+ }
+ spec {
+ unit: BYTES
+ }
+ size: 8192
+}
controller_packet_metadata {
preamble {
id: 67146229