@@ -1056,21 +1056,22 @@ bool PortsOrch::setPortAdvSpeed(sai_object_id_t port_id, sai_uint32_t speed)
1056
1056
return status == SAI_STATUS_SUCCESS;
1057
1057
}
1058
1058
1059
- bool PortsOrch::getQueueType (sai_object_id_t queue_id, string &type)
1059
+ bool PortsOrch::getQueueTypeAndIndex (sai_object_id_t queue_id, string &type, uint8_t &index )
1060
1060
{
1061
1061
SWSS_LOG_ENTER ();
1062
1062
1063
- sai_attribute_t attr;
1064
- attr.id = SAI_QUEUE_ATTR_TYPE;
1063
+ sai_attribute_t attr[2 ];
1064
+ attr[0 ].id = SAI_QUEUE_ATTR_TYPE;
1065
+ attr[1 ].id = SAI_QUEUE_ATTR_INDEX;
1065
1066
1066
- sai_status_t status = sai_queue_api->get_queue_attribute (queue_id, 1 , & attr);
1067
+ sai_status_t status = sai_queue_api->get_queue_attribute (queue_id, 2 , attr);
1067
1068
if (status != SAI_STATUS_SUCCESS)
1068
1069
{
1069
- SWSS_LOG_ERROR (" Failed to get queue type for queue %lu rv:%d" , queue_id, status);
1070
+ SWSS_LOG_ERROR (" Failed to get queue type and index for queue %lu rv:%d" , queue_id, status);
1070
1071
return false ;
1071
1072
}
1072
1073
1073
- switch (attr.value .s32 )
1074
+ switch (attr[ 0 ] .value .s32 )
1074
1075
{
1075
1076
case SAI_QUEUE_TYPE_ALL:
1076
1077
type = " SAI_QUEUE_TYPE_ALL" ;
@@ -1082,10 +1083,12 @@ bool PortsOrch::getQueueType(sai_object_id_t queue_id, string &type)
1082
1083
type = " SAI_QUEUE_TYPE_MULTICAST" ;
1083
1084
break ;
1084
1085
default :
1085
- SWSS_LOG_ERROR (" Got unsupported queue type %d for %lu queue" , attr.value .s32 , queue_id);
1086
+ SWSS_LOG_ERROR (" Got unsupported queue type %d for %lu queue" , attr[ 0 ] .value .s32 , queue_id);
1086
1087
throw runtime_error (" Got unsupported queue type" );
1087
1088
}
1088
1089
1090
+ index = attr[1 ].value .u8 ;
1091
+
1089
1092
return true ;
1090
1093
}
1091
1094
@@ -2867,12 +2870,13 @@ void PortsOrch::generateQueueMapPerPort(const Port& port)
2867
2870
2868
2871
queueVector.emplace_back (name.str (), id);
2869
2872
queuePortVector.emplace_back (id, sai_serialize_object_id (port.m_port_id ));
2870
- queueIndexVector.emplace_back (id, to_string (queueIndex));
2871
2873
2872
2874
string queueType;
2873
- if (getQueueType (port.m_queue_ids [queueIndex], queueType))
2875
+ uint8_t queueRealIndex = 0 ;
2876
+ if (getQueueTypeAndIndex (port.m_queue_ids [queueIndex], queueType, queueRealIndex))
2874
2877
{
2875
2878
queueTypeVector.emplace_back (id, queueType);
2879
+ queueIndexVector.emplace_back (id, to_string (queueRealIndex));
2876
2880
}
2877
2881
2878
2882
string key = getQueueFlexCounterTableKey (id);
0 commit comments