@@ -6633,7 +6633,8 @@ void PortsOrch::removePortSerdesAttribute(sai_object_id_t port_id)
6633
6633
}
6634
6634
6635
6635
void PortsOrch::getPortSerdesVal (const std::string& val_str,
6636
- std::vector<uint32_t > &lane_values)
6636
+ std::vector<uint32_t > &lane_values,
6637
+ int base)
6637
6638
{
6638
6639
SWSS_LOG_ENTER ();
6639
6640
@@ -6643,23 +6644,7 @@ void PortsOrch::getPortSerdesVal(const std::string& val_str,
6643
6644
6644
6645
while (std::getline (iss, lane_str, ' ,' ))
6645
6646
{
6646
- lane_val = (uint32_t )std::stoul (lane_str, NULL , 16 );
6647
- lane_values.push_back (lane_val);
6648
- }
6649
- }
6650
-
6651
- void PortsOrch::getPortSerdesValBase10 (const std::string& val_str,
6652
- std::vector<uint32_t > &lane_values)
6653
- {
6654
- SWSS_LOG_ENTER ();
6655
-
6656
- uint32_t lane_val;
6657
- std::string lane_str;
6658
- std::istringstream iss (val_str);
6659
-
6660
- while (std::getline (iss, lane_str, ' ,' ))
6661
- {
6662
- lane_val = (uint32_t )std::stoul (lane_str, NULL , 10 );
6647
+ lane_val = (uint32_t )std::stoul (lane_str, NULL , base);
6663
6648
lane_values.push_back (lane_val);
6664
6649
}
6665
6650
}
@@ -7041,7 +7026,7 @@ bool PortsOrch::initGearboxPort(Port &port)
7041
7026
for (auto pair: tx_fir_strings_system_side) {
7042
7027
if (m_gearboxInterfaceMap[port.m_index ].tx_firs .find (pair.first ) != m_gearboxInterfaceMap[port.m_index ].tx_firs .end () ) {
7043
7028
attr_val.clear ();
7044
- getPortSerdesValBase10 (m_gearboxInterfaceMap[port.m_index ].tx_firs [pair.first ], attr_val);
7029
+ getPortSerdesVal (m_gearboxInterfaceMap[port.m_index ].tx_firs [pair.first ], attr_val, 10 );
7045
7030
serdes_attr.insert (serdes_attr_pair (pair.second , attr_val));
7046
7031
}
7047
7032
}
@@ -7061,7 +7046,7 @@ bool PortsOrch::initGearboxPort(Port &port)
7061
7046
for (auto pair: tx_fir_strings_line_side) {
7062
7047
if (m_gearboxInterfaceMap[port.m_index ].tx_firs .find (pair.first ) != m_gearboxInterfaceMap[port.m_index ].tx_firs .end () ) {
7063
7048
attr_val.clear ();
7064
- getPortSerdesValBase10 (m_gearboxInterfaceMap[port.m_index ].tx_firs [pair.first ], attr_val);
7049
+ getPortSerdesVal (m_gearboxInterfaceMap[port.m_index ].tx_firs [pair.first ], attr_val, 10 );
7065
7050
serdes_attr.insert (serdes_attr_pair (pair.second , attr_val));
7066
7051
}
7067
7052
}
0 commit comments