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

How to edit led linkscan callback? #1543

Closed
appleCh opened this issue Mar 29, 2018 · 6 comments
Closed

How to edit led linkscan callback? #1543

appleCh opened this issue Mar 29, 2018 · 6 comments
Assignees

Comments

@appleCh
Copy link

appleCh commented Mar 29, 2018

If we want to edit led linkscan callback,
Are the following steps right?

  1. edit opennsl-odp source code ledproc_linkxxxx_cb().
  2. Follow https://github.com/Azure/SONiC/wiki/Build-Broadcom-Opennsl-and-SAI to rebuild opennsl and SAI.
  3. revise led_proc_init.soc
@pollyhsu2git
Copy link
Contributor

pollyhsu2git commented Mar 29, 2018

@appleCh,
We might need to remind you that as far as we know that your posted OPENNSL code segment should be Broadcom NDA protected, instead of opening it here~

@appleCh
Copy link
Author

appleCh commented Mar 29, 2018

@pollyhsu2git
Thank you for your reminding XDDD

@lguohan
Copy link
Collaborator

lguohan commented Mar 29, 2018

what API do you need? We need to introduce equivalent SAI callback API.

SAMPLE notification can be found at

https://github.com/opencomputeproject/SAI/blob/4c6e20bee2a3e2d1cc09157d64dd7ac552ff0c13/inc/saifdb.h

@appleCh
Copy link
Author

appleCh commented Mar 29, 2018

Sorry i am not describe my purpose.
We want to modify because sometimes led linkscan callback can not meets our requirement.

For example,
Our hw design port up at 100G with white coler, 50G Amber, and 40G Blue,
and we hope a led prog can process all speed.
So, if cb only trun on 0x01 indicate LINKUP, we can not know the port up with what speed.

@serhepopovych
Copy link
Contributor

You definitely need to implement your own led_control.py class.

@jleveque
Copy link
Contributor

jleveque commented Jul 3, 2019

HI @appleCh. Please close this issue if it is resolved.

