Skip to content

Adding PG7 check to DscpToPgMapping#9859

Merged
judyjoseph merged 7 commits intosonic-net:masterfrom
ansrajpu-git:DscpToPG
Mar 20, 2024
Merged

Adding PG7 check to DscpToPgMapping#9859
judyjoseph merged 7 commits intosonic-net:masterfrom
ansrajpu-git:DscpToPG

Conversation

@ansrajpu-git
Copy link
Contributor

@ansrajpu-git ansrajpu-git commented Sep 6, 2023

Description of PR

With the new SAI image & the fix as part of PR# sonic-net/sonic-buildimage#16254, the DscpToPgMapping qos test needs a check on the PG7 as well because, the control packets from CPU will now come to PG7 and may increase the packet count.

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

Adding pg7 to verification along with pg0 & pg4 as, the control packets from CPU will now come to pg7 and may increase the packet count.

What is the motivation for this PR?

DscpToPgMapping failed in test run.

How did you do it?

How did you verify/test it?

Executed the qos test suite.

Any platform specific information?

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

Documentation

Comment on lines 752 to 754
Copy link
Contributor

Choose a reason for hiding this comment

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

all control traffic is always mapped to q7. on which platform do you see lacp and bgp packets mapped to q0 and q4 respectively?

Choose a reason for hiding this comment

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

all control traffic is always mapped to q7. on which platform do you see lacp and bgp packets mapped to q0 and q4 respectively?

The LLDP and lacp packets received from peer will go to Q0 since it is untagged non ip packet. The BGP packets from peer are going to Q4 with the TOS value 0xC0.

Copy link
Contributor

Choose a reason for hiding this comment

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

Checked with @neethajohn. We need to check why the packets aren't coming on PG=7. all control packets should go to PG=7.

Copy link
Contributor

Choose a reason for hiding this comment

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

@neethajohn if you are refering to this PR #8097 and related fixes -- isn't not for the TX packets only ? i.e all the control packets being tx'ed should use queue 7.

Here @saksarav-nokia is taking about the queue used for packets RX, coming into the front panel ports. Is that also always queue 7 irrespective of the DSCP or other fields in the packet?

@ansrajpu-git
Copy link
Contributor Author

@vmittal-msft ,Could you please approve this PR?

@judyjoseph
Copy link
Contributor

@ansrajpu-git @saksarav-nokia Could you confirm the behavior for all control packets BGP/LLDP/LACP/Macsec etc ? thanks

@saksarav-nokia
Copy link

@judyjoseph , Are you talking about the Queues assigned for these control packets received on front panel port? OR CPU?. Could you elaborate more?

@judyjoseph
Copy link
Contributor

@judyjoseph , Are you talking about the Queues assigned for these control packets received on front panel port? OR CPU?. Could you elaborate more?

I was referring to the earlier comment from Vineet -- that all the control packets should come in queue 7 irrespective of whether it is send out of CPU port or from front panel port. We can find out the behavior we observe and talk to broadcom if that is different from what was expected.

@saksarav-nokia
Copy link

@judyjoseph , As i mentioned in the chat, the control packets received on front panel ports are queued based on the .1p or dscp values based on the packet type. SInce BGP packets are ip packets, it goes to Queue 0 based on the DSCP value. Since LLDP and LACP packets are untagged L2 packets, they are going to Queue 0. If this behavior is different from XGS, we need to check with BCM.

@judyjoseph
Copy link
Contributor

Following up with brcm via CS00012316603

@rlhui
Copy link

rlhui commented Nov 14, 2023

In this PR, you're modifying it for PG7, and not queue7 right? Please update the title if indeed PG7 is being checked here.

@ansrajpu-git ansrajpu-git changed the title Adding queue7 check to DscpToPgMapping Adding PG7 check to DscpToPgMapping Nov 15, 2023
@rlhui rlhui removed the P0 label Dec 13, 2023
@vmittal-msft
Copy link
Contributor

@ansrajpu-git @saksarav-nokia we may need to update this PR to accommodate extra packets coming in on PG3/4 as we are not planning to change copp_cfg file to force all control packets to go to PG7.

@vmittal-msft
Copy link
Contributor

@ansrajpu-git, Since we don't plan to add any changes in this. lets close this.

@saksarav-nokia
Copy link

@ansrajpu-git, Since we don't plan to add any changes in this. lets close this.

@vmittal-msft , The control packets sent from CPU are assigned to PG 7 of the port to which the control packet is sent out. The reason for this is that when CPU sends the packet out, it is sent via KNET which adds the PTCH header for DNX asic to understand the source port and the source system port is the port to which the control packet is sent out. since we send the control packets to TC=7, the tx control packets will be counted against PG 7 of the front panel port. I am checking with BCM to see why it is designed this way. If they can't fix it, then we need this PR.

@saksarav-nokia
Copy link

@vmittal-msft , BCM confirmed in csp CS00012333616 that the control packets sent from CPU to the dest port will be mapped to the PG 7( PG mapped to sai_default_cpu_tx_tc=7) of the dest port since the packets sent from CPU are KNET using PTCH header. So we need to merge this PR.

@judyjoseph
Copy link
Contributor

@saksarav-nokia @vmittal-msft we are seeing failures in the testrun without this fix -- so there are packets coming in PG7, planning to go ahead and merge this one. Let me know any thought

@saksarav-nokia
Copy link

@saksarav-nokia @vmittal-msft we are seeing failures in the testrun without this fix -- so there are packets coming in PG7, planning to go ahead and merge this one. Let me know any thought

@judyjoseph , We need this PR. Please see my previous comments and also the BCM csp i mentioned.

judyjoseph
judyjoseph previously approved these changes Feb 1, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

