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

QoSHdrmPoolsize _tx_disable_enable for all destination ports in lag #11008

Merged
merged 5 commits into from
Mar 8, 2024

Conversation

ansrajpu-git
Copy link
Contributor

@ansrajpu-git ansrajpu-git commented Dec 13, 2023

Description of PR

Summary:
Since testQosHeadroomPoolsize test takes more than one source port as input, even after tx disable, the packets could still hash from the other ports. Hence tx_disable has to be applied on all ports in the destination lag to block all the traffic during tx_disable.
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205
  • 202305

Approach

Since testQosHeadroomPoolsize test takes more than one source port as input, even after tx disable, the packets could still hash from the other ports. Hence tx_disable has to be applied on all ports in the destination lag to block all the traffic during tx_disable.
This was achieved by
-Collecting all the dst_port_ids ports associated with the src_port_ids
-Sending all the dst_port_ids in a list, instead of sending a single dst_port_id in tx_disable

What is the motivation for this PR?

Intermitted failure of testQosHdrmPoolsize test

How did you do it?

Executed Qos test suite and verify the results

How did you verify/test it?

Any platform specific information?

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

Documentation

@ansrajpu-git
Copy link
Contributor Author

@vmittal-msft , kindly verify & approve

@mssonicbld
Copy link
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/saitests/py3/sai_qos_tests.py:2731:9: E303 too many blank lines (2)
tests/saitests/py3/sai_qos_tests.py:2854:73: E225 missing whitespace around operator

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>

@vmittal-msft vmittal-msft self-assigned this Dec 21, 2023
@vmittal-msft vmittal-msft self-requested a review December 21, 2023 18:14
@rlhui rlhui assigned ansrajpu-git and unassigned vmittal-msft Jan 24, 2024
# Collect destination ports that may be in a lag
pkt_dst_mac = self.router_mac if self.router_mac != '' else self.dst_port_mac
dst_port_ids = []
for i in range(len(self.src_port_ids)):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please clarify why dst ports and dependent on src_port_id ? Should we check if destination port is part of the lag then disable all ports under that lag ?

@@ -2733,7 +2739,9 @@ def runTest(self):
pkts_num_egr_mem = int(self.test_params['pkts_num_egr_mem'])

# Pause egress of dut xmit port
self.sai_thrift_port_tx_disable(self.dst_client, self.asic_type, [self.dst_port_id])
# Disable all dst ports
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, Can we have this specific to dnx chassis ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

assert (recv_counters[sidx_dscp_pg_tuples[i][2]] >
recv_counters_bases[sidx_dscp_pg_tuples[i][0]][sidx_dscp_pg_tuples[i][2]])
self.sai_thrift_port_tx_enable(self.dst_client, self.asic_type, uniq_dst_ports)
sys.exit("Too many pkts needed to trigger pfc: %d" % (pkt_cnt))
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@mssonicbld
Copy link
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/saitests/py3/sai_qos_tests.py:2759:9: F841 local variable 'asic_type' is assigned to but never used

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>

@arlakshm
Copy link
Contributor

arlakshm commented Mar 4, 2024

add @kenneth-arista, @ysmanman for viz..

@vmittal-msft
Copy link
Contributor

@yxieca @wangxin please help merge.

@arlakshm
Copy link
Contributor

arlakshm commented Mar 7, 2024

Hi @kenneth-arista, @ysmanman can you please take a look at this PR and check if this changes works on single asic LCs are well

@yxieca yxieca merged commit c66bf6b into sonic-net:master Mar 8, 2024
13 checks passed
@StormLiangMS
Copy link
Collaborator

hi @ansrajpu-git @vmittal-msft the PR, #8775, which breaks the testQosSaiHeadroomPoolWatermark for box devices due to wrong intent in line 2386. And in current PR it seems changed this part, could you pls verify the change on ToR / Leaf before merge?
image

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Mar 17, 2024
…onic-net#11008)

* QoSHdrmPoolsize_collecting dst ports in lag for tx_disable_enable
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #12024

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Mar 17, 2024
…onic-net#11008)

* QoSHdrmPoolsize_collecting dst ports in lag for tx_disable_enable
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #12025

@ansrajpu-git
Copy link
Contributor Author

@vmittal-msft, please help this merge to 202205 branch.

ansrajpu-git added a commit to ansrajpu-git/sonic-mgmt that referenced this pull request May 15, 2024
…onic-net#11008)

* QoSHdrmPoolsize_collecting dst ports in lag for tx_disable_enable
yxieca pushed a commit that referenced this pull request Aug 5, 2024
…11008) (#12788)

* QoSHdrmPoolsize_collecting dst ports in lag for tx_disable_enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants