@@ -1685,13 +1685,29 @@ class switch_sai_rpcHandler : virtual public switch_sai_rpcIf {
1685
1685
port_lane_list_attribute.value .u32list .count = 8 ;
1686
1686
port_api->get_port_attribute (port_list_object_attribute.value .objlist .list [i], 1 , &port_lane_list_attribute);
1687
1687
1688
- std::set<int > port_lanes;
1689
1688
uint32_t laneCnt = port_lane_list_attribute.value .u32list .count ;
1690
- for (int j=0 ; j<laneCnt; j++){
1691
- port_lanes.insert (port_lane_list_attribute.value .u32list .list [j]);
1689
+ uint32_t laneMatchCount = 0 ;
1690
+
1691
+ for (gPortMapIt = gPortMap .begin (); gPortMapIt != gPortMap .end (); gPortMapIt ++)
1692
+ {
1693
+ laneMatchCount = 0 ;
1694
+ for (int j=0 ; j<laneCnt; j++)
1695
+ {
1696
+ if (gPortMapIt ->first .count (port_lane_list_attribute.value .u32list .list [j]))
1697
+ {
1698
+ laneMatchCount++;
1699
+ }
1700
+ else
1701
+ {
1702
+ break ;
1703
+ }
1704
+ }
1705
+ if (laneMatchCount == laneCnt)
1706
+ {
1707
+ break ;
1708
+ }
1692
1709
}
1693
1710
1694
- gPortMapIt = gPortMap .find (port_lanes);
1695
1711
if (gPortMapIt != gPortMap .end ()){
1696
1712
std::string front_port_alias = gPortMapIt ->second .c_str ();
1697
1713
std::string front_port_number;
@@ -1774,13 +1790,20 @@ class switch_sai_rpcHandler : virtual public switch_sai_rpcIf {
1774
1790
port_lane_list_attribute.value .u32list .count = 8 ;
1775
1791
port_api->get_port_attribute (port_list_object_attribute.value .objlist .list [i], 1 , &port_lane_list_attribute);
1776
1792
1777
- std::set<int > port_lanes;
1778
1793
uint32_t laneCnt = port_lane_list_attribute.value .u32list .count ;
1779
- for (int j=0 ; j<laneCnt; j++){
1780
- port_lanes.insert (port_lane_list_attribute.value .u32list .list [j]);
1794
+ uint32_t laneMatchCount = 0 ;
1795
+ for (int j=0 ; j<laneCnt; j++)
1796
+ {
1797
+ if (lane_set.count (port_lane_list_attribute.value .u32list .list [j]))
1798
+ {
1799
+ laneMatchCount++;
1800
+ }
1801
+ else
1802
+ {
1803
+ break ;
1804
+ }
1781
1805
}
1782
-
1783
- if (port_lanes == lane_set){
1806
+ if (laneCnt == laneMatchCount){
1784
1807
port_id = (sai_thrift_object_id_t ) port_list_object_attribute.value .objlist .list [i];
1785
1808
free (port_list_object_attribute.value .objlist .list );
1786
1809
free (port_lane_list_attribute.value .u32list .list );
0 commit comments