From e3f50e870f5f205771fb0826a350e0103d98e3df Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Thu, 25 Jan 2024 17:12:08 -0800 Subject: [PATCH 1/3] Update SAI submodule. The primary purpose of this is to bring in support for compiling on Debian Bookworm. This brings in the following changes: * Update the Doxyfile for doxygen in Debian Bookworm (opencomputeproject/SAI#1946) * Enable sai_uint16_t in ProcessStructValueType Struct Member (opencomputeproject/SAI#1949) * [meta] Add support for port stat extensions (opencomputeproject/SAI#1947) * [meta] Add custom range start end values check (opencomputeproject/SAI#1945) * Cable diagnostics attribute added (opencomputeproject/SAI#1894) * Add attributes to disable L3 rewrites (opencomputeproject/SAI#1924) * Add MAC remote loopback to the port loopback enums. (opencomputeproject/SAI#1934) * [TAM] Granular counter subscription (opencomputeproject/SAI#1670) Signed-off-by: Saikrishna Arcot --- SAI | 2 +- lib/sai_redis_tam.cpp | 2 ++ vslib/sai_vs_tam.cpp | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/SAI b/SAI index 96143eef4..c7a49cce5 160000 --- a/SAI +++ b/SAI @@ -1 +1 @@ -Subproject commit 96143eef4a662b720038a10e68d7d702370dc20a +Subproject commit c7a49cce5646bd6793e36b4cc3418dac4ae81ac9 diff --git a/lib/sai_redis_tam.cpp b/lib/sai_redis_tam.cpp index aa21ced94..9698af33d 100644 --- a/lib/sai_redis_tam.cpp +++ b/lib/sai_redis_tam.cpp @@ -23,6 +23,7 @@ REDIS_GENERIC_QUAD(TAM_TELEMETRY,tam_telemetry); REDIS_GENERIC_QUAD(TAM_COLLECTOR,tam_collector); REDIS_GENERIC_QUAD(TAM_EVENT_ACTION,tam_event_action); REDIS_GENERIC_QUAD(TAM_EVENT,tam_event); +REDIS_GENERIC_QUAD(TAM_COUNTER_SUBSCRIPTION,tam_counter_subscription); const sai_tam_api_t redis_tam_api = { @@ -37,4 +38,5 @@ const sai_tam_api_t redis_tam_api = { REDIS_GENERIC_QUAD_API(tam_collector) REDIS_GENERIC_QUAD_API(tam_event_action) REDIS_GENERIC_QUAD_API(tam_event) + REDIS_GENERIC_QUAD_API(tam_counter_subscription) }; diff --git a/vslib/sai_vs_tam.cpp b/vslib/sai_vs_tam.cpp index 3376cda91..a1abba1ff 100644 --- a/vslib/sai_vs_tam.cpp +++ b/vslib/sai_vs_tam.cpp @@ -23,6 +23,7 @@ VS_GENERIC_QUAD(TAM_TELEMETRY,tam_telemetry); VS_GENERIC_QUAD(TAM_COLLECTOR,tam_collector); VS_GENERIC_QUAD(TAM_EVENT_ACTION,tam_event_action); VS_GENERIC_QUAD(TAM_EVENT,tam_event); +VS_GENERIC_QUAD(TAM_COUNTER_SUBSCRIPTION,tam_counter_subscription); const sai_tam_api_t vs_tam_api = { @@ -37,5 +38,6 @@ const sai_tam_api_t vs_tam_api = { VS_GENERIC_QUAD_API(tam_collector) VS_GENERIC_QUAD_API(tam_event_action) VS_GENERIC_QUAD_API(tam_event) + VS_GENERIC_QUAD_API(tam_counter_subscription) }; From 2a286e3ee8dfba726c819a714b6fb13ec2731940 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Thu, 25 Jan 2024 17:13:56 -0800 Subject: [PATCH 2/3] Update for Bookworm (GCC 12) compilation support `#include ` needed to be added in two files. Signed-off-by: Saikrishna Arcot --- syncd/ServiceMethodTable.cpp | 1 + syncd/SwitchNotifications.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/syncd/ServiceMethodTable.cpp b/syncd/ServiceMethodTable.cpp index 38fb9b7c2..f954bbce2 100644 --- a/syncd/ServiceMethodTable.cpp +++ b/syncd/ServiceMethodTable.cpp @@ -2,6 +2,7 @@ #include "swss/logger.h" +#include #include using namespace syncd; diff --git a/syncd/SwitchNotifications.cpp b/syncd/SwitchNotifications.cpp index 1c470a989..5aa120364 100644 --- a/syncd/SwitchNotifications.cpp +++ b/syncd/SwitchNotifications.cpp @@ -1,6 +1,7 @@ #include "SwitchNotifications.h" #include "swss/logger.h" +#include using namespace syncd; From 9bce29ec9b9c6ceaf30bc7899d67d6156221554e Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Thu, 25 Jan 2024 17:53:45 -0800 Subject: [PATCH 3/3] Add tests Signed-off-by: Saikrishna Arcot --- unittest/lib/test_sai_redis_tam.cpp | 5 +++++ unittest/vslib/test_sai_vs_tam.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/unittest/lib/test_sai_redis_tam.cpp b/unittest/lib/test_sai_redis_tam.cpp index 8a8b974bb..f7899b053 100644 --- a/unittest/lib/test_sai_redis_tam.cpp +++ b/unittest/lib/test_sai_redis_tam.cpp @@ -70,6 +70,11 @@ TEST(libsairedis, tam) EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_tam_event(0)); EXPECT_NE(SAI_STATUS_SUCCESS, api->set_tam_event_attribute(0,0)); EXPECT_NE(SAI_STATUS_SUCCESS, api->get_tam_event_attribute(0,0,0)); + + EXPECT_NE(SAI_STATUS_SUCCESS, api->create_tam_counter_subscription(&id,0,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_tam_counter_subscription(0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->set_tam_counter_subscription_attribute(0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_tam_counter_subscription_attribute(0,0,0)); } TEST(libsairedis, sai_tam_telemetry_get_data) diff --git a/unittest/vslib/test_sai_vs_tam.cpp b/unittest/vslib/test_sai_vs_tam.cpp index b67b068b9..f879977f7 100644 --- a/unittest/vslib/test_sai_vs_tam.cpp +++ b/unittest/vslib/test_sai_vs_tam.cpp @@ -70,6 +70,11 @@ TEST(libsaivs, tam) EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_tam_event(0)); EXPECT_NE(SAI_STATUS_SUCCESS, api->set_tam_event_attribute(0,0)); EXPECT_NE(SAI_STATUS_SUCCESS, api->get_tam_event_attribute(0,0,0)); + + EXPECT_NE(SAI_STATUS_SUCCESS, api->create_tam_counter_subscription(&id,0,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_tam_counter_subscription(0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->set_tam_counter_subscription_attribute(0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_tam_counter_subscription_attribute(0,0,0)); } TEST(libsairedis, sai_tam_telemetry_get_data)