diff --git a/doc/swss-schema.md b/doc/swss-schema.md index 696d1f1b3a..dd0668dca5 100644 --- a/doc/swss-schema.md +++ b/doc/swss-schema.md @@ -1,9 +1,9 @@ Schema data is defined in ABNF [RFC5234](https://tools.ietf.org/html/rfc5234) syntax. ###Definitions of common tokens - name = 1*DIGIT/1*ALPHA - ref_hash_key_reference = "[" hash_key "]" ;The token is a refernce to another valid DB key. - hash_key = name ; a valid key name (i.e. exists in DB) + name = 1*DIGIT/1*ALPHA + ref_hash_key_reference = "[" hash_key "]" ;The token is a refernce to another valid DB key. + hash_key = name ; a valid key name (i.e. exists in DB) ###PORT_TABLE @@ -14,22 +14,22 @@ Stores information for physical switch ports managed by the switch chip. device ;Status: Mandatory port_table_key = PORT_TABLE:ifname ; ifname must be unique across PORT,INTF,VLAN,LAG TABLES device_name = 1*64VCHAR ; must be unique across PORT,INTF,VLAN,LAG TABLES and must map to PORT_TABLE.name - admin_status = BIT ; is the port enabled (1) or disabled (0) + admin_status = BIT ; is the port enabled (1) or disabled (0) oper_status = BIT ; physical status up (1) or down (0) of the link attached to this port lanes = list of lanes ; (need format spec???) ifname = 1*64VCHAR ; name of the port, must be unique mac = 12HEXDIG ; - ;QOS Mappings - map_dscp_to_tc = ref_hash_key_reference - map_tc_to_queue = ref_hash_key_reference - - Example: - 127.0.0.1:6379> hgetall PORT_TABLE:ETHERNET4 - 1) "dscp_to_tc_map" - 2) "[DSCP_TO_TC_MAP_TABLE:AZURE]" - 3) "tc_to_queue_map" - 4) "[TC_TO_QUEUE_MAP_TABLE:AZURE]" + ;QOS Mappings + map_dscp_to_tc = ref_hash_key_reference + map_tc_to_queue = ref_hash_key_reference + + Example: + 127.0.0.1:6379> hgetall PORT_TABLE:ETHERNET4 + 1) "dscp_to_tc_map" + 2) "[DSCP_TO_TC_MAP_TABLE:AZURE]" + 3) "tc_to_queue_map" + 4) "[TC_TO_QUEUE_MAP_TABLE:AZURE]" --------------------------------------------- ###INTF_TABLE @@ -172,102 +172,118 @@ and reflects the LAG ports into the redis under: `LAG_TABLE::port` --------------------------------------------- ###QUEUE_TABLE - ; QUEUE table. Defines port queue. - ; SAI mapping - port queue. + ; QUEUE table. Defines port queue. + ; SAI mapping - port queue. - key = "QUEUE_TABLE:"port_name":queue_index - queue_index = 1*DIGIT - port_name = ifName - queue_reference = ref_hash_key_reference + key = "QUEUE_TABLE:"port_name":queue_index + queue_index = 1*DIGIT + port_name = ifName + queue_reference = ref_hash_key_reference - ;field value - scheduler = ref_hash_key_reference; reference to scheduler key - wred_profile = ref_hash_key_reference; reference to wred profile key + ;field value + scheduler = ref_hash_key_reference; reference to scheduler key + wred_profile = ref_hash_key_reference; reference to wred profile key - Example: - 127.0.0.1:6379> hgetall QUEUE_TABLE:ETHERNET4:1 - 1) "scheduler" - 2) "[SCHEDULER_TABLE:BEST_EFFORT]" - 3) "wred_profile" - 4) "[WRED_PROFILE_TABLE:AZURE]" + Example: + 127.0.0.1:6379> hgetall QUEUE_TABLE:ETHERNET4:1 + 1) "scheduler" + 2) "[SCHEDULER_TABLE:BEST_EFFORT]" + 3) "wred_profile" + 4) "[WRED_PROFILE_TABLE:AZURE]" --------------------------------------------- ###TC\_TO\_QUEUE\_MAP\_TABLE - ; TC to queue map - ;SAI mapping - qos_map with SAI_QOS_MAP_ATTR_TYPE == SAI_QOS_MAP_TC_TO_QUEUE. See saiqosmaps.h - key = "TC_TO_QUEUE_MAP_TABLE:"name - ;field - tc_num = 1*DIGIT - ;values - queue = 1*DIGIT; queue index - - Example: - 27.0.0.1:6379> hgetall TC_TO_QUEUE_MAP_TABLE:AZURE - 1) "5" ;tc - 2) "1" ;queue index - 3) "6" - 4) "1" + ; TC to queue map + ;SAI mapping - qos_map with SAI_QOS_MAP_ATTR_TYPE == SAI_QOS_MAP_TC_TO_QUEUE. See saiqosmaps.h + key = "TC_TO_QUEUE_MAP_TABLE:"name + ;field + tc_num = 1*DIGIT + ;values + queue = 1*DIGIT; queue index + + Example: + 27.0.0.1:6379> hgetall TC_TO_QUEUE_MAP_TABLE:AZURE + 1) "5" ;tc + 2) "1" ;queue index + 3) "6" + 4) "1" --------------------------------------------- ###DSCP\_TO\_TC\_MAP\_TABLE - ; dscp to TC map - ;SAI mapping - qos_map object with SAI_QOS_MAP_ATTR_TYPE == sai_qos_map_type_t::SAI_QOS_MAP_DSCP_TO_TC - key = "DSCP_TO_TC_MAP_TABLE:"name - ;field value - dscp_value = 1*DIGIT - tc_value = 1*DIGIT - - Example: - 127.0.0.1:6379> hgetall "DSCP_TO_TC_MAP_TABLE:AZURE" - 1) "3" ;dscp - 2) "3" ;tc - 3) "6" - 4) "5" - 5) "7" - 6) "5" - 7) "8" - 8) "7" - 9) "9" - 10) "8" + ; dscp to TC map + ;SAI mapping - qos_map object with SAI_QOS_MAP_ATTR_TYPE == sai_qos_map_type_t::SAI_QOS_MAP_DSCP_TO_TC + key = "DSCP_TO_TC_MAP_TABLE:"name + ;field value + dscp_value = 1*DIGIT + tc_value = 1*DIGIT + + Example: + 127.0.0.1:6379> hgetall "DSCP_TO_TC_MAP_TABLE:AZURE" + 1) "3" ;dscp + 2) "3" ;tc + 3) "6" + 4) "5" + 5) "7" + 6) "5" + 7) "8" + 8) "7" + 9) "9" + 10) "8" --------------------------------------------- ###SCHEDULER_TABLE - ; Scheduler table - ; SAI mapping - saicheduler.h - key = "SCHEDULER_TABLE":name - ; field value - type = "DWRR"/"WRR"/"PRIORITY" - weight = 1*DIGIT - priority = 1*DIGIT - - Example: - 127.0.0.1:6379> hgetall SCHEDULER_TABLE:BEST_EFFORT - 1) "type" - 2) "PRIORITY" - 3) "priority" - 4) "7" - 127.0.0.1:6379> hgetall SCHEDULER_TABLE:SCAVENGER - 1) "type" - 2) "DWRR" - 3) "weight" - 4) "35" + ; Scheduler table + ; SAI mapping - saicheduler.h + key = "SCHEDULER_TABLE":name + ; field value + type = "DWRR"/"WRR"/"PRIORITY" + weight = 1*DIGIT + priority = 1*DIGIT + + Example: + 127.0.0.1:6379> hgetall SCHEDULER_TABLE:BEST_EFFORT + 1) "type" + 2) "PRIORITY" + 3) "priority" + 4) "7" + 127.0.0.1:6379> hgetall SCHEDULER_TABLE:SCAVENGER + 1) "type" + 2) "DWRR" + 3) "weight" + 4) "35" --------------------------------------------- ###WRED\_PROFILE\_TABLE - ; WRED profile - ; SAI mapping - saiwred.h - key = "WRED_PROFILE_TABLE:"name - ;field value - yellow_max_threshold = byte_count - green_max_threshold = byte_count - byte_count = 1*DIGIT - - Example: - 127.0.0.1:6379> hgetall "WRED_PROFILE_TABLE:AZURE" - 1) "green_max_threshold" - 2) "20480" - 3) "yellow_max_threshold" - 4) "30720" + ; WRED profile + ; SAI mapping - saiwred.h + key = "WRED_PROFILE_TABLE:"name + ;field = value + yellow_max_threshold = byte_count + green_max_threshold = byte_count + red_max_threshold = byte_count + byte_count = 1*DIGIT + ecn = "ecn_none" / "ecn_green" / "ecn_yellow" / "ecn_red" / "ecn_green_yellow" / "ecn_green_red" / "ecn_yellow_red" / "ecn_all" + wred_green_enable = "true" / "false" + wred_yellow_enable = "true" / "false" + wred_red_enable = "true" / "false" + + Example: + 127.0.0.1:6379> hgetall "WRED_PROFILE_TABLE:AZURE" + 1) "green_max_threshold" + 2) "20480" + 3) "yellow_max_threshold" + 4) "30720" + 5) "red_max_threshold" + 6) "1234" + 7) "ecn" + 8) "ecn_all" + 9) "wred_green_enable" + 10) "true" + 11) "wred_yellow_enable" + 12) "true" + 13) "wred_red_enable" + 14) "true" + ---------------------------------------------- ###TUNNEL_DECAP_TABLE