Skip to content

Commit

Permalink
swss-common: Update database defintions for PINs / P4Runtime
Browse files Browse the repository at this point in the history
* Added APPL STATE DB for response path
* Added table schema for P4RT routing, WCMP, and ACL

Submission containing materials of a third party:
    Copyright Google LLC; Licensed under Apache 2.0

Co-authored-by: Jay Hu <[email protected]>
Co-authored-by: Yilan Ji <[email protected]>
Co-authored-by: Runming Wu <[email protected]>
Co-authored-by: Akarsh Gupta <[email protected]>
Co-authored-by: Manali Kumar <[email protected]>

Signed-off-by: Don Newton [email protected]
  • Loading branch information
PINS Working Group authored and donNewtonAlpha committed Oct 11, 2021
1 parent b15e08d commit 2d08469
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions common/database_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
"id" : 13,
"separator": "|",
"instance" : "redis_chassis"
},
"APPL_STATE_DB" : {
"id" : 63,
"separator": ":",
"instance" : "redis"
}
},
"VERSION" : "1.0"
Expand Down
12 changes: 12 additions & 0 deletions common/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace swss {
#define GB_FLEX_COUNTER_DB 11
#define CHASSIS_APP_DB 12
#define CHASSIS_STATE_DB 13
#define APPL_STATE_DB 63

/***** APPLICATION DATABASE *****/

Expand All @@ -43,6 +44,17 @@ namespace swss {
#define APP_NEXTHOP_GROUP_TABLE_NAME "NEXTHOP_GROUP_TABLE"
#define APP_CLASS_BASED_NEXT_HOP_GROUP_TABLE_NAME "CLASS_BASED_NEXT_HOP_GROUP_TABLE"

#define APP_P4RT_TABLE_NAME "P4RT"
#define APP_P4RT_TABLE_NAME_SEPARATOR ":"
#define APP_P4RT_ROUTER_INTERFACE_TABLE_NAME "FIXED_ROUTER_INTERFACE_TABLE"
#define APP_P4RT_NEIGHBOR_TABLE_NAME "FIXED_NEIGHBOR_TABLE"
#define APP_P4RT_NEXTHOP_TABLE_NAME "FIXED_NEXTHOP_TABLE"
#define APP_P4RT_WCMP_GROUP_TABLE_NAME "FIXED_WCMP_GROUP_TABLE"
#define APP_P4RT_IPV4_TABLE_NAME "FIXED_IPV4_TABLE"
#define APP_P4RT_IPV6_TABLE_NAME "FIXED_IPV6_TABLE"
#define APP_P4RT_ACL_TABLE_DEFINITION_NAME "DEFINITION"
#define APP_P4RT_MIRROR_SESSION_TABLE_NAME "FIXED_MIRROR_SESSION_TABLE"

#define APP_COPP_TABLE_NAME "COPP_TABLE"
#define APP_VRF_TABLE_NAME "VRF_TABLE"
#define APP_VNET_TABLE_NAME "VNET_TABLE"
Expand Down
3 changes: 2 additions & 1 deletion common/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const TableNameSeparatorMap TableBase::tableNameSeparatorMap = {
{ CONFIG_DB, TABLE_NAME_SEPARATOR_VBAR },
{ PFC_WD_DB, TABLE_NAME_SEPARATOR_COLON },
{ FLEX_COUNTER_DB, TABLE_NAME_SEPARATOR_COLON },
{ STATE_DB, TABLE_NAME_SEPARATOR_VBAR }
{ STATE_DB, TABLE_NAME_SEPARATOR_VBAR },
{ APPL_STATE_DB, TABLE_NAME_SEPARATOR_COLON }
};

Table::Table(const DBConnector *db, const string &tableName)
Expand Down
5 changes: 5 additions & 0 deletions tests/redis_multi_db_ut_config/database_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@
"id" : 15,
"separator": ":",
"instance" : "redis"
},
"APPL_STATE_DB" : {
"id" : 63,
"separator": ":",
"instance" : "redis"
}
},
"VERSION" : "1.0"
Expand Down

0 comments on commit 2d08469

Please sign in to comment.