sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

[Mellanox] Fix test_shared_headroom_pool_configure issue

Open JibinBao opened this issue 1 year ago • 8 comments

Description of PR

For mellanox device, the headroom size is related to the speed and cable length. In community setup, some cable length is 300m in config, so when the speed is over 400G, the headroom size will exceed the limitation. So for test_shared_headroom_pool_configure, we change the cable length to a smaller when speed is equal or greater 400G and the cable length is over 200m.

Summary: Fixes # (issue)

Type of change

  • [x] Bug fix
  • [ ] Testbed and Framework(new/improvement)
  • [ ] Test case(new/improvement)

Back port request

  • [ ] 201911
  • [ ] 202012
  • [ ] 202205
  • [ ] 202305
  • [x] 202311

Approach

What is the motivation for this PR?

Fix test_shared_headroom_pool_configure issue

How did you do it?

Change the cable length to a smaller one such as 50, when the cable length to a smaller when speed is equal or greater 400G and the cable length is over 200m.

How did you verify/test it?

Run test_shared_headroom_pool_configure on setup which has ports with speed over 400G and cable length over 300m

Any platform specific information?

Mellanox

Supported testbed topology if it's a new test case?

Any

Documentation

JibinBao avatar Jun 05 '24 05:06 JibinBao

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passed
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/qos/files/mellanox/ports_cable_len.j2

check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/qos/buffer_helpers.py:76:99: E202 whitespace before ')'
tests/qos/test_buffer.py:20:1: F401 'tests.qos.buffer_helpers.update_cable_len_for_all_ports' imported but unused

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Jun 05 '24 05:06 mssonicbld

/azpw run Azure.sonic-mgmt

JibinBao avatar Jun 13 '24 09:06 JibinBao

/AzurePipelines run Azure.sonic-mgmt

mssonicbld avatar Jun 13 '24 09:06 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jun 13 '24 09:06 azure-pipelines[bot]

@kperumalbfn Can you please help review?

bingwang-ms avatar Jul 23 '24 16:07 bingwang-ms

Hi @JibinBao, can you please remind me what's the error if the headroom size will exceed the limitation?

bingwang-ms avatar Aug 23 '24 21:08 bingwang-ms

Hi @JibinBao, can you please remind me what's the error if the headroom size will exceed the limitation?

Hi @bingwang-ms , The error is like below: Failed: Pool size isn't correct in database: expected pool 34922496.0 shp 0, size in APPL_DB pool 45785088 shp 655360, size in ASIC_DB ('45785088', '655360')

JibinBao avatar Oct 08 '24 02:10 JibinBao

@kperumalbfn Can you help review?

bingwang-ms avatar Oct 23 '24 21:10 bingwang-ms

hi @kperumalbfn , Can you help review it again?

JibinBao avatar Nov 25 '24 01:11 JibinBao

@kperumalbfn any further comment or you can sing off?

liat-grozovik avatar Dec 18 '24 10:12 liat-grozovik

@kperumalbfn Kindly reminder.

bingwang-ms avatar Dec 18 '24 17:12 bingwang-ms

Cherry-pick PR to 202411: https://github.com/sonic-net/sonic-mgmt/pull/17330

mssonicbld avatar Mar 04 '25 21:03 mssonicbld