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

Suppress Cable length errors in case pg profile lookup file is not provided #509

Merged
merged 2 commits into from
May 25, 2018

Conversation

zhenggen-xu
Copy link
Collaborator

What I did
Suppress the error messages like below
May 19 07:39:02.473125 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet0. Cable length is not set
If we don't have pg_profile_lookup.ini file provided.

Why I did it
In some platform, pg_profile_lookup.ini is not provided and we don't need this buffer management feature.

Today the code is repeating these messages:
May 19 07:39:02.473125 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet0. Cable length is not set
May 19 07:39:02.473362 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet1. Cable length is not set
May 19 07:39:02.473558 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet10. Cable length is not set
May 19 07:39:02.473717 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet100. Cable length is not set
May 19 07:39:02.473872 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet102. Cable length is not set
May 19 07:39:02.474061 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet104. Cable length is not set
May 19 07:39:02.474248 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet106. Cable length is not set
May 19 07:39:02.474404 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet108. Cable length is not set
May 19 07:39:02.474557 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet11. Cable length is not set
May 19 07:39:02.474710 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet110. Cable length is not set
May 19 07:39:02.474864 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet112. Cable length is not set
May 19 07:39:02.475018 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet114. Cable length is not set
May 19 07:39:02.475171 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet116. Cable length is not set
May 19 07:39:02.475325 sonic NOTICE buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet118. Cable length is not set
We should disable this error messages.

How I verified it
With the fix, no error messages were seen.

Details if related

@zhenggen-xu zhenggen-xu changed the title Suppress Cable length error in case buffer config file is not provided Suppress Cable length error in case pg profile lookup file is not provided May 21, 2018
@zhenggen-xu zhenggen-xu changed the title Suppress Cable length error in case pg profile lookup file is not provided Suppress Cable length errors in case pg profile lookup file is not provided May 21, 2018
@zhenggen-xu zhenggen-xu changed the title Suppress Cable length errors in case pg profile lookup file is not provided Suppress Cable length errors in case pg profile lookup file is not provided May 21, 2018
@@ -34,6 +34,7 @@ void BufferMgr::readPgProfileLookupFile(string file)
ifstream infile(file);
if (!infile.is_open())
{
m_pgfile_exist = false;
return;
Copy link
Contributor

@qiluo-msft qiluo-msft May 21, 2018

Choose a reason for hiding this comment

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

Should we log an error here?
SWSS_LOG_ERROR #Closed

Copy link
Collaborator Author

@zhenggen-xu zhenggen-xu May 21, 2018

Choose a reason for hiding this comment

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

It is not necessarily an error if we don't need this feature. I can put an NOTICE or WARNING log message here. #Closed

Copy link
Contributor

Choose a reason for hiding this comment

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

If you are sure the feature is optional, then a WARNING should be ok.


In reply to: 189676820 [](ancestors = 189676820)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@@ -34,6 +34,7 @@ void BufferMgr::readPgProfileLookupFile(string file)
ifstream infile(file);
if (!infile.is_open())
{
m_pgfile_exist = false;
Copy link
Contributor

@qiluo-msft qiluo-msft May 21, 2018

Choose a reason for hiding this comment

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

m_pgfile_exist [](start = 8, length = 14)

m_pgfile_exist [](start = 8, length = 14)

m_pgfile_readable #Closed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@@ -34,6 +34,7 @@ void BufferMgr::readPgProfileLookupFile(string file)
ifstream infile(file);
if (!infile.is_open())
{
m_pgfile_exist = false;
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

assign m_pgfile_exist true here, and you could remove class member initialization in header file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Either way should do the work, any reason you prefer to put here rather than in the header file?

Copy link
Contributor

Choose a reason for hiding this comment

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

For better readability.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't see any confusion with the initialization in header file. it is easily readable so I kept the code here.

@lguohan
Copy link
Contributor

lguohan commented May 23, 2018

@yxieca , @volodymyrsamotiy , can you review?

@@ -34,6 +34,8 @@ void BufferMgr::readPgProfileLookupFile(string file)
ifstream infile(file);
if (!infile.is_open())
{
m_pgfile_readable = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think m_pgfile_processed a more suitable name for this variable? I would think setting it to false by default, and flip it to true once the file processing is done will serve your purpose better?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The purpose was to check whether the "pg-lookup-file" was there or not, if not, we don't do the buffer settings. It renamed to cover the case where the file somehow not readable.
By looking at the code, there wasn't any exist after this "is_open" check and before the entire function. This means if we had m_pgfile_processed defined, we would have always set it to true after this check. I,E, there was no difference between the current approach and if we had a new naming.
Anyway, I changed it so everybody is happy.

@@ -34,6 +34,8 @@ void BufferMgr::readPgProfileLookupFile(string file)
ifstream infile(file);
if (!infile.is_open())
{
m_pgfile_processed = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for making the changes.

You can move the above line to the beginning of the function.

@yxieca yxieca merged commit 44a8845 into sonic-net:master May 25, 2018
@vemulabalaji
Copy link

Hi,

I am still observing these messages, Let me know if have to do any configuration/something.

Regards,
Balaji

root@sonic:/# show version
SONiC Software Version: SONiC.HEAD.0-bbca583
Distribution: Debian 8.11
Kernel: 3.16.0-5-amd64
Build commit: bbca583
Build date: Wed Jul 4 15:37:15 UTC 2018
Built by: azure@sfsun001

Docker images:
REPOSITORY TAG IMAGE ID SIZE
docker-orchagent-mlnx HEAD.0-bbca583 c3275235b6b6 258.3 MB
docker-orchagent-mlnx latest c3275235b6b6 258.3 MB
docker-teamd HEAD.0-bbca583 558b8a37fd85 258 MB
docker-teamd latest 558b8a37fd85 258 MB
docker-fpm-quagga HEAD.0-bbca583 b15190ec5263 264.8 MB
docker-fpm-quagga latest b15190ec5263 264.8 MB
docker-syncd-mlnx HEAD.0-bbca583 66509e04458e 325.4 MB
docker-syncd-mlnx latest 66509e04458e 325.4 MB
docker-lldp-sv2 HEAD.0-bbca583 da67539a03e0 270.4 MB
docker-lldp-sv2 latest da67539a03e0 270.4 MB
docker-dhcp-relay HEAD.0-bbca583 a070d0601683 253.8 MB
docker-dhcp-relay latest a070d0601683 253.8 MB
docker-database HEAD.0-bbca583 bd7241b8a33c 252.5 MB
docker-database latest bd7241b8a33c 252.5 MB
docker-snmp-sv2 HEAD.0-bbca583 735c4d81fd69 291.4 MB
docker-snmp-sv2 latest 735c4d81fd69 291.4 MB
docker-router-advertiser HEAD.0-bbca583 7f5e7a85cbd7 250.1 MB
docker-router-advertiser latest 7f5e7a85cbd7 250.1 MB
docker-platform-monitor HEAD.0-bbca583 07af655cb03f 281.3 MB
docker-platform-monitor latest 07af655cb03f 281.3 MB

root@sonic:/#
root@sonic:/#

Sep 10 12:43:02.267414 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet104. Cable length is not set
Sep 10 12:43:02.267445 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet108. Cable length is not set
Sep 10 12:43:02.267445 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet112. Cable length is not set
Sep 10 12:43:02.267471 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet116. Cable length is not set
Sep 10 12:43:02.267471 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet12. Cable length is not set
Sep 10 12:43:02.267471 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet120. Cable length is not set
Sep 10 12:43:02.267471 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet124. Cable length is not set
Sep 10 12:43:02.267484 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet128. Cable length is not set
Sep 10 12:43:02.267493 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet132. Cable length is not set
Sep 10 12:43:02.267493 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet136. Cable length is not set
Sep 10 12:43:02.267694 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet140. Cable length is not set
Sep 10 12:43:02.267694 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet144. Cable length is not set
Sep 10 12:43:02.267694 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet148. Cable length is not set
Sep 10 12:43:02.267720 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet152. Cable length is not set
Sep 10 12:43:02.267821 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet156. Cable length is not set
Sep 10 12:43:02.267821 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet16. Cable length is not set
Sep 10 12:43:02.267834 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet160. Cable length is not set
Sep 10 12:43:02.267967 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet164. Cable length is not set
Sep 10 12:43:02.267967 sonic WARNING buffermgrd: :- doSpeedUpdateTask: Unable to create/update PG profile for port Ethernet168. Cable length is not set

@vemulabalaji
Copy link

Hi,

I am still observing these messages, Let me know if have to do any configuration/something.

Regards,
Balaji

root@sonic:/var/log# show version
SONiC Software Version: SONiC.HEAD.755-b1d290c
Distribution: Debian 9.5
Kernel: 4.9.0-7-amd64
Build commit: b1d290c
Build date: Sun Oct 7 12:32:03 UTC 2018
Built by: johnar@jenkins-worker-3

Docker images:
REPOSITORY TAG IMAGE ID SIZE
docker-orchagent-mlnx HEAD.755-b1d290c 16c4be574fc4 259.7 MB
docker-orchagent-mlnx latest 16c4be574fc4 259.7 MB
docker-syncd-mlnx HEAD.755-b1d290c 2bb04eebbb04 359.8 MB
docker-syncd-mlnx latest 2bb04eebbb04 359.8 MB
docker-lldp-sv2 HEAD.755-b1d290c 2761515e74da 271.1 MB
docker-lldp-sv2 latest 2761515e74da 271.1 MB
docker-dhcp-relay HEAD.755-b1d290c 38ae3c8d2e3e 253.8 MB
docker-dhcp-relay latest 38ae3c8d2e3e 253.8 MB
docker-database HEAD.755-b1d290c 6bcecf4adf8e 252.5 MB
docker-database latest 6bcecf4adf8e 252.5 MB
docker-teamd HEAD.755-b1d290c ba4fa8a65c17 257.7 MB
docker-teamd latest ba4fa8a65c17 257.7 MB
docker-snmp-sv2 HEAD.755-b1d290c 5e689fcca03a 291.3 MB
docker-snmp-sv2 latest 5e689fcca03a 291.3 MB
docker-router-advertiser HEAD.755-b1d290c a6f84225b7b2 250.1 MB
docker-router-advertiser latest a6f84225b7b2 250.1 MB
docker-platform-monitor HEAD.755-b1d290c 48d8a5624d0a 283.5 MB
docker-platform-monitor latest 48d8a5624d0a 283.5 MB
docker-fpm-quagga HEAD.755-b1d290c eab298bf660c 264.6 MB
docker-fpm-quagga latest eab298bf660c 264.6 MB

@zhenggen-xu zhenggen-xu deleted the github-fork branch October 7, 2019 16:42
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
* Provide generic stat api to switch object
* Add generic api to tam_int
* Provide vs generic stat api to vs switch
* Add vs generic api to vs tam_int

Signed-off-by: Wenda Ni <wenni@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.

6 participants