Skip to content

Add sonic-ledd (Front-panel LED control daemon)#5

Merged
jleveque merged 3 commits intosonic-net:masterfrom
jleveque:add_ledd
Jun 9, 2017
Merged

Add sonic-ledd (Front-panel LED control daemon)#5
jleveque merged 3 commits intosonic-net:masterfrom
jleveque:add_ledd

Conversation

@jleveque
Copy link
Copy Markdown
Contributor

@jleveque jleveque commented Jun 6, 2017

  • Also add README.md

@jleveque jleveque self-assigned this Jun 6, 2017
@jleveque jleveque requested a review from lguohan June 6, 2017 23:04
@msftclas
Copy link
Copy Markdown

msftclas commented Jun 6, 2017

@jleveque,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

port_status_dict[key] = status
led_control.port_link_state_change(key, status)

time.sleep(0.25)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

time.sleep(0.25) [](start = 8, length = 16)

by default sleep 1 second.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved.

continue

port_status_dict[port_name] = 'down'
led_control.port_link_state_change(port_name, port_status_dict[port_name])
Copy link
Copy Markdown
Contributor

@lguohan lguohan Jun 8, 2017

Choose a reason for hiding this comment

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

one problem is that you only get the port_table once, it may not be a complete list. ideally, we should subscribe the port_name table changes and adding new ports into the list.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

temporarily, we can include get port in the while loop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved.

@jleveque jleveque merged commit bd7c310 into sonic-net:master Jun 9, 2017
@jleveque jleveque deleted the add_ledd branch June 9, 2017 17:41
@jleveque jleveque added the ledd label Jul 10, 2020
vdahiya12 pushed a commit to vdahiya12/sonic-platform-daemons that referenced this pull request Apr 4, 2022
mssonicbld added a commit to mssonicbld/sonic-platform-daemons that referenced this pull request Jul 9, 2025
…tach sonic-net#5

<!-- Provide a general summary of your changes in the Title above -->

#### Description
<!--
     Describe your changes in detail
-->
Two changes are being done in this PR:
Remove deletion of the `PCIE_DETACH_INFO` from the pcied (This should be handled by the power off/power on of the DPU from the module_base implementation)
The returned value from `self.detach_info.get(key)` in pcied is of the form tuple:
`(True, [('bus_info', '0000:03:00.1'), ('dpu_state', 'detaching')])` This has to be handled correctly by the pcied (which was expecting a dictionary

#### Motivation and Context
<!--
     Why is this change required? What problem does it solve?
     If this pull request closes/resolves an open Issue, make sure you
     include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here
-->
This is required since the pcied should not delete the entries from the `PCIE_DETACH_INFO` table as opposed to the module_base implementation

#### How Has This Been Tested?
<!--
     Please describe in detail how you tested your changes.
     Include details of your testing environment, and the tests you ran to
     see how your change affects other areas of the code, etc.
-->
Unit tests:
```
tests/test_DaemonPcied.py::TestDaemonPcied::test_signal_handler PASSED   [  7%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_run PASSED              [ 14%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_del PASSED              [ 21%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_del_exception PASSED    [ 28%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_is_dpu_in_detaching_mode PASSED [ 35%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_check_pcie_devices PASSED [ 42%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_check_pcie_devices_update_aer PASSED [ 50%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_check_pcie_devices_detaching PASSED [ 57%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_update_pcie_devices_status_db PASSED [ 64%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_check_n_update_pcie_aer_stats PASSED [ 71%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_update_aer_to_statedb PASSED [ 78%]
tests/test_pcied.py::test_main PASSED                                    [ 85%]
tests/test_pcied.py::test_read_id_file PASSED                            [ 92%]
tests/test_pcied.py::test_load_platform_pcieutil PASSED                  [100%]
```
Also tested manually on smart switch system,
Restarted pcied (`supervisorctl restart pcied` in pmon docker) and checked that the detach info table is not deleted)
Checked the logs to confirm that pcied is not crashing due to the additional change for processing of detach table
#### Additional Information (Optional)
mssonicbld added a commit that referenced this pull request Jul 9, 2025
…tach #5 (#641)

<!-- Provide a general summary of your changes in the Title above -->

#### Description
<!--
 Describe your changes in detail
-->
Two changes are being done in this PR:
Remove deletion of the `PCIE_DETACH_INFO` from the pcied (This should be handled by the power off/power on of the DPU from the module_base implementation)
The returned value from `self.detach_info.get(key)` in pcied is of the form tuple:
`(True, [('bus_info', '0000:03:00.1'), ('dpu_state', 'detaching')])` This has to be handled correctly by the pcied (which was expecting a dictionary

#### Motivation and Context
<!--
 Why is this change required? What problem does it solve?
 If this pull request closes/resolves an open Issue, make sure you
 include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here
-->
This is required since the pcied should not delete the entries from the `PCIE_DETACH_INFO` table as opposed to the module_base implementation

#### How Has This Been Tested?
<!--
 Please describe in detail how you tested your changes.
 Include details of your testing environment, and the tests you ran to
 see how your change affects other areas of the code, etc.
-->
Unit tests:
```
tests/test_DaemonPcied.py::TestDaemonPcied::test_signal_handler PASSED [ 7%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_run PASSED [ 14%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_del PASSED [ 21%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_del_exception PASSED [ 28%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_is_dpu_in_detaching_mode PASSED [ 35%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_check_pcie_devices PASSED [ 42%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_check_pcie_devices_update_aer PASSED [ 50%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_check_pcie_devices_detaching PASSED [ 57%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_update_pcie_devices_status_db PASSED [ 64%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_check_n_update_pcie_aer_stats PASSED [ 71%]
tests/test_DaemonPcied.py::TestDaemonPcied::test_update_aer_to_statedb PASSED [ 78%]
tests/test_pcied.py::test_main PASSED [ 85%]
tests/test_pcied.py::test_read_id_file PASSED [ 92%]
tests/test_pcied.py::test_load_platform_pcieutil PASSED [100%]
```
Also tested manually on smart switch system,
Restarted pcied (`supervisorctl restart pcied` in pmon docker) and checked that the detach info table is not deleted)
Checked the logs to confirm that pcied is not crashing due to the additional change for processing of detach table
#### Additional Information (Optional)
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