Skip to content

[Mellanox] Adopt single way to get fan direction for all ASIC types#7386

Merged
jleveque merged 3 commits intosonic-net:masterfrom
stephenxs:fan_dir
May 4, 2021
Merged

[Mellanox] Adopt single way to get fan direction for all ASIC types#7386
jleveque merged 3 commits intosonic-net:masterfrom
stephenxs:fan_dir

Conversation

@stephenxs
Copy link
Copy Markdown
Collaborator

@stephenxs stephenxs commented Apr 21, 2021

Why I did it

Adopt a single way to get fan direction for all ASIC types.
It depends on hw-mgmt V.7.0010.2000.2303. Depends on #7419

Signed-off-by: Stephen Sun stephens@nvidia.com

How I did it

Originally, the get_direction was implemented by fetching and parsing /var/run/hw-management/system/fan_dir on the Spectrum-2 and the Spectrum-3 systems. It isn't supported on the Spectrum system.
Now, it is implemented by fetching /var/run/hw-management/thermal/fanX_dir for all the platforms.

How to verify it

  1. Regression test.
  • Mock random legal value: 0 - intake or 1 - exhaust
  • Mock an invalid value: values other than 0 or 1
  • Mock the case that file doesn't exist
  1. Manually test.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

Fan direction is stored at /var/run/hw-management/thermal/fanX_dir
0 - intake
1 - exhaust

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
@liat-grozovik
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@jleveque jleveque merged commit b2286a2 into sonic-net:master May 4, 2021
@stephenxs stephenxs deleted the fan_dir branch May 4, 2021 06:39
daall pushed a commit that referenced this pull request May 5, 2021
…7386)

#### Why I did it
Adopt a single way to get fan direction for all ASIC types.
It depends on hw-mgmt V.7.0010.2000.2303. Depends on #7419

#### How I did it
Originally, the get_direction was implemented by fetching and parsing `/var/run/hw-management/system/fan_dir` on the Spectrum-2 and the Spectrum-3 systems. It isn't supported on the Spectrum system.
Now, it is implemented by fetching `/var/run/hw-management/thermal/fanX_dir` for all the platforms.

Signed-off-by: Stephen Sun <stephens@nvidia.com>
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-buildimage that referenced this pull request May 23, 2021
…onic-net#7386)

#### Why I did it
Adopt a single way to get fan direction for all ASIC types.
It depends on hw-mgmt V.7.0010.2000.2303. Depends on sonic-net#7419

#### How I did it
Originally, the get_direction was implemented by fetching and parsing `/var/run/hw-management/system/fan_dir` on the Spectrum-2 and the Spectrum-3 systems. It isn't supported on the Spectrum system.
Now, it is implemented by fetching `/var/run/hw-management/thermal/fanX_dir` for all the platforms.

Signed-off-by: Stephen Sun <stephens@nvidia.com>
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
…onic-net#7386)

#### Why I did it
Adopt a single way to get fan direction for all ASIC types.
It depends on hw-mgmt V.7.0010.2000.2303. Depends on sonic-net#7419

#### How I did it
Originally, the get_direction was implemented by fetching and parsing `/var/run/hw-management/system/fan_dir` on the Spectrum-2 and the Spectrum-3 systems. It isn't supported on the Spectrum system.
Now, it is implemented by fetching `/var/run/hw-management/thermal/fanX_dir` for all the platforms.

Signed-off-by: Stephen Sun <stephens@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants