From 8ed00ca6f695b34b995ffc5847974f96e6ad84a3 Mon Sep 17 00:00:00 2001 From: PINS Working Group Date: Mon, 11 Oct 2021 16:39:13 -0400 Subject: [PATCH 1/6] Update database defintions for PINs / P4Runtime * 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 Co-authored-by: Yilan Ji Co-authored-by: Runming Wu Co-authored-by: Akarsh Gupta Co-authored-by: Manali Kumar Signed-off-by: Don Newton don@opennetworking.org --- common/database_config.json | 5 +++++ common/schema.h | 12 ++++++++++++ common/table.cpp | 3 ++- tests/redis_multi_db_ut_config/database_config.json | 5 +++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/common/database_config.json b/common/database_config.json index e32dae81f..aa6f44233 100644 --- a/common/database_config.json +++ b/common/database_config.json @@ -86,6 +86,11 @@ "id" : 13, "separator": "|", "instance" : "redis_chassis" + }, + "APPL_STATE_DB" : { + "id" : 63, + "separator": ":", + "instance" : "redis" } }, "VERSION" : "1.0" diff --git a/common/schema.h b/common/schema.h index 2b3761e63..e7c2885bb 100644 --- a/common/schema.h +++ b/common/schema.h @@ -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 *****/ @@ -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" diff --git a/common/table.cpp b/common/table.cpp index 47f5345a9..cc2234d07 100644 --- a/common/table.cpp +++ b/common/table.cpp @@ -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) diff --git a/tests/redis_multi_db_ut_config/database_config.json b/tests/redis_multi_db_ut_config/database_config.json index 559ebdff3..b1273e6ee 100644 --- a/tests/redis_multi_db_ut_config/database_config.json +++ b/tests/redis_multi_db_ut_config/database_config.json @@ -96,6 +96,11 @@ "id" : 15, "separator": ":", "instance" : "redis" + }, + "APPL_STATE_DB" : { + "id" : 63, + "separator": ":", + "instance" : "redis" } }, "VERSION" : "1.0" From b1a6ea2b299d1c4fd37c475a3a22df499bae2cf1 Mon Sep 17 00:00:00 2001 From: PINS Working Group Date: Tue, 12 Oct 2021 12:47:42 -0400 Subject: [PATCH 2/6] [swss_common] :database schema *Updating db const values to align with convention Signed-off-by: Don Newton don@opennetworking.org --- common/schema.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/common/schema.h b/common/schema.h index e7c2885bb..784b535ac 100644 --- a/common/schema.h +++ b/common/schema.h @@ -22,7 +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 +#define APPL_STATE_DB 14 /***** APPLICATION DATABASE *****/ @@ -44,16 +44,15 @@ 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_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" From 905f9b8d33dd3389030c100ec7fdbf3b0b54c45d Mon Sep 17 00:00:00 2001 From: PINS Working Group Date: Tue, 12 Oct 2021 12:58:25 -0400 Subject: [PATCH 3/6] [database config json] *fix P4rt table references Signed of by Don Newton don@opennetworking.org --- common/database_config.json | 2 +- tests/redis_multi_db_ut_config/database_config.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/database_config.json b/common/database_config.json index aa6f44233..67b5cda88 100644 --- a/common/database_config.json +++ b/common/database_config.json @@ -88,7 +88,7 @@ "instance" : "redis_chassis" }, "APPL_STATE_DB" : { - "id" : 63, + "id" : 14, "separator": ":", "instance" : "redis" } diff --git a/tests/redis_multi_db_ut_config/database_config.json b/tests/redis_multi_db_ut_config/database_config.json index b1273e6ee..b5732e03e 100644 --- a/tests/redis_multi_db_ut_config/database_config.json +++ b/tests/redis_multi_db_ut_config/database_config.json @@ -98,7 +98,7 @@ "instance" : "redis" }, "APPL_STATE_DB" : { - "id" : 63, + "id" : 14, "separator": ":", "instance" : "redis" } From 9a2cb7ba8662c181f9823f048398f53e4edd9268 Mon Sep 17 00:00:00 2001 From: Donald Newton Date: Mon, 18 Oct 2021 14:30:00 -0400 Subject: [PATCH 4/6] [db schema] - convert APPl_STATE_DB to VBAR separator Signed-of-by: Don Newton --- common/table.cpp | 2 +- tests/redis_multi_db_ut_config/database_config.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/table.cpp b/common/table.cpp index cc2234d07..a927e9cb1 100644 --- a/common/table.cpp +++ b/common/table.cpp @@ -29,7 +29,7 @@ const TableNameSeparatorMap TableBase::tableNameSeparatorMap = { { PFC_WD_DB, TABLE_NAME_SEPARATOR_COLON }, { FLEX_COUNTER_DB, TABLE_NAME_SEPARATOR_COLON }, { STATE_DB, TABLE_NAME_SEPARATOR_VBAR }, - { APPL_STATE_DB, TABLE_NAME_SEPARATOR_COLON } + { APPL_STATE_DB, TABLE_NAME_SEPARATOR_VBAR } }; Table::Table(const DBConnector *db, const string &tableName) diff --git a/tests/redis_multi_db_ut_config/database_config.json b/tests/redis_multi_db_ut_config/database_config.json index b5732e03e..716320ef3 100644 --- a/tests/redis_multi_db_ut_config/database_config.json +++ b/tests/redis_multi_db_ut_config/database_config.json @@ -99,7 +99,7 @@ }, "APPL_STATE_DB" : { "id" : 14, - "separator": ":", + "separator": "|", "instance" : "redis" } }, From 382505592a70bca81037900d74c3c481b3949fc6 Mon Sep 17 00:00:00 2001 From: Donald Newton Date: Mon, 18 Oct 2021 15:48:32 -0400 Subject: [PATCH 5/6] [test db config] - fixed database ordering Signed-off-by: Don Newton --- tests/redis_multi_db_ut_config/database_config.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/redis_multi_db_ut_config/database_config.json b/tests/redis_multi_db_ut_config/database_config.json index 716320ef3..b6b68e5a0 100644 --- a/tests/redis_multi_db_ut_config/database_config.json +++ b/tests/redis_multi_db_ut_config/database_config.json @@ -92,15 +92,15 @@ "separator": "|", "instance" : "redis" }, - "TEST_DB" : { - "id" : 15, - "separator": ":", - "instance" : "redis" - }, "APPL_STATE_DB" : { "id" : 14, "separator": "|", "instance" : "redis" + }, + "TEST_DB" : { + "id" : 15, + "separator": ":", + "instance" : "redis" } }, "VERSION" : "1.0" From 8b563fc46716e72563b5a6128ea1607857ea949a Mon Sep 17 00:00:00 2001 From: Donald Newton Date: Tue, 19 Oct 2021 12:11:03 -0400 Subject: [PATCH 6/6] [database_config.json] - changing separator to VBAR Signed-off-by Don Newton --- common/database_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/database_config.json b/common/database_config.json index 67b5cda88..818175aa1 100644 --- a/common/database_config.json +++ b/common/database_config.json @@ -89,7 +89,7 @@ }, "APPL_STATE_DB" : { "id" : 14, - "separator": ":", + "separator": "|", "instance" : "redis" } },