Skip to content

Commit 8e33968

Browse files
mhamdan12ogalbxela
authored andcommitted
[mstlink][power_info] bug fix for prwer information in mlxlink -m command per lane
1 parent 55f89d4 commit 8e33968

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

mlxlink/modules/mlxlink_commander.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ MlxlinkCommander::MlxlinkCommander() : _userInput()
4444
_portType = 0;
4545
_numOfLanes = MAX_LANES_NUMBER;
4646
_numOfLanesPcie = 0;
47+
_moduleLanesMapping = vector<u_int32_t>(MAX_LANES_NUMBER);
4748
_linkUP = false;
4849
_plugged = false;
4950
_userInput._linkModeForce = false;
@@ -943,6 +944,13 @@ void MlxlinkCommander::getActualNumOfLanes(u_int32_t linkSpeedActive, bool exten
943944
_numOfLanes = getFieldValue("width");
944945
}
945946
}
947+
948+
sendPrmReg(ACCESS_REG_PMLP, GET);
949+
950+
for (u_int32_t lane = 0; lane < _numOfLanes; lane++)
951+
{
952+
_moduleLanesMapping[lane] = getFieldValue("rx_lane_" + to_string(lane));
953+
}
946954
}
947955

948956
u_int32_t MlxlinkCommander::activeSpeed2gNum(u_int32_t mask, bool extended)
@@ -1511,7 +1519,7 @@ void MlxlinkCommander::prepareDDMSection(bool valid, bool isModuleExtSupported)
15111519

15121520
for (u_int32_t lane = 0; lane < _numOfLanes; lane++)
15131521
{
1514-
string laneStr = to_string(lane);
1522+
string laneStr = to_string(_moduleLanesMapping[lane]);
15151523
rxPowerLane.push_back(getPower(getFieldValue("rx_power_lane" + laneStr), isModuleExtSupported));
15161524
txPowerLane.push_back(getPower(getFieldValue("tx_power_lane" + laneStr), isModuleExtSupported));
15171525
biasCurrentLane.push_back(getFieldValue("tx_bias_lane" + laneStr) / 500.0);

mlxlink/modules/mlxlink_commander.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ class MlxlinkCommander : public MlxlinkRegParser
572572
UserInput _userInput;
573573
dm_dev_id_t _devID;
574574
DPN _dpn;
575+
vector<u_int32_t> _moduleLanesMapping;
575576
u_int32_t _numOfLanes;
576577
u_int32_t _numOfLanesPcie;
577578
u_int32_t _cableMediaType;

mlxlink/modules/mlxlink_enums.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@
396396

397397
#define DBN_TO_LOCAL_PORT_BASE 60
398398

399-
#define MAX_LANES_NUMBER 4
399+
#define MAX_LANES_NUMBER 8
400400
#define MAX_DWORD_BLOCK_SIZE 32
401401
#define MAX_TX_GROUP_COUNT 10
402402

0 commit comments

Comments
 (0)