-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetch firmware versions for Cmis Target FW upgrade supported cables #455
Conversation
Signed-off-by: Mihir Patel <patelmi@microsoft.com>
@mihirpat1 type in PR description -> "E1 and E1 targets " |
@@ -75,8 +75,8 @@ def get_transceiver_info_firmware_versions(self): | |||
Retrieves active and inactive firmware versions of the xcvr | |||
|
|||
Returns: | |||
A list with active and inactive firmware versions of the xcvr | |||
[active_firmware, inactive_firmware] | |||
A dictionary containing the active and inactive firmware versions of the transceiver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AnoopKamath please note this change for your PR...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Thanks @prgeor
|
||
TARGET_LIST = [TARGET_E0_VALUE, TARGET_E1_VALUE, TARGET_E2_VALUE] | ||
|
||
AEC_E1_FIRMWARE_INFO_MAP = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihirpat1 rename AEC -> CABLE?
'server_firmware': 'e1_server_firmware' | ||
} | ||
|
||
AEC_E2_FIRMWARE_INFO_MAP = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihirpat1 rename AEC -> CABLE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prgeor I have addressed this now.
Returns: | ||
A dictionary of the firmware versions for all targets. | ||
""" | ||
def get_transceiver_info_firmware_versions(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihirpat1 is this going to be called for cmis optics not supporting remote end fw upgrade?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prgeor No, this implementation will be invoked only for CMIS optics supporting remote end FW upgrade.
server_fw_version_str = '' | ||
for i in range(0, SERVER_FW_VERSION_SIZE, SERVER_FW_VERSION_NUMBER_SIZE): | ||
server_fw_version_number = bytes(server_fw_version_byte_array[i:i+SERVER_FW_VERSION_NUMBER_SIZE]) | ||
# Each number of the server firmware version is 4 bytes and is stored in big endian format. | ||
# Convert the 4 bytes to a number and then convert the number to a string. | ||
server_fw_version_str += str(struct.unpack('>I', server_fw_version_number)[0]) + '.' | ||
server_fw_version_str = server_fw_version_str[:-1] | ||
return_dict['server_firmware'] = server_fw_version_str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihirpat1 can we encapsulate this calculation in server version memmap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For eg. you can check the implementation of DateField field in xcvrd_field.py which return the date in string format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prgeor I have addressed this now.
@StormLiangMS @yxieca Can you please help in merging this to 202305 and 202311? |
…onic-net#455) * Fetch firmware versions for Cmis Target FW upgrade supported cables Signed-off-by: Mihir Patel <patelmi@microsoft.com> * Enhanced unit-test for exception handling while reading target firmware version * Addressed PR comments and moved server firmware version info to xcvr_field --------- Signed-off-by: Mihir Patel <patelmi@microsoft.com>
Cherry-pick PR to 202311: #459 |
…455) * Fetch firmware versions for Cmis Target FW upgrade supported cables Signed-off-by: Mihir Patel <patelmi@microsoft.com> * Enhanced unit-test for exception handling while reading target firmware version * Addressed PR comments and moved server firmware version info to xcvr_field --------- Signed-off-by: Mihir Patel <patelmi@microsoft.com>
…onic-net#455) * Fetch firmware versions for Cmis Target FW upgrade supported cables Signed-off-by: Mihir Patel <patelmi@microsoft.com> * Enhanced unit-test for exception handling while reading target firmware version * Addressed PR comments and moved server firmware version info to xcvr_field --------- Signed-off-by: Mihir Patel <patelmi@microsoft.com>
Cherry-pick PR to 202305: #464 |
…455) * Fetch firmware versions for Cmis Target FW upgrade supported cables Signed-off-by: Mihir Patel <patelmi@microsoft.com> * Enhanced unit-test for exception handling while reading target firmware version * Addressed PR comments and moved server firmware version info to xcvr_field --------- Signed-off-by: Mihir Patel <patelmi@microsoft.com>
Ignore processing the front panel ports in xcvrd. This include ports with suffixes other than Ethernet and ports that have role field set to any value other than Ext. Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
Description
With onboarding of CMIS target firmware upgrade supported transceivers, we need a mechanism to store the firmware version of E1 and E2 targets (in addition to E0 target) in redis-db. The current change set is for accomplishing this task.
XCVRD will be able to push the target firmware version information to TRANSCEIVER_FIRMWARE_INFO table of STATE_DB.
MSFT ADO - 26565884
Motivation and Context
This change is required to periodically read target firmware versions and store it in TRANSCEIVER_FIRMWARE_INFO table of STATE_DB.
How Has This Been Tested?
Following scenarios were tested
1.1 CLI output on transceiver not supporting Target FW upgrade
1.2 XCVR on target 1 removed
1.3 XCVR on target 2 removed
1.4 All targets having different inactive firmware versions
1.5 CLI output on transceiver not supporting Target FW upgrade
1.6 CLI on port with DOM disabled
Additional Information (Optional)