Skip to content

Commit

Permalink
Compile with larger tables
Browse files Browse the repository at this point in the history
  • Loading branch information
ccascone committed Jun 11, 2020
1 parent 048bc6c commit 9f79de6
Show file tree
Hide file tree
Showing 14 changed files with 65,498 additions and 54,611 deletions.
19 changes: 9 additions & 10 deletions p4src/include/control/forwarding.p4
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,25 @@ control Forwarding (inout parsed_headers_t hdr,
/*
* IPv4 Routing Table.
*/
#ifdef WTIH_DEBUG
#ifdef WITH_DEBUG
DirectCounter<bit<64>>(CounterType_t.PACKETS_AND_BYTES) routing_v4_counter;
#endif // WITH_DEBUG

action set_next_id_routing_v4(next_id_t next_id) {
set_next_id(next_id);
#ifdef WTIH_DEBUG
#ifdef WITH_DEBUG
routing_v4_counter.count();
#endif // WITH_DEBUG
}

action nop_routing_v4() {
// no-op
#ifdef WTIH_DEBUG
#ifdef WITH_DEBUG
routing_v4_counter.count();
#endif // WITH_DEBUG
}

#ifdef _ROUTING_V4_TABLE_ANNOT
_ROUTING_V4_TABLE_ANNOT
#endif
@alpm(1)
table routing_v4 {
key = {
hdr.ipv4.dst_addr: lpm @name("ipv4_dst");
Expand All @@ -101,7 +99,7 @@ control Forwarding (inout parsed_headers_t hdr,
@defaultonly nop;
}
default_action = nop();
#ifdef WTIH_DEBUG
#ifdef WITH_DEBUG
counters = routing_v4_counter;
#endif // WITH_DEBUG
size = ROUTING_V4_TABLE_SIZE;
Expand All @@ -110,17 +108,18 @@ control Forwarding (inout parsed_headers_t hdr,
/*
* IPv6 Routing Table.
*/
#ifdef WTIH_DEBUG
#ifdef WITH_DEBUG
DirectCounter<bit<64>>(CounterType_t.PACKETS_AND_BYTES) routing_v6_counter;
#endif // WITH_DEBUG

action set_next_id_routing_v6(next_id_t next_id) {
set_next_id(next_id);
#ifdef WTIH_DEBUG
#ifdef WITH_DEBUG
routing_v6_counter.count();
#endif // WITH_DEBUG
}

@alpm(1)
table routing_v6 {
key = {
hdr.ipv6.dst_addr: lpm @name("ipv6_dst");
Expand All @@ -130,7 +129,7 @@ control Forwarding (inout parsed_headers_t hdr,
@defaultonly nop;
}
const default_action = nop();
#ifdef WTIH_DEBUG
#ifdef WITH_DEBUG
counters = routing_v6_counter;
#endif // WITH_DEBUG
size = ROUTING_V6_TABLE_SIZE;
Expand Down
44 changes: 29 additions & 15 deletions p4src/include/size.p4
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,34 @@
#define __TABLE_SIZE__

// Default sizes when building for BMv2.
#define FWD_CLASSIFIER_TABLE_SIZE 1024
#define BRIDGING_TABLE_SIZE 1024
#define MPLS_TABLE_SIZE 1024
#define ROUTING_V4_TABLE_SIZE 1024
#define ROUTING_V6_TABLE_SIZE 1024
#define ACL_TABLE_SIZE 1024
#define XCONNECT_NEXT_TABLE_SIZE 1024
#define NEXT_VLAN_TABLE_SIZE 1024
#define SIMPLE_NEXT_TABLE_SIZE 1024
#define HASHED_NEXT_TABLE_SIZE 1024
#define HASHED_SELECTOR_MAX_GROUP_SIZE 32w16
#define HASHED_ACT_PROFILE_SIZE 32w1024
#define MULTICAST_NEXT_TABLE_SIZE 1024
#define EGRESS_VLAN_TABLE_SIZE 1024
#define PORT_VLAN_TABLE_SIZE 1024
#define BNG_MAX_SUBSC 1024
#define BNG_MAX_NET_PER_SUBSC 4
#define BNG_MAX_SUBSC_NET BNG_MAX_NET_PER_SUBSC * BNG_MAX_SUBSC
#ifdef WITH_BNG
#define PORT_VLAN_TABLE_SIZE BNG_MAX_SUBSC + 2048
#else
#define PORT_VLAN_TABLE_SIZE 2048
#endif // WITH_BNG
#define FWD_CLASSIFIER_TABLE_SIZE 128
#define BRIDGING_TABLE_SIZE 2048
#define MPLS_TABLE_SIZE 2048
#ifdef WITH_BNG
#define ROUTING_V4_TABLE_SIZE BNG_MAX_SUBSC_NET + 1024
#else
#define ROUTING_V4_TABLE_SIZE 30000
#endif // WITH_BNG
#define ROUTING_V6_TABLE_SIZE 1000
#define ACL_TABLE_SIZE 2048
// Depends on number of unique next_id expected
#define NEXT_VLAN_TABLE_SIZE 2048
#define XCONNECT_NEXT_TABLE_SIZE 4096
#define SIMPLE_NEXT_TABLE_SIZE 2048
#define HASHED_NEXT_TABLE_SIZE 2048
// Max size of ECMP groups
#define HASHED_SELECTOR_MAX_GROUP_SIZE 16
// Ideally HASHED_NEXT_TABLE_SIZE * HASHED_SELECTOR_MAX_GROUP_SIZE
#define HASHED_ACT_PROFILE_SIZE 32w32768
#define MULTICAST_NEXT_TABLE_SIZE 2048
#define EGRESS_VLAN_TABLE_SIZE 2048

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name" : "pipe.FabricIngress.filtering.ingress_port_vlan",
"id" : 33583783,
"table_type" : "MatchAction_Direct",
"size" : 1024,
"size" : 2048,
"annotations" : [],
"depends_on" : [],
"has_const_default_action" : true,
Expand Down Expand Up @@ -143,7 +143,7 @@
"name" : "pipe.FabricIngress.filtering.fwd_classifier",
"id" : 33565260,
"table_type" : "MatchAction_Direct",
"size" : 1024,
"size" : 128,
"annotations" : [],
"depends_on" : [],
"has_const_default_action" : true,
Expand Down Expand Up @@ -267,7 +267,7 @@
"name" : "pipe.FabricIngress.forwarding.bridging",
"id" : 33614610,
"table_type" : "MatchAction_Direct",
"size" : 1024,
"size" : 2048,
"annotations" : [],
"depends_on" : [],
"has_const_default_action" : true,
Expand Down Expand Up @@ -378,7 +378,7 @@
"name" : "pipe.FabricIngress.forwarding.mpls",
"id" : 33595971,
"table_type" : "MatchAction_Direct",
"size" : 1024,
"size" : 2048,
"annotations" : [],
"depends_on" : [],
"has_const_default_action" : true,
Expand Down Expand Up @@ -466,8 +466,12 @@
"name" : "pipe.FabricIngress.forwarding.routing_v4",
"id" : 33569937,
"table_type" : "MatchAction_Direct",
"size" : 1024,
"annotations" : [],
"size" : 30000,
"annotations" : [
{
"name" : "@alpm(1)"
}
],
"depends_on" : [],
"has_const_default_action" : false,
"key" : [
Expand Down Expand Up @@ -532,8 +536,12 @@
"name" : "pipe.FabricIngress.forwarding.routing_v6",
"id" : 33555495,
"table_type" : "MatchAction_Direct",
"size" : 1024,
"annotations" : [],
"size" : 1000,
"annotations" : [
{
"name" : "@alpm(1)"
}
],
"depends_on" : [],
"has_const_default_action" : true,
"key" : [
Expand Down Expand Up @@ -591,7 +599,7 @@
"name" : "pipe.FabricIngress.acl.acl",
"id" : 33572538,
"table_type" : "MatchAction_Direct",
"size" : 1024,
"size" : 2048,
"annotations" : [],
"depends_on" : [],
"has_const_default_action" : true,
Expand Down Expand Up @@ -859,7 +867,7 @@
"name" : "pipe.FabricIngress.next.next_vlan",
"id" : 33608335,
"table_type" : "MatchAction_Direct",
"size" : 1024,
"size" : 2048,
"annotations" : [],
"depends_on" : [],
"has_const_default_action" : true,
Expand Down Expand Up @@ -979,7 +987,7 @@
"name" : "pipe.FabricIngress.next.xconnect",
"id" : 33562937,
"table_type" : "MatchAction_Direct",
"size" : 1024,
"size" : 4096,
"annotations" : [],
"depends_on" : [],
"has_const_default_action" : true,
Expand Down Expand Up @@ -1099,7 +1107,7 @@
"name" : "pipe.FabricIngress.next.hashed",
"id" : 33577058,
"table_type" : "MatchAction_Indirect_Selector",
"size" : 1024,
"size" : 2048,
"annotations" : [],
"depends_on" : [2164308218, 2181085434],
"has_const_default_action" : true,
Expand Down Expand Up @@ -1178,7 +1186,7 @@
"name" : "pipe.FabricIngress.next.multicast",
"id" : 33581913,
"table_type" : "MatchAction_Direct",
"size" : 1024,
"size" : 2048,
"annotations" : [],
"depends_on" : [],
"has_const_default_action" : true,
Expand Down Expand Up @@ -1266,7 +1274,7 @@
"name" : "pipe.FabricEgress.egress_next.egress_vlan",
"id" : 33586443,
"table_type" : "MatchAction_Direct",
"size" : 1024,
"size" : 2048,
"annotations" : [],
"depends_on" : [],
"has_const_default_action" : true,
Expand Down Expand Up @@ -1353,7 +1361,7 @@
"name" : "pipe.FabricIngress.next.hashed_profile",
"id" : 2164322943,
"table_type" : "Action",
"size" : 1024,
"size" : 32768,
"annotations" : [],
"depends_on" : [2164322943],
"key" : [
Expand Down Expand Up @@ -1510,7 +1518,7 @@
"name" : "pipe.FabricIngress.next.hashed_selector",
"id" : 2181085434,
"table_type" : "Selector",
"size" : 1024,
"size" : 2048,
"annotations" : [],
"depends_on" : [],
"key" : [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tables {
}
const_default_action_id: 16836487
direct_resource_ids: 318814845
size: 1024
size: 2048
}
tables {
preamble {
Expand Down Expand Up @@ -79,7 +79,7 @@ tables {
}
const_default_action_id: 16840921
direct_resource_ids: 318811056
size: 1024
size: 128
}
tables {
preamble {
Expand Down Expand Up @@ -109,7 +109,7 @@ tables {
}
const_default_action_id: 16819938
direct_resource_ids: 318782987
size: 1024
size: 2048
}
tables {
preamble {
Expand All @@ -133,13 +133,14 @@ tables {
}
const_default_action_id: 16819938
direct_resource_ids: 318830188
size: 1024
size: 2048
}
tables {
preamble {
id: 33569937
name: "FabricIngress.forwarding.routing_v4"
alias: "routing_v4"
annotations: "@alpm(1)"
}
match_fields {
id: 1
Expand All @@ -158,13 +159,14 @@ tables {
annotations: "@defaultonly"
scope: DEFAULT_ONLY
}
size: 1024
size: 30000
}
tables {
preamble {
id: 33555495
name: "FabricIngress.forwarding.routing_v6"
alias: "routing_v6"
annotations: "@alpm(1)"
}
match_fields {
id: 1
Expand All @@ -181,7 +183,7 @@ tables {
scope: DEFAULT_ONLY
}
const_default_action_id: 16819938
size: 1024
size: 1000
}
tables {
preamble {
Expand Down Expand Up @@ -281,7 +283,7 @@ tables {
}
const_default_action_id: 16827694
direct_resource_ids: 318815483
size: 1024
size: 2048
}
tables {
preamble {
Expand All @@ -308,7 +310,7 @@ tables {
}
const_default_action_id: 16819938
direct_resource_ids: 318806340
size: 1024
size: 2048
}
tables {
preamble {
Expand Down Expand Up @@ -341,7 +343,7 @@ tables {
}
const_default_action_id: 16819938
direct_resource_ids: 318824131
size: 1024
size: 4096
}
tables {
preamble {
Expand Down Expand Up @@ -372,7 +374,7 @@ tables {
const_default_action_id: 16819938
implementation_id: 285274751
direct_resource_ids: 318797344
size: 1024
size: 2048
}
tables {
preamble {
Expand All @@ -396,7 +398,7 @@ tables {
}
const_default_action_id: 16819938
direct_resource_ids: 318814436
size: 1024
size: 2048
}
tables {
preamble {
Expand Down Expand Up @@ -426,7 +428,7 @@ tables {
}
const_default_action_id: 16819938
direct_resource_ids: 318817765
size: 1024
size: 2048
}
actions {
preamble {
Expand Down Expand Up @@ -721,7 +723,7 @@ action_profiles {
}
table_ids: 33577058
with_selector: true
size: 1024
size: 32768
max_group_size: 16
}
direct_counters {
Expand Down
Loading

0 comments on commit 9f79de6

Please sign in to comment.