Skip to content
Draft
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions orchagent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,31 @@ void syncd_apply_view()

sai_status_t status;
sai_attribute_t attr;
char *platform = getenv("platform");

/* syncd runs the view comparison and the ASIC_DB rewrite inside this single
* notification. Both scale with the number of objects and exceed the default
* response timeout at high route scale, so allow the long timeout here. */
if (platform && strstr(platform, MLNX_PLATFORM_SUBSTRING))
{
SWSS_LOG_NOTICE("Set SAI REDIS response timeout to %d for Mellanox platform, to extend the timeout for apply view", SAI_REDIS_SYNC_OPERATION_RESPONSE_TIMEOUT);
attr.id = SAI_REDIS_SWITCH_ATTR_SYNC_OPERATION_RESPONSE_TIMEOUT;
attr.value.u64 = SAI_REDIS_SYNC_OPERATION_RESPONSE_TIMEOUT;
sai_switch_api->set_switch_attribute(gSwitchId, &attr);
}

attr.id = SAI_REDIS_SWITCH_ATTR_NOTIFY_SYNCD;
attr.value.s32 = SAI_REDIS_NOTIFY_SYNCD_APPLY_VIEW;
status = sai_switch_api->set_switch_attribute(gSwitchId, &attr);

if (platform && strstr(platform, MLNX_PLATFORM_SUBSTRING))
{
SWSS_LOG_NOTICE("Set SAI REDIS response timeout to %d for Mellanox platform, to restore the default timeout", SAI_REDIS_DEFAULT_SYNC_OPERATION_RESPONSE_TIMEOUT);
attr.id = SAI_REDIS_SWITCH_ATTR_SYNC_OPERATION_RESPONSE_TIMEOUT;
attr.value.u64 = SAI_REDIS_DEFAULT_SYNC_OPERATION_RESPONSE_TIMEOUT;
sai_switch_api->set_switch_attribute(gSwitchId, &attr);
}

if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to notify syncd APPLY_VIEW %d", status);
Expand Down
5 changes: 0 additions & 5 deletions orchagent/saihelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ using namespace swss;
#define STR(s) _STR(s)

#define CONTEXT_CFG_FILE "/usr/share/sonic/hwsku/context_config.json"
#if defined(__arm__)
#define SAI_REDIS_SYNC_OPERATION_RESPONSE_TIMEOUT ((480*1000)*2)
#else
#define SAI_REDIS_SYNC_OPERATION_RESPONSE_TIMEOUT (480*1000)
#endif

// hwinfo = "INTERFACE_NAME/PHY ID", mii_ioctl_data->phy_id is a __u16
#define HWINFO_MAX_SIZE IFNAMSIZ + 1 + 5
Expand Down
6 changes: 6 additions & 0 deletions orchagent/saihelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ extern "C" {
#define IS_ATTR_ID_IN_RANGE(attrId, objectType, attrPrefix) \
((attrId) >= SAI_ ## objectType ## _ATTR_ ## attrPrefix ## _START && (attrId) <= SAI_ ## objectType ## _ATTR_ ## attrPrefix ## _END)

#if defined(__arm__)
#define SAI_REDIS_SYNC_OPERATION_RESPONSE_TIMEOUT ((480*1000)*2)
#else
#define SAI_REDIS_SYNC_OPERATION_RESPONSE_TIMEOUT (480*1000)
#endif

void initFlexCounterTables();
void initSaiApi();
void initSaiRedis();
Expand Down
Loading