Skip to content

Commit 57536ff

Browse files
authored
Snoop attr value in apply mode (sonic-net#291)
1 parent 0f3981e commit 57536ff

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

syncd/syncd.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,14 @@ void snoop_get_attr(
693693

694694
std::string str_object_type = sai_serialize_object_type(object_type);
695695

696-
std::string key = TEMP_PREFIX + (ASIC_STATE_TABLE + (":" + str_object_type + ":" + str_object_id));
696+
std::string prefix = "";
697+
698+
if (isInitViewMode())
699+
{
700+
prefix = TEMP_PREFIX;
701+
}
702+
703+
std::string key = prefix + (ASIC_STATE_TABLE + (":" + str_object_type + ":" + str_object_id));
697704

698705
SWSS_LOG_DEBUG("%s", key.c_str());
699706

@@ -893,21 +900,11 @@ void internal_syncd_get_send(
893900
attr_list,
894901
false);
895902

896-
if (isInitViewMode())
897-
{
898-
/*
899-
* All oid values here are VIDs.
900-
*/
901-
902-
snoop_get_response(object_type, str_object_id, attr_count, attr_list);
903-
}
904-
905903
/*
906-
* TODO: When we are doing GET in non init view mode, maybe we could
907-
* snoop data also, since we will put this data anyway when we will do
908-
* view compare. We would need to fix snoop_get_response since
909-
* currently this method is writing only to TEMP view.
904+
* All oid values here are VIDs.
910905
*/
906+
907+
snoop_get_response(object_type, str_object_id, attr_count, attr_list);
911908
}
912909
else if (status == SAI_STATUS_BUFFER_OVERFLOW)
913910
{

0 commit comments

Comments
 (0)