Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions orchagent/saihelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,10 @@ void initSaiRedis(const string &record_location)
* to be performed, and they should be executed before creating switch.
*/

/* Disable/enable SAI Redis recording */
sai_attribute_t attr;
attr.id = SAI_REDIS_SWITCH_ATTR_RECORD;
attr.value.booldata = gSairedisRecord;
sai_status_t status;

sai_status_t status = sai_switch_api->set_switch_attribute(gSwitchId, &attr);
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to %s SAI Redis recording, rv:%d",
gSairedisRecord ? "enable" : "disable", status);
exit(EXIT_FAILURE);
}
/* set recording dir before enable recording */

if (gSairedisRecord)
{
Expand All @@ -200,6 +192,19 @@ void initSaiRedis(const string &record_location)
}
}

/* Disable/enable SAI Redis recording */

attr.id = SAI_REDIS_SWITCH_ATTR_RECORD;
attr.value.booldata = gSairedisRecord;

status = sai_switch_api->set_switch_attribute(gSwitchId, &attr);
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to %s SAI Redis recording, rv:%d",
gSairedisRecord ? "enable" : "disable", status);
exit(EXIT_FAILURE);
}

attr.id = SAI_REDIS_SWITCH_ATTR_USE_PIPELINE;
attr.value.booldata = true;

Expand Down