@appleCh appleCh closed this as completed Jul 4, 2019
allas-nvidia added a commit to allas-nvidia/sonic-buildimage that referenced this issue Apr 6, 2021
27ad705  Update PR 1310 with change of the function _checkNoPortsInAsicDb to checkNoPortsInAsicDb
55c64f2  [config/main.py]: Filter table from input config while config validation\DPB.
1993087  [config_mgmt.py]: Verify port status down in APPL DB.
69a5077  Replace call with mock.call
cf52272  interface_name_is_valid add arg config_db
0834863  [config/main.py]: Use click.abort() and fix test case by deepcopy().
7c76602  Fix _shutdownIntf to check correct call
bbf05e1  [tests/config_mgmt_test.py]: Minor changes to fix tests.
5e69412  Tests for shutdown intf
2352650  [config_mgmt.py]: Shutdown the interfaces after config validation. (sonic-net#28)
9bbc25f  [config] Eliminate race condition between reloading Monit config and (sonic-net#1543)
87b2481  Reduce time taken by show commands on multi-asic platforms (sonic-net#1544)
12fc01e  [reboot] No need enable the Linux magic system request key (sonic-net#1538)
e0f678a  [setup.py]: move the module to test requirement (sonic-net#1542)
d55d406  [acl_loader]: add iptype match to the rules for dataplane acl
37376dd  [ci]: download latest docker-sonic-vs from sonic-swss repo
e9cfb32  [fast-reboot] Fix dump script to support PortChannels in a VLAN group (sonic-net#1393)

Signed-off-by: allas <allas@nvidia.com>
yxieca added a commit to yxieca/sonic-buildimage that referenced this issue Apr 8, 2021
SWSS:
* d97c7c7 2021-04-07 | [Dynamic Buffer Calc] Enhancement: coding style and LGTM alerts (sonic-net#1693) (HEAD -> 202012) [Stephen Sun]
* f70b3da 2021-04-03 | [Makefile] Reorder libsaimetadata and libswsscommon (sonic-net#1689) [Kamil Cudnik]
* 72ae85d 2021-04-08 | [vlan] Add support of VLAN host interface (sonic-net#1645) [Volodymyr Samotiy]
* a555b9c 2021-04-02 | Correct the sflow default sample rate (sonic-net#1623) [fredyu190011]

Utilities:
* 1a789d2 2021-04-07 | Fixed the possibility of using uninitialized variable in route_check.py (sonic-net#1551) (HEAD -> 202012) [Renuka Manavalan]
* 2412e3c 2021-04-06 | Fix fast-reboot-dump.py SonicV2Connector after late merge (sonic-net#1546) [shlomibitton]
* f99c5f1 2021-04-02 | [fast-reboot] Fix dump script to support PortChannels in a VLAN group (sonic-net#1393) [shlomibitton]
* 716e2af 2021-04-04 | Reduce time taken by show commands on multi-asic platforms (sonic-net#1544) [abdosi]
* a160519 2021-04-03 | [setup.py]: move the module to test requirement (sonic-net#1542) [lguohan]
* eaa67fe 2021-04-04 | [config] Eliminate race condition between reloading Monit config and (sonic-net#1543) [yozhao101]
* 2497a9e 2021-04-03 | [reboot] No need enable the Linux magic system request key (sonic-net#1538) [yozhao101]
* 9fda6fe 2021-04-06 | [fwutil]: Fix next image mount (sonic-net#1533) [Nazarii Hnydyn]
* 9af50fe 2021-02-09 | Import 'mock' module from 'unittest' library (sonic-net#1415) (HEAD -> 202012) [Joe LeVeque]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
yxieca added a commit that referenced this issue Apr 9, 2021
SWSS:
* d97c7c7 2021-04-07 | [Dynamic Buffer Calc] Enhancement: coding style and LGTM alerts (#1693) (HEAD -> 202012) [Stephen Sun]
* f70b3da 2021-04-03 | [Makefile] Reorder libsaimetadata and libswsscommon (#1689) [Kamil Cudnik]
* 72ae85d 2021-04-08 | [vlan] Add support of VLAN host interface (#1645) [Volodymyr Samotiy]
* a555b9c 2021-04-02 | Correct the sflow default sample rate (#1623) [fredyu190011]

Utilities:
* 1a789d2 2021-04-07 | Fixed the possibility of using uninitialized variable in route_check.py (#1551) (HEAD -> 202012) [Renuka Manavalan]
* 2412e3c 2021-04-06 | Fix fast-reboot-dump.py SonicV2Connector after late merge (#1546) [shlomibitton]
* f99c5f1 2021-04-02 | [fast-reboot] Fix dump script to support PortChannels in a VLAN group (#1393) [shlomibitton]
* 716e2af 2021-04-04 | Reduce time taken by show commands on multi-asic platforms (#1544) [abdosi]
* a160519 2021-04-03 | [setup.py]: move the module to test requirement (#1542) [lguohan]
* eaa67fe 2021-04-04 | [config] Eliminate race condition between reloading Monit config and (#1543) [yozhao101]
* 2497a9e 2021-04-03 | [reboot] No need enable the Linux magic system request key (#1538) [yozhao101]
* 9fda6fe 2021-04-06 | [fwutil]: Fix next image mount (#1533) [Nazarii Hnydyn]
* 9af50fe 2021-02-09 | Import 'mock' module from 'unittest' library (#1415) (HEAD -> 202012) [Joe LeVeque]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
stepanblyschak pushed a commit to stepanblyschak/sonic-buildimage that referenced this issue May 10, 2021
…onic-net#1543)

Signed-off-by: Yong Zhao yozhao@microsoft.com

What I did
Nightly test found a failure when we ran the command sudo config reload/load_minigraph, The error message is:

admin@str-a7050-acs-1:~$ sudo config reload -y
Disabling container monitoring ...
Stopping SONiC target ...
Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --write-to-db
Running command: /usr/local/bin/db_migrator.py -o migrate
Resetting failed status on bgp.service
Resetting failed status on caclmgrd.service
Resetting failed status on dhcp_relay.service
Resetting failed status on hostcfgd.service
Resetting failed status on hostname-config.service
Resetting failed status on interfaces-config.service
Resetting failed status on lldp.service
Resetting failed status on ntp-config.service
Resetting failed status on pmon.service
Resetting failed status on procdockerstatsd.service
Resetting failed status on radv.service
Resetting failed status on rsyslog-config.service
Resetting failed status on swss.service
Resetting failed status on syncd.service
Resetting failed status on teamd.service
Resetting failed status on telemetry.timer
Restarting SONiC target ...
Reloading Monit configuration ...
Reinitializing monit daemon
Enabling container monitoring ...
Unix socket /var/run/monit.sock connection error -- No such file or directory
The root reason is that there exists an implicit race condition between the command sudo monit reload at line 701 and
the command sudo monit monitor container_checker at line 706. Both commands need access the monit.sock socket file
under the directory /var/run/.

Specifically the sudo monit reload at line 701 will re-initialize the Monit daemon, delete old monit.sock file and then create a new one. During this re-initializing process, the command sudo monit status can always execute successfully at line 704 before the old monit.sock file was deleted, but the command sudo monit monitor container_checker at line 706 will only succeed if the new monit.sock was created, otherwise it will fail and raise this error message.

How I did it
I changed the sequence between the operation to reload Monit configuration and the operation to enable monitoring container_checker.

How to verify it
I verified this change on DuT str-a7050-acs-1 by running the command sudo config reload/load_minigraph -y to make sure the error was not raised again.

Previous command output (if the output of a command-line utility has changed)
admin@str-a7050-acs-1:~$ sudo config reload -y
Disabling container monitoring ...
Stopping SONiC target ...
Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --write-to-db
Running command: /usr/local/bin/db_migrator.py -o migrate
Resetting failed status on bgp.service
Resetting failed status on caclmgrd.service
Resetting failed status on dhcp_relay.service
Resetting failed status on hostcfgd.service
Resetting failed status on hostname-config.service
Resetting failed status on interfaces-config.service
Resetting failed status on lldp.service
Resetting failed status on ntp-config.service
Resetting failed status on pmon.service
Resetting failed status on procdockerstatsd.service
Resetting failed status on radv.service
Resetting failed status on rsyslog-config.service
Resetting failed status on swss.service
Resetting failed status on syncd.service
Resetting failed status on teamd.service
Resetting failed status on telemetry.timer
Restarting SONiC target ...
Reloading Monit configuration ...
Reinitializing monit daemon
Enabling container monitoring ...
New command output (if the output of a command-line utility has changed)
admin@str-a7050-acs-1:~$ sudo config reload -y
Disabling container monitoring ...
Stopping SONiC target ...
Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --write-to-db
Running command: /usr/local/bin/db_migrator.py -o migrate
Resetting failed status on bgp.service
Resetting failed status on caclmgrd.service
Resetting failed status on dhcp_relay.service
Resetting failed status on hostcfgd.service
Resetting failed status on hostname-config.service
Resetting failed status on interfaces-config.service
Resetting failed status on lldp.service
Resetting failed status on ntp-config.service
Resetting failed status on pmon.service
Resetting failed status on procdockerstatsd.service
Resetting failed status on radv.service
Resetting failed status on rsyslog-config.service
Resetting failed status on swss.service
Resetting failed status on syncd.service
Resetting failed status on teamd.service
Resetting failed status on telemetry.timer
Restarting SONiC target ...
Enabling container monitoring ...
Reloading Monit configuration ...
Reinitializing monit daemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants