Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update database defintions for PINs / P4Runtime #536

Merged
merged 6 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Comment on lines +48 to +55
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every table will be prefixed with "P4RT_TABLE:" so this will create:
P4RT_TABLE:P4RT_ROUTER_INTERFACE_TABLE which I think is needlessly verbose.

I would prefer the old enum.


#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 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ APPL_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