Skip to content

Commit

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

Signed-off-by: Don Newton don@opennetworking.org
Co-authored-by: PINS Working Group <sonic-pins-subgroup@googlegroups.com>
  • Loading branch information
donNewtonAlpha and PINS Working Group authored Oct 21, 2021
1 parent e002e40 commit 4f5da5a
Show file tree
Hide file tree
Showing 4 changed files with 23 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" : 14,
"separator": "|",
"instance" : "redis"
}
},
"VERSION" : "1.0"
Expand Down
11 changes: 11 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 14

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

Expand All @@ -43,6 +44,16 @@ 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_TABLE"
#define APP_P4RT_ROUTER_INTERFACE_TABLE_NAME "P4RT_ROUTER_INTERFACE_TABLE"
#define APP_P4RT_NEIGHBOR_TABLE_NAME "P4RT_NEIGHBOR_TABLE"
#define APP_P4RT_NEXTHOP_TABLE_NAME "P4RT_NEXTHOP_TABLE"
#define APP_P4RT_WCMP_GROUP_TABLE_NAME "P4RT_WCMP_GROUP_TABLE"
#define APP_P4RT_IPV4_TABLE_NAME "P4RT_IPV4_TABLE"
#define APP_P4RT_IPV6_TABLE_NAME "P4RT_IPV6_TABLE"
#define APP_P4RT_ACL_TABLE_DEFINITION_NAME "P4RT_ACL_TABLE_DEFINITION"
#define APP_P4RT_MIRROR_SESSION_TABLE_NAME "P4RT_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_VBAR }
};

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 @@ -92,6 +92,11 @@
"separator": "|",
"instance" : "redis"
},
"APPL_STATE_DB" : {
"id" : 14,
"separator": "|",
"instance" : "redis"
},
"TEST_DB" : {
"id" : 15,
"separator": ":",
Expand Down

0 comments on commit 4f5da5a

Please sign in to comment.