Skip to content

[portsorch]: Enhancing SWSS OA logs to capture host_tx_ready change events#2822

Merged
mihirpat1 merged 1 commit intosonic-net:masterfrom
mihirpat1:orch_host_tx_ready_logging
Jun 15, 2023
Merged

[portsorch]: Enhancing SWSS OA logs to capture host_tx_ready change events#2822
mihirpat1 merged 1 commit intosonic-net:masterfrom
mihirpat1:orch_host_tx_ready_logging

Conversation

@mihirpat1
Copy link
Copy Markdown
Contributor

@mihirpat1 mihirpat1 commented Jun 14, 2023

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:

SWSS_LOG_INFO("initalize hostTxReady %s with status %s",
port.m_alias.c_str(), hostTxReady.c_str());

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

…vents

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
@mihirpat1 mihirpat1 merged commit 87e0b08 into sonic-net:master Jun 15, 2023
@mihirpat1
Copy link
Copy Markdown
Contributor Author

@yxieca - It will be great if you can help in merging this to 202205
@StormLiangMS - It will be great if you can help in merging this to 202211

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>
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.

3 participants