diff --git a/lib/inc/sairedis.h b/lib/inc/sairedis.h index ac7b30fc4..df8d43423 100644 --- a/lib/inc/sairedis.h +++ b/lib/inc/sairedis.h @@ -50,6 +50,24 @@ typedef enum _sai_redis_switch_attr_t */ SAI_REDIS_SWITCH_ATTR_USE_TEMP_VIEW, + /** + * @brief Enable redis pipeline + * + * @type bool + * @flags CREATE_AND_SET + * @default false + */ + SAI_REDIS_SWITCH_ATTR_USE_PIPELINE, + + /** + * @brief Will flush redis pipeline + * + * @type bool + * @flags CREATE_AND_SET + * @default false + */ + SAI_REDIS_SWITCH_ATTR_FLUSH, + } sai_redis_switch_attr_t; #endif // __SAIREDIS__ diff --git a/lib/src/sai_redis_switch.cpp b/lib/src/sai_redis_switch.cpp index 8209ed503..5a3239377 100644 --- a/lib/src/sai_redis_switch.cpp +++ b/lib/src/sai_redis_switch.cpp @@ -380,6 +380,14 @@ sai_status_t redis_set_switch_attribute( g_useTempView = attr->value.booldata; return SAI_STATUS_SUCCESS; + case SAI_REDIS_SWITCH_ATTR_USE_PIPELINE: + g_asicState->setBuffered(attr->value.booldata); + return SAI_STATUS_SUCCESS; + + case SAI_REDIS_SWITCH_ATTR_FLUSH: + g_asicState->flush(); + return SAI_STATUS_SUCCESS; + default: break; }