[portsorch]: Enhancing SWSS OA logs to capture host_tx_ready change events#2822
Merged
mihirpat1 merged 1 commit intosonic-net:masterfrom Jun 15, 2023
Merged
Conversation
…vents Signed-off-by: Mihir Patel <patelmi@microsoft.com>
prgeor
approved these changes
Jun 15, 2023
Contributor
Author
|
@yxieca - It will be great if you can help in merging this to 202205 ADO - 24097260 |
yxieca
pushed a commit
that referenced
this pull request
Jun 15, 2023
…vents (#2822) Signed-off-by: Mihir Patel <patelmi@microsoft.com>
theasianpianist
pushed a commit
to theasianpianist/sonic-swss
that referenced
this pull request
Jul 20, 2023
…vents (sonic-net#2822) Signed-off-by: Mihir Patel <patelmi@microsoft.com>
Janetxxx
pushed a commit
to Janetxxx/sonic-swss
that referenced
this pull request
Nov 10, 2025
…vents (sonic-net#2822) Signed-off-by: Mihir Patel <patelmi@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
It seems that currently, we don't print the value of host_tx_ready in some places while setting it. We need to ensure to log the value of host_tx_ready in such cases.
Example:
sonic-swss/orchagent/portsorch.cpp
Lines 1105 to 1106 in 872b80b
Also, we should display port number instead of port_id to keep logging consistent.
https://github.com/sonic-net/sonic-swss/blob/872b80b699d25e84a352a8511cb8882792a2443c/orchagent/portsorch.cpp#LL1149C28-L1149C44
May 25 22:28:47.759325 sonic NOTICE swss#orchagent: :- doPortTask: Set port Ethernet136 admin status to up
May 25 22:28:47.759566 sonic INFO swss#orchagent: :- initHostTxReadyState: initalize hostTxReady Ethernet144 with status
May 25 22:28:47.760391 sonic INFO swss#orchagent: :- setPortAdminStatus: Set admin status UP host_tx_ready to true to port pid:1000000000015
Why I did it
This was done to improve debuggability
How I verified it
Please find the logs below captured after restarting swss, shut and no shut for a port
Jun 14 23:15:36.159567 sonic NOTICE swss#orchagent: :- setPortAdminStatus: Set admin status UP host_tx_ready to true for port Ethernet88
Jun 14 23:15:36.159754 sonic NOTICE swss#orchagent: :- initHostTxReadyState: initialize host_tx_ready as false for port Ethernet96
Jun 14 23:15:36.160567 sonic NOTICE swss#orchagent: :- setPortAdminStatus: Set admin status UP host_tx_ready to true for port Ethernet96
Jun 14 23:18:41.299182 sonic NOTICE swss#orchagent: :- setPortAdminStatus: Set admin status DOWN host_tx_ready to false for port Ethernet144
Jun 14 23:19:02.074076 sonic NOTICE swss#orchagent: :- setPortAdminStatus: Set admin status UP host_tx_ready to true for port Ethernet144
Details if related