Skip to content
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

Extra delay between running firmware and updating firmware version #3610

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stephenxs
Copy link
Collaborator

What I did

Introduce a delay in "sfputil firmware run" between running firmware and updating the cable firmware version info.

The flow of "sfputil firmware run" is the following

  1. Issue CMIS CDB command "run cable firmware" (0x109) to the cable to switch to the inactive firmware.
  2. Fetch the version of the cable's running firmware

It takes time for the cable to get ready after switching firmware, which can cause an error message in step 2.
We introduce a CLI option to specify a delay between step 1 and 2 to avoid error message.

How I did it

How to verify it

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

Signed-off-by: Stephen Sun <stephens@nvidia.com>
@@ -1607,6 +1608,9 @@ def run(port_name, mode):
click.echo('Failed to run firmware in mode={}! CDB status: {}'.format(mode, status))
sys.exit(EXIT_FAIL)

if delay:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephenxs Can you put a comment why this delay is required?

@@ -1591,6 +1591,7 @@ def download_firmware(port_name, filepath):
1 = Hitless Reset to Inactive Image (Default)\n \
2 = Attempt non-hitless Reset to Running Image\n \
3 = Attempt Hitless Reset to Running Image\n")
@click.option('--delay', metavar='<delay>', type=click.IntRange(0, 10), help="Delay time before updating firmware information to STATE_DB")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prgeor Should we have a default delay of 5s for all modules?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants