Skip to content

Commit

Permalink
[sai-redis] qos related serialization types (sonic-net#24)
Browse files Browse the repository at this point in the history
* wred
* scheduler group
* fixed yellow drop probability item

Signed-off-by: [email protected]
  • Loading branch information
hrachyam authored and kcudnik committed Jun 17, 2016
1 parent c19bcfb commit 8328719
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions common/saiserialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,20 @@ sai_serialization_map_t sai_get_serialization_map()
map[SAI_OBJECT_TYPE_QOS_MAPS][SAI_QOS_MAP_ATTR_TYPE] = SAI_SERIALIZATION_TYPE_INT32;
map[SAI_OBJECT_TYPE_QOS_MAPS][SAI_QOS_MAP_ATTR_MAP_TO_VALUE_LIST] = SAI_SERIALIZATION_TYPE_QOS_MAP_LIST;

map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_YELLOW_ENABLE] = SAI_SERIALIZATION_TYPE_INT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_YELLOW_MAX_THRESHOLD] = SAI_SERIALIZATION_TYPE_INT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_GREEN_ENABLE] = SAI_SERIALIZATION_TYPE_INT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_GREEN_MAX_THRESHOLD] = SAI_SERIALIZATION_TYPE_INT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_GREEN_ENABLE] = SAI_SERIALIZATION_TYPE_BOOL;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_GREEN_MIN_THRESHOLD] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_GREEN_MAX_THRESHOLD] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_GREEN_DROP_PROBABILITY] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_YELLOW_ENABLE] = SAI_SERIALIZATION_TYPE_BOOL;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_YELLOW_MIN_THRESHOLD] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_YELLOW_MAX_THRESHOLD] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_YELLOW_DROP_PROBABILITY] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_RED_ENABLE] = SAI_SERIALIZATION_TYPE_BOOL;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_RED_MIN_THRESHOLD] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_RED_MAX_THRESHOLD] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_RED_DROP_PROBABILITY] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_WEIGHT] = SAI_SERIALIZATION_TYPE_UINT8;
map[SAI_OBJECT_TYPE_WRED][SAI_WRED_ATTR_ECN_MARK_ENABLE] = SAI_SERIALIZATION_TYPE_BOOL;

map[SAI_OBJECT_TYPE_PORT][SAI_PORT_ATTR_SPEED] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_PORT][SAI_PORT_ATTR_ADMIN_STATE] = SAI_SERIALIZATION_TYPE_BOOL;
Expand All @@ -48,7 +58,21 @@ sai_serialization_map_t sai_get_serialization_map()
map[SAI_OBJECT_TYPE_PORT][SAI_PORT_ATTR_PRIORITY_GROUP_LIST] = SAI_SERIALIZATION_TYPE_OBJECT_LIST;
map[SAI_OBJECT_TYPE_PORT][SAI_PORT_ATTR_QOS_NUMBER_OF_QUEUES] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_PORT][SAI_PORT_ATTR_QOS_QUEUE_LIST] = SAI_SERIALIZATION_TYPE_OBJECT_LIST;

map[SAI_OBJECT_TYPE_PORT][SAI_PORT_ATTR_QOS_NUMBER_OF_SCHEDULER_GROUPS] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_PORT][SAI_PORT_ATTR_QOS_SCHEDULER_GROUP_LIST] = SAI_SERIALIZATION_TYPE_OBJECT_LIST;

map[SAI_OBJECT_TYPE_SCHEDULER][SAI_SCHEDULER_ATTR_SCHEDULING_ALGORITHM] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_SCHEDULER][SAI_SCHEDULER_ATTR_SCHEDULING_WEIGHT] = SAI_SERIALIZATION_TYPE_UINT8;
map[SAI_OBJECT_TYPE_SCHEDULER][SAI_SCHEDULER_ATTR_SHAPER_TYPE] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_SCHEDULER][SAI_SCHEDULER_ATTR_MIN_BANDWIDTH_RATE] = SAI_SERIALIZATION_TYPE_UINT64;
map[SAI_OBJECT_TYPE_SCHEDULER][SAI_SCHEDULER_ATTR_MIN_BANDWIDTH_BURST_RATE] = SAI_SERIALIZATION_TYPE_UINT64;
map[SAI_OBJECT_TYPE_SCHEDULER][SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_RATE] = SAI_SERIALIZATION_TYPE_UINT64;
map[SAI_OBJECT_TYPE_SCHEDULER][SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_BURST_RATE] = SAI_SERIALIZATION_TYPE_UINT64;

map[SAI_OBJECT_TYPE_SCHEDULER_GROUP][SAI_SCHEDULER_GROUP_ATTR_CHILD_COUNT] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_SCHEDULER_GROUP][SAI_SCHEDULER_GROUP_ATTR_CHILD_LIST] = SAI_SERIALIZATION_TYPE_OBJECT_LIST;
map[SAI_OBJECT_TYPE_SCHEDULER_GROUP][SAI_SCHEDULER_GROUP_ATTR_SCHEDULER_PROFILE_ID] = SAI_SERIALIZATION_TYPE_OBJECT_ID;

map[SAI_OBJECT_TYPE_PRIORITY_GROUP][SAI_INGRESS_PRIORITY_GROUP_ATTR_BUFFER_PROFILE] = SAI_SERIALIZATION_TYPE_OBJECT_ID;

map[SAI_OBJECT_TYPE_QUEUE][SAI_QUEUE_ATTR_WRED_PROFILE_ID] = SAI_SERIALIZATION_TYPE_OBJECT_ID;
Expand Down Expand Up @@ -89,7 +113,7 @@ sai_serialization_map_t sai_get_serialization_map()
map[SAI_OBJECT_TYPE_SWITCH][SAI_SWITCH_ATTR_DEFAULT_VIRTUAL_ROUTER_ID] = SAI_SERIALIZATION_TYPE_OBJECT_ID;
map[SAI_OBJECT_TYPE_SWITCH][SAI_SWITCH_ATTR_EGRESS_BUFFER_POOL_NUM] = SAI_SERIALIZATION_TYPE_UINT32;
map[SAI_OBJECT_TYPE_SWITCH][SAI_SWITCH_ATTR_INGRESS_BUFFER_POOL_NUM] = SAI_SERIALIZATION_TYPE_UINT32;

map[SAI_OBJECT_TYPE_SWITCH][SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_CHILDS_PER_SCHEDULER_GROUP] = SAI_SERIALIZATION_TYPE_INT32;

map[SAI_OBJECT_TYPE_FDB][SAI_FDB_ENTRY_ATTR_TYPE] = SAI_SERIALIZATION_TYPE_INT32;
map[SAI_OBJECT_TYPE_FDB][SAI_FDB_ENTRY_ATTR_PORT_ID] = SAI_SERIALIZATION_TYPE_OBJECT_ID;
Expand Down

0 comments on commit 8328719

Please sign in to comment.