Skip to content

Commit

Permalink
Reduce outbound routing to 4k and mapping to 8k by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyzhai committed Nov 12, 2024
1 parent ee1fa23 commit ff185b0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
15 changes: 15 additions & 0 deletions dash-pipeline/bmv2/defines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef _DASH_DEFINES_H_
#define _DASH_DEFINES_H_

#ifdef TABLE_FULL_SCALE
#define TABLE_CA_TO_PA_SIZE (8 * 1024 * 1024)
#define TABLE_ROUTING_SIZE (4 * 1024 * 1024)

#else /* default size */
#define TABLE_CA_TO_PA_SIZE (8 * 1024)
#define TABLE_ROUTING_SIZE (4 * 1024)

#endif


#endif /* _DASH_DEFINES_H_ */
3 changes: 2 additions & 1 deletion dash-pipeline/bmv2/stages/outbound_mapping.p4
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _DASH_STAGE_OUTBOUND_MAPPING_P4_

#include "../dash_routing_types.p4"
#include "../defines.h"

control outbound_mapping_stage(
inout headers_t hdr,
Expand All @@ -23,7 +24,7 @@ control outbound_mapping_stage(
set_private_link_mapping(hdr, meta);
@defaultonly drop(meta);
}
size = 8 * 1024 * 1024;
size = TABLE_CA_TO_PA_SIZE;
const default_action = drop(meta);

ATTACH_TABLE_COUNTER(ca_to_pa_counter)
Expand Down
3 changes: 2 additions & 1 deletion dash-pipeline/bmv2/stages/outbound_routing.p4
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _DASH_STAGE_OUTBOUND_ROUTING_P4_

#include "../dash_routing_types.p4"
#include "../defines.h"

control outbound_routing_stage(
inout headers_t hdr,
Expand Down Expand Up @@ -40,7 +41,7 @@ control outbound_routing_stage(
route_service_tunnel(hdr, meta);
drop(meta);
}
size = 4 * 1024 * 1024;
size = TABLE_ROUTING_SIZE;
const default_action = drop(meta);

ATTACH_TABLE_COUNTER(routing_counter)
Expand Down

0 comments on commit ff185b0

Please sign in to comment.