Skip to content

[Xcvrd]: Fix optics insertion/removal not detected #333

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

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

prgeor
Copy link
Collaborator

@prgeor prgeor commented Jan 17, 2023

Description

Fixed optics insertion/removal not detected by Xcvrd.

The key to port_mapping.get_physical_to_logical() expects integer. Otherwise, on OIR events, Xcvrd throws the below error and misses processing of OIR events

/var/log/syslog.169.gz:Nov 29 19:21:47.275665 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[42]: Got unknown FP port index 29, ignored
/var/log/syslog.169.gz:Nov 29 19:21:52.309169 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[42]: Got unknown FP port index 30, ignored
/var/log/syslog.180.gz:Nov 29 16:30:14.687024 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 11, ignored
/var/log/syslog.180.gz:Nov 29 16:30:24.780574 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 16, ignored
/var/log/syslog.180.gz:Nov 29 16:30:31.850078 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 13, ignored
/var/log/syslog.180.gz:Nov 29 16:30:37.907455 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 10, ignored
/var/log/syslog.180.gz:Nov 29 16:30:55.108639 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 12, ignored
/var/log/syslog.180.gz:Nov 29 16:31:10.284906 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 15, ignored
/var/log/syslog.180.gz:Nov 29 16:31:21.406967 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 14, ignored
/var/log/syslog.180.gz:Nov 29 16:31:27.451387 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 9, ignored
/var/log/syslog.180.gz:Nov 29 16:34:53.750040 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 22, ignored
/var/log/syslog.180.gz:Nov 29 16:35:14.988818 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 23, ignored
/var/log/syslog.180.gz:Nov 29 16:35:26.113949 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 21, ignored
/var/log/syslog.180.gz:Nov 29 16:35:40.273945 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 17, ignored
/var/log/syslog.180.gz:Nov 29 16:36:26.836894 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 19, ignored
/var/log/syslog.180.gz:Nov 29 16:36:44.042048 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 20, ignored
/var/log/syslog.180.gz:Nov 29 16:36:57.170354 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 18, ignored
/var/log/syslog.180.gz:Nov 29 16:37:04.239963 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 24, ignored
/var/log/syslog.181.gz:Nov 29 16:26:31.566368 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 1, ignored
/var/log/syslog.181.gz:Nov 29 16:26:56.867366 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 6, ignored
/var/log/syslog.181.gz:Nov 29 16:27:02.911397 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 3, ignored
/var/log/syslog.181.gz:Nov 29 16:27:07.953958 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 8, ignored
/var/log/syslog.181.gz:Nov 29 16:27:18.060718 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 5, ignored
/var/log/syslog.181.gz:Nov 29 16:27:28.164588 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 2, ignored
/var/log/syslog.181.gz:Nov 29 16:27:37.260823 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 4, ignored
/var/log/syslog.181.gz:Nov 29 16:27:44.331360 3POs-7050CX-T1-H06-39 WARNING pmon#xcvrd[43]: Got unknown FP port index 7, ignored

Motivation and Context

"show interface transceiver presence" did not reflect the actual presence/absence of the transceiver.

How Has This Been Tested?

Physically removed and inserted optics on Arista 7050CX and ensured the optics is shown in:-

  1. show interfaces status
  2. sfputil show presence
  3. show interface transceiver presence

Additional Information (Optional)

mihirpat1
mihirpat1 previously approved these changes Jan 18, 2023
@keboliu
Copy link
Collaborator

keboliu commented Jan 18, 2023

If I remember correctly the default log level of PMON daemons is Notice, Info level log won't be printed, shall we change the default log level of the daemons or raise the Info log level to Notice?

Copy link
Contributor

@Staphylo Staphylo left a comment

Choose a reason for hiding this comment

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

Looks good to me.
I'll let @mihirpat1 approve this PR since he has a comment opened.
Edit: Actually I saw that he approved as well

Staphylo
Staphylo previously approved these changes Jan 18, 2023
@prgeor prgeor dismissed stale reviews from Staphylo and mihirpat1 via 0caa84e January 19, 2023 01:35
@prgeor
Copy link
Collaborator Author

prgeor commented Jan 19, 2023

If I remember correctly the default log level of PMON daemons is Notice, Info level log won't be printed, shall we change the default log level of the daemons or raise the Info log level to Notice?

yes added log_notice() in latest commit

@prgeor prgeor merged commit a931d6c into sonic-net:master Jan 19, 2023
@prgeor
Copy link
Collaborator Author

prgeor commented Jan 19, 2023

@yxieca please cherry-pick to 202205

@prgeor
Copy link
Collaborator Author

prgeor commented Jan 19, 2023

@StormLiangMS please cherry-pick to 202211

yxieca pushed a commit that referenced this pull request Jan 19, 2023
* [Xcvrd]: Fix optics insertion/removal not detected

* log_info() -> log_notice()
StormLiangMS pushed a commit that referenced this pull request Feb 4, 2023
* [Xcvrd]: Fix optics insertion/removal not detected

* log_info() -> log_notice()
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