From 29f1e3cd6245f88c8b1c5ed621af87288aca7ddf Mon Sep 17 00:00:00 2001 From: Marian Pritsak Date: Thu, 31 Jan 2019 20:44:39 +0200 Subject: [PATCH] Update SAI pointer (#414) * Update SAI pointer Signed-off-by: Marian Pritsak * Add support for BMToR API Signed-off-by: Marian Pritsak --- SAI | 2 +- lib/inc/sai_redis.h | 1 + lib/src/Makefile.am | 1 + lib/src/sai_redis_bmtor.cpp | 98 ++++++++++++++++++++++++++++ lib/src/sai_redis_interfacequery.cpp | 1 + 5 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 lib/src/sai_redis_bmtor.cpp diff --git a/SAI b/SAI index f9bedb1dc880..6ad3382217ec 160000 --- a/SAI +++ b/SAI @@ -1 +1 @@ -Subproject commit f9bedb1dc880c0b3667c5977458b11807e57ae1b +Subproject commit 6ad3382217ec22f64cd268faefcbc2ff7caba4fd diff --git a/lib/inc/sai_redis.h b/lib/inc/sai_redis.h index 5318eb9a8f28..10282c12eef6 100644 --- a/lib/inc/sai_redis.h +++ b/lib/inc/sai_redis.h @@ -71,6 +71,7 @@ extern std::mutex g_apimutex; extern const sai_acl_api_t redis_acl_api; extern const sai_bfd_api_t redis_bfd_api; +extern const sai_bmtor_api_t redis_bmtor_api; extern const sai_bridge_api_t redis_bridge_api; extern const sai_buffer_api_t redis_buffer_api; extern const sai_dtel_api_t redis_dtel_api; diff --git a/lib/src/Makefile.am b/lib/src/Makefile.am index f24fc370ac36..8d1f4d69585e 100644 --- a/lib/src/Makefile.am +++ b/lib/src/Makefile.am @@ -11,6 +11,7 @@ lib_LTLIBRARIES = libsairedis.la libsairedis_la_SOURCES = \ sai_redis_acl.cpp \ sai_redis_bfd.cpp \ + sai_redis_bmtor.cpp \ sai_redis_bridge.cpp \ sai_redis_buffer.cpp \ sai_redis_dtel.cpp \ diff --git a/lib/src/sai_redis_bmtor.cpp b/lib/src/sai_redis_bmtor.cpp new file mode 100644 index 000000000000..eb0b1b4e5daa --- /dev/null +++ b/lib/src/sai_redis_bmtor.cpp @@ -0,0 +1,98 @@ +#include "sai_redis.h" + +sai_status_t redis_get_table_bitmap_classification_entry_stats( + _In_ sai_object_id_t table_bitmap_classification_entry_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids, + _Out_ uint64_t *counters) +{ + MUTEX(); + + SWSS_LOG_ENTER(); + + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t redis_get_table_bitmap_classification_entry_stats_ext( + _In_ sai_object_id_t table_bitmap_classification_entry_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids, + _In_ sai_stats_mode_t mode, + _Out_ uint64_t *counters) +{ + MUTEX(); + + SWSS_LOG_ENTER(); + + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t redis_clear_table_bitmap_classification_entry_stats( + _In_ sai_object_id_t table_bitmap_classification_entry_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids) +{ + MUTEX(); + + SWSS_LOG_ENTER(); + + return SAI_STATUS_NOT_IMPLEMENTED; +} + +REDIS_GENERIC_QUAD(TABLE_BITMAP_CLASSIFICATION_ENTRY,table_bitmap_classification_entry); + +sai_status_t redis_get_table_bitmap_router_entry_stats( + _In_ sai_object_id_t table_bitmap_router_entry_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids, + _Out_ uint64_t *counters) +{ + MUTEX(); + + SWSS_LOG_ENTER(); + + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t redis_get_table_bitmap_router_entry_stats_ext( + _In_ sai_object_id_t table_bitmap_router_entry_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids, + _In_ sai_stats_mode_t mode, + _Out_ uint64_t *counters) +{ + MUTEX(); + + SWSS_LOG_ENTER(); + + return SAI_STATUS_NOT_IMPLEMENTED; +} + +sai_status_t redis_clear_table_bitmap_router_entry_stats( + _In_ sai_object_id_t table_bitmap_router_entry_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids) +{ + MUTEX(); + + SWSS_LOG_ENTER(); + + return SAI_STATUS_NOT_IMPLEMENTED; +} + +REDIS_GENERIC_QUAD(TABLE_BITMAP_ROUTER_ENTRY,table_bitmap_router_entry); + +const sai_bmtor_api_t redis_bmtor_api = { + + REDIS_GENERIC_QUAD_API(table_bitmap_classification_entry) + + redis_get_table_bitmap_classification_entry_stats, + redis_get_table_bitmap_classification_entry_stats_ext, + redis_clear_table_bitmap_classification_entry_stats, + + REDIS_GENERIC_QUAD_API(table_bitmap_router_entry) + + redis_get_table_bitmap_router_entry_stats, + redis_get_table_bitmap_router_entry_stats_ext, + redis_clear_table_bitmap_router_entry_stats, +}; diff --git a/lib/src/sai_redis_interfacequery.cpp b/lib/src/sai_redis_interfacequery.cpp index 42284dbadbf6..a8b4eb67bbf2 100644 --- a/lib/src/sai_redis_interfacequery.cpp +++ b/lib/src/sai_redis_interfacequery.cpp @@ -213,6 +213,7 @@ sai_status_t sai_api_query( { API_CASE(ACL,acl); API_CASE(BFD,bfd); + API_CASE(BMTOR,bmtor); API_CASE(BRIDGE,bridge); API_CASE(BUFFER,buffer); API_CASE(DTEL,dtel);