Skip to content

[QoS] IP-IP DSCP to Queue Mapping Testgap#9098

Merged
developfast merged 17 commits intosonic-net:masterfrom
developfast:qos_sai_dscp_mapping_testgap
Aug 17, 2023
Merged

[QoS] IP-IP DSCP to Queue Mapping Testgap#9098
developfast merged 17 commits intosonic-net:masterfrom
developfast:qos_sai_dscp_mapping_testgap

Conversation

@developfast
Copy link
Copy Markdown
Contributor

@developfast developfast commented Jul 24, 2023

Description of PR

Summary: Currently, the test case testQosSaiDscpQueueMapping only verify the DSCP to Queue mapping for regular traffic. The mapping of IPinIP traffic (decapsulated in IPinIP tunnel) is not tested. Hence a new test case is being added to verify the mapping for IPinIP traffic. This PR adds two tests to test IP-IP packet forwarding in both "uniform" and "pipe" decap mode on the DUT.

Fixes (issue) #8789

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

See summary

How did you do it?

  1. Generate IPinIP traffic from ptf using ptfadapter. The destination IP in the outer layer of the packets should be the loopback (10.1.0.32) of DUT.
  2. Ingress the packets to DUT, verify the packets are decapsulated.
  3. Check the queue counter within the DUT, ensure the mapping is as expected.

How did you verify/test it?

Test passes locally in both uniform and pipe mode. Currently, this test logs the mapping of DSCP to Queue value for all ASIC types.

Output:

  Inner Packet DSCP Value    Egress Queue    Egress Queue Count
-------------------------  --------------  --------------------
                        0               1                 10000
                        1               1                 10000
                        2               1                 10000
                        3               3                 10000
                        4               4                 10000
                        5               2                 10000
                        6               1                 10000
                        7               1                 10000
                        8               0                 10000
                        9               1                 10000
                       10               1                 10000
                       11               1                 10000
...

Any platform specific information?

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

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator

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.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/saitests/sai_qos_tests.py

fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/saitests/sai_qos_tests.py

check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Failed
- hook id: check-ast
- exit code: 1
...
[truncated extra lines, please run pre-commit locally to view full check results]

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
Copy link
Copy Markdown
Collaborator

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.........................................................Passed
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/test_qos_dscp_mapping.py:13:1: F401 'tests.common.utilities.wait_until' imported but unused
tests/qos/test_qos_dscp_mapping.py:13:1: F401 'tests.common.utilities.is_ipv4_address' imported but unused
tests/qos/test_qos_dscp_mapping.py:15:1: F401 'tests.common.config_reload.config_reload' imported but unused
tests/qos/test_qos_dscp_mapping.py:16:1: F401 'tests.common.helpers.assertions.pytest_require' imported but unused
tests/qos/test_qos_dscp_mapping.py:17:1: F401 'abc.abstractmethod' imported but unused
tests/qos/test_qos_dscp_mapping.py:18:1: F401 'tests.common.fixtures.duthost_utils.separated_dscp_to_tc_map_on_uplink' imported but unused
tests/qos/test_qos_dscp_mapping.py:176:9: F841 local variable 'test_port_ids' is assigned to but never used
tests/qos/test_qos_dscp_mapping.py:177:9: F841 local variable 'outer_dst_port_id' is assigned to but never used
tests/qos/test_qos_dscp_mapping.py:183:9: F841 local variable 'inner_src_port_id' is assigned to but never used

flake8...............................................(no files to check)Skipped
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

@developfast developfast marked this pull request as ready for review August 7, 2023 05:18
@mssonicbld
Copy link
Copy Markdown
Collaborator

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.........................................................Passed
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/test_qos_dscp_mapping.py:13:1: F401 'tests.common.utilities.wait_until' imported but unused
tests/qos/test_qos_dscp_mapping.py:13:1: F401 'tests.common.utilities.is_ipv4_address' imported but unused
tests/qos/test_qos_dscp_mapping.py:16:1: F401 'tests.common.fixtures.duthost_utils.dut_qos_maps' 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>

@developfast developfast requested review from bingwang-ms and removed request for XuChen-MSFT and wsycqyz August 7, 2023 16:16
@bingwang-ms
Copy link
Copy Markdown
Collaborator