I see this code as a common sai qos test library - do we need to add a check for broadcom DNX ASIC ? else this will get applicable to all asic platforms

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@judyjoseph , added the broadcom DNX ASIC check. Kindly review.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks. My original comment was to protect just this new change i.e i=7 alone with the check for asic == dnx. The other checks for i=0, i=4 was existing earlier, will leave it as such

Copy link
Contributor

Choose a reason for hiding this comment

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

The behavior where we see packets in PG 7 of the source port, due to TX packets from CPU sent out with TC =7 --- is Broadcom specific

Shouldn't the check be something like this -- i.e expect PG7 only if it is brcm-dnx ?
if i == 0 or i == 4 or (platform_asic and platform_asic == "broadcom-dnx" and i == 7):

Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed, lets try this logic -

i => 0 -> 7
pg => 0,3,4
dscps => 62,1,1

DNX/Chassis:
pg = 0 => Some extra packets with unmarked TC
pg = 4 => Extra packets for LACP/BGP packets
pg = 7 => packets from cpu to front panel ports

if non chassis:
if i == pg:
assert(pg_cntrs[pg] == pg_cntrs_base[pg] + len(dscps))
else:
assert(pg_cntrs[i] == pg_cntrs_base[i])
else
i = {3}
assert(pg_cntrs[pg] == pg_cntrs_base[pg] + len(dscps))
i = {0,4,7}
assert(pg_cntrs[pg] >= pg_cntrs_base[pg] + len(dscps))
else {1,2,5,6}
assert(pg_cntrs[i] == pg_cntrs_base[i])

Copy link
Contributor

@vmittal-msft vmittal-msft left a comment

Choose a reason for hiding this comment

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

Lets try commented logic to see if it works for chassis.

@ansrajpu-git
Copy link
Contributor Author

Lets try commented logic to see if it works for chassis.

@vmittal-msft, as per the discussion and comments added a change for dnx chassis. Please review & comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ansrajpu-git Can you please keep non DNX check same ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vmittal-msft , As per the discussion and notes taken, I have implemented the changes.
the non-chassis behavior is reverted back to how it was originally implemented PR #7079

@vmittal-msft vmittal-msft 2 weeks ago
As discussed, lets try this logic -

i => 0 -> 7
pg => 0,3,4
dscps => 62,1,1

DNX/Chassis:
pg = 0 => Some extra packets with unmarked
pg = 4 => Extra packets for LACP/BGP packets
pg = 7 => packets from cpu to front panel ports

if non chassis:
if i == pg:
assert(pg_cntrs[pg] == pg_cntrs_base[pg] + len(dscps))
else:
assert(pg_cntrs[i] == pg_cntrs_base[i])

else
i = {3}
assert(pg_cntrs[pg] == pg_cntrs_base[pg] + len(dscps))
i = {0,4,7}
assert(pg_cntrs[pg] >= pg_cntrs_base[pg] + len(dscps))
else {1,2,5,6}
assert(pg_cntrs[i] == pg_cntrs_base[i])

Please confirm if more changes are required..

Copy link
Contributor

@vmittal-msft vmittal-msft Mar 7, 2024

Choose a reason for hiding this comment

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

@ansrajpu-git i still see some difference from the logic we discussed. Can you please check ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vmittal-msft, updated the logic. Please check.

judyjoseph
judyjoseph previously approved these changes Mar 7, 2024
@vmittal-msft
Copy link
Contributor

@yxieca @wangxin please help merge.

@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 9, 2024
* Qos newSAI change_adding queue7 to DscpToPGMapping
* QoS_DscpToPgMapping_platform_asic check added
yxieca pushed a commit that referenced this pull request May 15, 2024
* Qos newSAI change_adding queue7 to DscpToPGMapping
* QoS_DscpToPgMapping_platform_asic check added
JibinBao added a commit to JibinBao/sonic-mgmt that referenced this pull request Nov 6, 2024
The issue is introduced by the PR:sonic-net#9859.
This PR should be dedicated for broadcom-dnx, it should not change the logic for the remaining platform, so restore the original logic for non-broadcom-dnx.
bingwang-ms pushed a commit that referenced this pull request Nov 6, 2024
The issue is introduced by the PR:#9859.
This PR should be dedicated for broadcom-dnx, it should not change the logic for the remaining platform, so restore the original logic for non-broadcom-dnx.
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Nov 6, 2024
The issue is introduced by the PR:sonic-net#9859.
This PR should be dedicated for broadcom-dnx, it should not change the logic for the remaining platform, so restore the original logic for non-broadcom-dnx.
mssonicbld pushed a commit that referenced this pull request Nov 7, 2024
The issue is introduced by the PR:#9859.
This PR should be dedicated for broadcom-dnx, it should not change the logic for the remaining platform, so restore the original logic for non-broadcom-dnx.
veronica-arista pushed a commit to veronica-arista/sonic-mgmt that referenced this pull request Nov 7, 2024
The issue is introduced by the PR:sonic-net#9859.
This PR should be dedicated for broadcom-dnx, it should not change the logic for the remaining platform, so restore the original logic for non-broadcom-dnx.
sreejithsreekumaran pushed a commit to sreejithsreekumaran/sonic-mgmt that referenced this pull request Nov 15, 2024
The issue is introduced by the PR:sonic-net#9859.
This PR should be dedicated for broadcom-dnx, it should not change the logic for the remaining platform, so restore the original logic for non-broadcom-dnx.
yutongzhang-microsoft pushed a commit to yutongzhang-microsoft/sonic-mgmt that referenced this pull request Nov 21, 2024
The issue is introduced by the PR:sonic-net#9859.
This PR should be dedicated for broadcom-dnx, it should not change the logic for the remaining platform, so restore the original logic for non-broadcom-dnx.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants