From 2dbaca830ee37a0e57e43468c39db5c40051bc9b Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Thu, 5 Dec 2024 18:13:08 +0000 Subject: [PATCH] Revert "[submodule] Update SAI to lates origin master (#1466)" This reverts commit 526bca31a6075e2f43c49a1fb908cd90c63ae20b. --- SAI | 2 +- meta/Meta.cpp | 19 --------- meta/Meta.h | 5 --- meta/SaiSerialize.cpp | 35 ---------------- meta/sai_serialize.h | 7 ---- syncd/VendorSai.cpp | 64 ------------------------------ unittest/meta/TestMeta.cpp | 9 ----- unittest/meta/TestSaiSerialize.cpp | 11 ----- unittest/syncd/TestVendorSai.cpp | 15 ------- 9 files changed, 1 insertion(+), 166 deletions(-) diff --git a/SAI b/SAI index 054085547..f214adef0 160000 --- a/SAI +++ b/SAI @@ -1 +1 @@ -Subproject commit 054085547c2042b95ab0fa1a75a44da3288b26bf +Subproject commit f214adef0f336cb991bad4461e626dc039f01878 diff --git a/meta/Meta.cpp b/meta/Meta.cpp index 92ba95f7c..a9851d201 100644 --- a/meta/Meta.cpp +++ b/meta/Meta.cpp @@ -3154,25 +3154,6 @@ sai_status_t Meta::meta_sai_validate_meter_bucket_entry( return SAI_STATUS_NOT_IMPLEMENTED; } -sai_status_t Meta::meta_sai_validate_prefix_compression_entry( - _In_ const sai_prefix_compression_entry_t* prefix_compression_entry, - _In_ bool create, - _In_ bool get) -{ - SWSS_LOG_ENTER(); - - if (prefix_compression_entry == NULL) - { - SWSS_LOG_ERROR("prefix_compression_entry pointer is NULL"); - - return SAI_STATUS_INVALID_PARAMETER; - } - - // TODO FIX ME - - return SAI_STATUS_NOT_IMPLEMENTED; -} - sai_status_t Meta::meta_generic_validation_create( _In_ const sai_object_meta_key_t& meta_key, _In_ sai_object_id_t switch_id, diff --git a/meta/Meta.h b/meta/Meta.h index c93ae7a59..ce8a0a2dd 100644 --- a/meta/Meta.h +++ b/meta/Meta.h @@ -563,11 +563,6 @@ namespace saimeta _In_ bool create, _In_ bool get = false); - sai_status_t meta_sai_validate_prefix_compression_entry( - _In_ const sai_prefix_compression_entry_t* prefix_compression_entry, - _In_ bool create, - _In_ bool get = false); - public: /* diff --git a/meta/SaiSerialize.cpp b/meta/SaiSerialize.cpp index ca528b4ff..0916cac02 100644 --- a/meta/SaiSerialize.cpp +++ b/meta/SaiSerialize.cpp @@ -975,20 +975,6 @@ std::string sai_serialize_meter_bucket_entry( return j.dump(); } -std::string sai_serialize_prefix_compression_entry( - _In_ const sai_prefix_compression_entry_t &prefix_compression_entry) -{ - SWSS_LOG_ENTER(); - - json j; - - j["switch_id"] = sai_serialize_object_id(prefix_compression_entry.switch_id); - j["prefix_table_id"] = sai_serialize_object_id(prefix_compression_entry.prefix_table_id); - j["prefix"] = sai_serialize_ip_prefix(prefix_compression_entry.prefix); - - return j.dump(); -} - std::string sai_serialize_flow_entry( _In_ const sai_flow_entry_t &flow_entry) { @@ -2684,10 +2670,6 @@ static bool sai_serialize_object_entry( key = sai_serialize_mcast_fdb_entry(key_entry.mcast_fdb_entry); return true; - case SAI_OBJECT_TYPE_PREFIX_COMPRESSION_ENTRY: - key = sai_serialize_prefix_compression_entry(key_entry.prefix_compression_entry); - return true; - default: return false; } @@ -4477,19 +4459,6 @@ void sai_deserialize_meter_bucket_entry( sai_deserialize_number(j["meter_class"], meter_bucket_entry.meter_class); } -void sai_deserialize_prefix_compression_entry( - _In_ const std::string& s, - _Out_ sai_prefix_compression_entry_t& prefix_compression_entry) -{ - SWSS_LOG_ENTER(); - - json j = json::parse(s); - - sai_deserialize_object_id(j["switch_id"], prefix_compression_entry.switch_id); - sai_deserialize_object_id(j["prefix_table_id"], prefix_compression_entry.prefix_table_id); - sai_deserialize_ip_prefix(j["prefix"], prefix_compression_entry.prefix); -} - void sai_deserialize_flow_entry( _In_ const std::string& s, _Out_ sai_flow_entry_t &flow_entry) @@ -4941,10 +4910,6 @@ bool sai_deserialize_object_entry( sai_deserialize_mcast_fdb_entry(object_id, meta_key.objectkey.key.mcast_fdb_entry); return true; - case SAI_OBJECT_TYPE_PREFIX_COMPRESSION_ENTRY: - sai_deserialize_prefix_compression_entry(object_id, meta_key.objectkey.key.prefix_compression_entry); - return true; - default: return false; } diff --git a/meta/sai_serialize.h b/meta/sai_serialize.h index b1733bf33..0ef79e9cb 100644 --- a/meta/sai_serialize.h +++ b/meta/sai_serialize.h @@ -72,9 +72,6 @@ std::string sai_serialize_fdb_entry( std::string sai_serialize_meter_bucket_entry( _In_ const sai_meter_bucket_entry_t &meter_bucket_entry); -std::string sai_serialize_prefix_compression_entry( - _In_ const sai_prefix_compression_entry_t &prefix_compression_entry); - std::string sai_serialize_flow_entry( _In_ const sai_flow_entry_t &flow_entry); @@ -446,10 +443,6 @@ void sai_deserialize_meter_bucket_entry( _In_ const std::string& s, _Out_ sai_meter_bucket_entry_t& meter_bucket_entry); -void sai_deserialize_prefix_compression_entry( - _In_ const std::string& s, - _Out_ sai_prefix_compression_entry_t& prefix_compression_entry); - void sai_deserialize_flow_entry( _In_ const std::string& s, _Out_ sai_flow_entry_t &flow_entry); diff --git a/syncd/VendorSai.cpp b/syncd/VendorSai.cpp index bb6734256..c0cb5683a 100644 --- a/syncd/VendorSai.cpp +++ b/syncd/VendorSai.cpp @@ -1055,33 +1055,6 @@ sai_status_t VendorSai::bulkCreate( object_statuses); } -sai_status_t VendorSai::bulkCreate( - _In_ uint32_t object_count, - _In_ const sai_prefix_compression_entry_t* entries, - _In_ const uint32_t *attr_count, - _In_ const sai_attribute_t **attr_list, - _In_ sai_bulk_op_error_mode_t mode, - _Out_ sai_status_t *object_statuses) -{ - MUTEX(); - SWSS_LOG_ENTER(); - VENDOR_CHECK_API_INITIALIZED(); - - if (!m_apis.prefix_compression_api->create_prefix_compression_entries) - { - SWSS_LOG_INFO("create_prefix_compression_entries is not supported"); - return SAI_STATUS_NOT_SUPPORTED; - } - - return m_apis.prefix_compression_api->create_prefix_compression_entries( - object_count, - entries, - attr_count, - attr_list, - mode, - object_statuses); -} - // BULK REMOVE sai_status_t VendorSai::bulkRemove( @@ -1430,29 +1403,6 @@ sai_status_t VendorSai::bulkRemove( object_statuses); } -sai_status_t VendorSai::bulkRemove( - _In_ uint32_t object_count, - _In_ const sai_prefix_compression_entry_t *entries, - _In_ sai_bulk_op_error_mode_t mode, - _Out_ sai_status_t *object_statuses) -{ - MUTEX(); - SWSS_LOG_ENTER(); - VENDOR_CHECK_API_INITIALIZED(); - - if (!m_apis.prefix_compression_api->remove_prefix_compression_entries) - { - SWSS_LOG_INFO("remove_prefix_compression_entries is not supported"); - return SAI_STATUS_NOT_SUPPORTED; - } - - return m_apis.prefix_compression_api->remove_prefix_compression_entries( - object_count, - entries, - mode, - object_statuses); -} - // BULK SET sai_status_t VendorSai::bulkSet( @@ -1731,20 +1681,6 @@ sai_status_t VendorSai::bulkSet( return SAI_STATUS_NOT_SUPPORTED; } -sai_status_t VendorSai::bulkSet( - _In_ uint32_t object_count, - _In_ const sai_prefix_compression_entry_t *entries, - _In_ const sai_attribute_t *attr_list, - _In_ sai_bulk_op_error_mode_t mode, - _Out_ sai_status_t *object_statuses) -{ - MUTEX(); - SWSS_LOG_ENTER(); - VENDOR_CHECK_API_INITIALIZED(); - - return SAI_STATUS_NOT_SUPPORTED; -} - // NON QUAD API sai_status_t VendorSai::flushFdbEntries( diff --git a/unittest/meta/TestMeta.cpp b/unittest/meta/TestMeta.cpp index d31ed4a4d..0b0d35b25 100644 --- a/unittest/meta/TestMeta.cpp +++ b/unittest/meta/TestMeta.cpp @@ -1841,12 +1841,3 @@ TEST(Meta, remove_meter_bucket_entry) EXPECT_EQ(SAI_STATUS_INVALID_PARAMETER, sai.remove(e)); } - -TEST(Meta, remove_prefix_compression_entry) -{ - Meta sai(std::make_shared()); - - sai_prefix_compression_entry_t* e = nullptr; - - EXPECT_EQ(SAI_STATUS_INVALID_PARAMETER, sai.remove(e)); -} diff --git a/unittest/meta/TestSaiSerialize.cpp b/unittest/meta/TestSaiSerialize.cpp index ab7521db0..b7e0c97d6 100644 --- a/unittest/meta/TestSaiSerialize.cpp +++ b/unittest/meta/TestSaiSerialize.cpp @@ -1347,14 +1347,3 @@ TEST(SaiSerialize, serialize_number) EXPECT_EQ(sn, -0x12345678); EXPECT_EQ(u, 0x12345678); } - -TEST(SaiSerialize, sai_serialize_prefix_compression_entry) -{ - sai_prefix_compression_entry_t e; - - memset(&e, 0, sizeof(e)); - - auto s = sai_serialize_prefix_compression_entry(e); - - sai_deserialize_prefix_compression_entry(s, e); -} diff --git a/unittest/syncd/TestVendorSai.cpp b/unittest/syncd/TestVendorSai.cpp index f14d280a4..63977e713 100644 --- a/unittest/syncd/TestVendorSai.cpp +++ b/unittest/syncd/TestVendorSai.cpp @@ -1543,18 +1543,3 @@ TEST(VendorSai, bulk_meter_rules) EXPECT_EQ(SAI_STATUS_SUCCESS, sai.remove((sai_object_type_t)SAI_OBJECT_TYPE_METER_POLICY, meter_policy0)); EXPECT_EQ(SAI_STATUS_SUCCESS, sai.remove((sai_object_type_t)SAI_OBJECT_TYPE_METER_POLICY, meter_policy1)); } - -TEST_F(VendorSaiTest, bulk_prefix_compression_entry) -{ - sai_prefix_compression_entry_t *e = nullptr; - - // metadata will fail - EXPECT_EQ(SAI_STATUS_INVALID_PARAMETER, - m_vsai->bulkCreate(0, e, nullptr, nullptr, SAI_BULK_OP_ERROR_MODE_STOP_ON_ERROR, nullptr)); - - EXPECT_EQ(SAI_STATUS_INVALID_PARAMETER, - m_vsai->bulkRemove(0, e, SAI_BULK_OP_ERROR_MODE_STOP_ON_ERROR, nullptr)); - - EXPECT_EQ(SAI_STATUS_NOT_SUPPORTED, - m_vsai->bulkSet(0, e, nullptr, SAI_BULK_OP_ERROR_MODE_STOP_ON_ERROR, nullptr)); -}