Please change the DSCP_MODE to pipe and uniform and run the test.
That can be done with a pytest param.
If the DSCP_MODE is uniform, the DSCP after decapsulation is following the outer value.
If the DSCP_MODE is pipe, the DSCP after decapsulation is not changed.

@mssonicbld
Copy link
Copy Markdown
Collaborator

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.........................................................Passed
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/test_qos_dscp_mapping.py:249:13: E303 too many blank lines (2)

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>

@developfast
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

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.........................................................Passed
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/test_qos_dscp_mapping.py:271:121: E501 line too long (123 > 120 characters)

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>

@wangxin
Copy link
Copy Markdown
Collaborator

wangxin commented Aug 28, 2023

@developfast Can you elaborate why this new test is required for older branches? Generally, we should only back port bug fixes. New features/tests should only go to master branch.

@neethajohn
Copy link
Copy Markdown
Contributor

neethajohn commented Oct 2, 2023

@wangxin, this testcase was developed to capture the dscp mapping behavior on various releases (this testcases originated as a result of an issue in production). We might end up requesting feature support from various vendors to fully support this usecase. At this point, we don't have clarity on what releases we will need to backport to but want to have this running on all releases

@mssonicbld
Copy link
Copy Markdown
Collaborator

@developfast PR conflicts with 202305 branch

@mssonicbld
Copy link
Copy Markdown
Collaborator

@developfast PR conflicts with 202012 branch

@mssonicbld
Copy link
Copy Markdown
Collaborator

@developfast PR conflicts with 202205 branch

@XuChen-MSFT
Copy link
Copy Markdown
Contributor

@developfast can you help fix conflicts on feature branch?

AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Jan 25, 2024
qiluo-msft pushed a commit to sonic-net/sonic-buildimage that referenced this pull request May 19, 2025
Why I did it
Previously we disable the global dscp_to_tc_map table as sai doesn't support it. Now they have supported it and we need it to enable inner dscp map to tc feature, so remove the old dummy macro and update testing case accordingly.

How I did it
Remove empty dscp_to_tc_map macro in qos.j2 and update testing case accordingly.

How to verify it
sonic-net/sonic-mgmt#9098 relevant test had been raised
mssonicbld added a commit to mssonicbld/sonic-buildimage that referenced this pull request May 27, 2025
<!--
     Please make sure you've read and understood our contributing guidelines:
     https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

     ** Make sure all your commits include a signature generated with `git commit -s` **

     If this is a bug fix, make sure your description includes "fixes #xxxx", or
     "closes #xxxx" or "resolves #xxxx"

     Please provide the following information:
-->

#### Why I did it
Previously we disable the global dscp_to_tc_map table as sai doesn't support it. Now they have supported it and we need it to enable inner dscp map to tc feature, so remove the old dummy macro and update testing case accordingly.

##### Work item tracking
- Microsoft ADO **(number only)**:

#### How I did it
Remove empty dscp_to_tc_map macro in qos.j2 and update testing case accordingly.
#### How to verify it

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->
sonic-net/sonic-mgmt#9098 relevant test had been raised
#### Which release branch to backport (provide reason below if selected)

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
- [ ] 202305

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [x] <!-- image version 1 -->202405
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

<!--
 Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
mssonicbld added a commit to sonic-net/sonic-buildimage that referenced this pull request May 27, 2025
<!--
 Please make sure you've read and understood our contributing guidelines:
 https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

 failure_prs.log skip_prs.log Make sure all your commits include a signature generated with `git commit -s` **

 If this is a bug fix, make sure your description includes "fixes #xxxx", or
 "closes #xxxx" or "resolves #xxxx"

 Please provide the following information:
-->

#### Why I did it
Previously we disable the global dscp_to_tc_map table as sai doesn't support it. Now they have supported it and we need it to enable inner dscp map to tc feature, so remove the old dummy macro and update testing case accordingly.

##### Work item tracking
- Microsoft ADO **(number only)**:

#### How I did it
Remove empty dscp_to_tc_map macro in qos.j2 and update testing case accordingly.
#### How to verify it

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->
sonic-net/sonic-mgmt#9098 relevant test had been raised
#### Which release branch to backport (provide reason below if selected)

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
- [ ] 202305

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [x] <!-- image version 1 -->202405
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

<!--
 Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
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.

6 participants