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

Fixed xcvrd shutdown flow #23

Merged
merged 1 commit into from
Mar 26, 2019

Conversation

nazariig
Copy link
Collaborator

@nazariig nazariig commented Feb 22, 2019

Signed-off-by: Nazarii Hnydyn nazariig@mellanox.com

xcvrd shutdown flow is broken due to a platform_sfputil.get_transceiver_change_event() blocking call which uses epoll_wait. This function affects process signal mask and signal handlers are not getting called.

- What I did

  • Fixed xcvrd shutdown flow
  • Refactored xcvrd code base
  • Aligned psud chassis key name with Spec
  • Aligned psud with daemon base
  • Refactored psud code base
  • Aligned ledd with daemon base
  • Refactored ledd code base

- How I did it

  • Changed daemon architecture in order to use signal handlers properly
  • Moved platform_sfputil.get_transceiver_change_event() blocking call to a separate process

- How to verify it

  1. make configure PLATFORM=mellanox
  2. make target/sonic-mellanox.bin
  3. service pmon stop
  4. service pmon start

- Description for the changelog

  • N/A

@nazariig nazariig changed the title Fixed xcvrd shutdown flow. Fixed xcvrd shutdown flow Feb 22, 2019
sonic-xcvrd/scripts/xcvrd Outdated Show resolved Hide resolved
# del sfp and dom info from db
def del_port_sfp_dom_info_to_db(logical_port_name, int_tbl, dom_tbl):
# update port dom/sfp info in db
def post_port_sfp_dom_info_to_db():
Copy link
Collaborator

@keboliu keboliu Feb 25, 2019

Choose a reason for hiding this comment

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

rename to "del_port_sfp_dom_info_from_db"?

Copy link
Collaborator Author

@nazariig nazariig Feb 27, 2019

Choose a reason for hiding this comment

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

@keboliu please have a look at line 328:

# delete port dom/sfp info from db
def del_port_sfp_dom_info_from_db(logical_port_name, int_tbl, dom_tbl):

sonic-xcvrd/scripts/xcvrd Outdated Show resolved Hide resolved
dom_info_update = dom_info_update_task(dom_tbl)
dom_info_update.task_run()
while RUN:
time.sleep(TIMEOUT_SECS)
Copy link
Collaborator

Choose a reason for hiding this comment

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

main task is idling, original design using the main task to listen to the sfp change event, can we reduce one thread here? have you compared the time consuming of xvrd before and after, any significant increase?

Copy link
Collaborator Author

@nazariig nazariig Feb 27, 2019

Choose a reason for hiding this comment

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

@keboliu before changes on stop ~10 sec, after changes ~1 sec.

The idea is to use main daemon process to:

  1. Do init
  2. Handle signals
  3. Manage tasks
  4. Do deinit

This is a different architecture approach.

@jleveque
Copy link
Contributor

jleveque commented Mar 6, 2019

Please fix new conflicts.

@nazariig
Copy link
Collaborator Author

nazariig commented Mar 7, 2019

@jleveque will do.

@nazariig nazariig force-pushed the master-improve-xcvrd-shutdown branch from fd1e078 to aee8250 Compare March 15, 2019 13:31
@nazariig
Copy link
Collaborator Author

nazariig commented Mar 15, 2019

@nazariig
Copy link
Collaborator Author

@jleveque done.

Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
@nazariig
Copy link
Collaborator Author

@andriymoroz-mlnx please help to review and merge.

@jleveque jleveque merged commit c8931f3 into sonic-net:master Mar 26, 2019
vdahiya12 pushed a commit to vdahiya12/sonic-platform-daemons that referenced this pull request Apr 4, 2022
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