Skip to content

Commit

Permalink
Revert "[submodule] Update SAI to lates origin master (#1466)"
Browse files Browse the repository at this point in the history
This reverts commit 526bca3.
  • Loading branch information
yxieca committed Dec 5, 2024
1 parent 064a3a8 commit 2dbaca8
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 166 deletions.
19 changes: 0 additions & 19 deletions meta/Meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions meta/Meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:

/*
Expand Down
35 changes: 0 additions & 35 deletions meta/SaiSerialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down
7 changes: 0 additions & 7 deletions meta/sai_serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
64 changes: 0 additions & 64 deletions syncd/VendorSai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
9 changes: 0 additions & 9 deletions unittest/meta/TestMeta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<MetaTestSaiInterface>());

sai_prefix_compression_entry_t* e = nullptr;

EXPECT_EQ(SAI_STATUS_INVALID_PARAMETER, sai.remove(e));
}
11 changes: 0 additions & 11 deletions unittest/meta/TestSaiSerialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
15 changes: 0 additions & 15 deletions unittest/syncd/TestVendorSai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

0 comments on commit 2dbaca8

Please sign in to comment.