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

Platform daemon changes for multi asic platform #64

Merged
merged 9 commits into from
Aug 25, 2020

Conversation

judyjoseph
Copy link
Contributor

@judyjoseph judyjoseph commented Jul 9, 2020

The changes done here are for supporting ledd and xcvr for multi-asic platforms
(i) In the ledd process, select now looks for events from the APP_DB in different namespaces.
(ii) In the xcvr process, the parent process and the sub processes connect to databases in all namespaces. The table in which namespace to be updated, is decided by the logical port ( we use the logical_port to asic_id mapping which is stored in the sfp_helper utility classes while parsing the port_config.ini files )

Related PR's

sonic-net/sonic-swss-common#364
sonic-net/sonic-buildimage#4932
sonic-net/sonic-platform-common#100

Update with test results in Single ASIC and Multi-ASIC

SINGLE ASIC

admin@str-s6000-acs-8:~$ show interface transceiver eeprom
Ethernet0: SFP EEPROM detected
        Connector: No separable connector
        Encoding: Unspecified
        Extended Identifier: Power Class 1(1.5W max)
        Extended RateSelect Compliance: QSFP+ Rate Select Version 1
        Identifier: QSFP+ or later
        Length Cable Assembly(m): 1
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: 
                10/40G Ethernet Compliance Code: 40GBASE-CR4
                Fibre Channel Speed: 1200 Mbytes/Sec
                Fibre Channel link length/Transmitter Technology: Electrical inter-enclosure (EL)
                Fibre Channel transmission media: Twin Axial Pair (TW)
        Vendor Date Code(YYYY-MM-DD Lot): 2016-05-07 
        Vendor Name: Molex Inc.
        Vendor OUI: 00-09-3a
        Vendor PN: 1110401054
        Vendor Rev: 
        Vendor SN: 612833363

Ethernet4: SFP EEPROM detected
.....
admin@str-s6000-acs-8:~$ show interface transceiver presence 
Port         Presence
-----------  ----------
Ethernet0    Present
Ethernet4    Present
Ethernet8    Present
Ethernet12   Present
Ethernet16   Present
Ethernet20   Present
Ethernet24   Present
Ethernet28   Present
Ethernet32   Present
Ethernet36   Present
Ethernet40   Present
Ethernet44   Present
Ethernet48   Present
Ethernet52   Present
Ethernet56   Present
Ethernet60   Present
Ethernet64   Present
Ethernet68   Present
Ethernet72   Present
Ethernet76   Present
Ethernet80   Present
Ethernet84   Present
Ethernet88   Present
Ethernet92   Present
Ethernet96   Present
Ethernet100  Present
Ethernet104  Present
Ethernet108  Present
Ethernet112  Present
Ethernet116  Present
Ethernet120  Present
Ethernet124  Present

admin@str-s6000-acs-8:~$ sudo config interface transceiver lpmode Ethernet84 enable
Enabling low-power mode for port Ethernet84...  OK

admin@str-s6000-acs-8:~$ sudo config interface transceiver lpmode Ethernet0 disable
Disabling low-power mode for port Ethernet0...  OK

admin@str-s6000-acs-8:~$ show interface transceiver lpmode
Port         Low-power Mode
-----------  ----------------
Ethernet0    Off
Ethernet4    Off
Ethernet8    Off
Ethernet12   Off
Ethernet16   Off
Ethernet20   Off
Ethernet24   Off
Ethernet28   Off
Ethernet32   Off
Ethernet36   Off
Ethernet40   Off
Ethernet44   Off
Ethernet48   Off
Ethernet52   Off
Ethernet56   Off
Ethernet60   Off
Ethernet64   Off
Ethernet68   Off
Ethernet72   Off
Ethernet76   Off
Ethernet80   Off
Ethernet84   On
Ethernet88   Off
Ethernet92   Off
Ethernet96   Off
Ethernet100  Off
Ethernet104  Off
Ethernet108  Off
Ethernet112  Off
Ethernet116  Off
Ethernet120  Off
Ethernet124  Off

Multi-ASIC

root@str-n3164-acs-1:/# ps -ef 
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  2 22:03 pts/0    00:00:01 /usr/bin/python2 /usr/bin/supervisord
root        15     1  0 22:03 pts/0    00:00:00 python /usr/bin/supervisor-proc-exit-listener --container-name pmon
root        19     1  0 22:03 pts/0    00:00:00 /usr/sbin/rsyslogd -n -iNONE
root        27     1  0 22:03 pts/0    00:00:00 /usr/bin/python /usr/local/bin/ledd
root        29     1 18 22:03 pts/0    00:00:08 /usr/bin/python /usr/local/bin/xcvrd
root        31     1  1 22:03 pts/0    00:00:00 /usr/bin/python /usr/local/bin/psud
root        40     1  0 22:03 ?        00:00:00 /usr/sbin/sensord -f daemon
root        79    29  0 22:04 pts/0    00:00:00 /usr/bin/python /usr/local/bin/xcvrd
root        83     0  0 22:04 pts/1    00:00:00 bash
root        92    83  0 22:04 pts/1    00:00:00 ps -ef


database0
127.0.0.1:6379[6]> keys *TRAN*
 1) "TRANSCEIVER_DOM_SENSOR|Ethernet12"
 2) "TRANSCEIVER_INFO|Ethernet12"
 3) "TRANSCEIVER_STATUS|Ethernet28"
 4) "TRANSCEIVER_INFO|Ethernet28"
 5) "TRANSCEIVER_DOM_SENSOR|Ethernet20"
 6) "TRANSCEIVER_INFO|Ethernet16"
 7) "TRANSCEIVER_INFO|Ethernet36"
 8) "TRANSCEIVER_STATUS|Ethernet32"
 9) "TRANSCEIVER_STATUS|Ethernet0"
10) "TRANSCEIVER_DOM_SENSOR|Ethernet56"
11) "TRANSCEIVER_DOM_SENSOR|Ethernet16"
12) "TRANSCEIVER_INFO|Ethernet60"
13) "TRANSCEIVER_DOM_SENSOR|Ethernet8"
14) "TRANSCEIVER_STATUS|Ethernet24"
15) "TRANSCEIVER_DOM_SENSOR|Ethernet0"
16) "TRANSCEIVER_DOM_SENSOR|Ethernet36"
17) "TRANSCEIVER_STATUS|Ethernet52"
18) "TRANSCEIVER_STATUS|Ethernet56"
19) "TRANSCEIVER_STATUS|Ethernet36"
20) "TRANSCEIVER_INFO|Ethernet48"
21) "TRANSCEIVER_INFO|Ethernet20"
22) "TRANSCEIVER_INFO|Ethernet8"
23) "TRANSCEIVER_INFO|Ethernet4"
24) "TRANSCEIVER_STATUS|Ethernet12"
25) "TRANSCEIVER_DOM_SENSOR|Ethernet48"
26) "TRANSCEIVER_INFO|Ethernet44"
27) "TRANSCEIVER_DOM_SENSOR|Ethernet32"
28) "TRANSCEIVER_STATUS|Ethernet8"
29) "TRANSCEIVER_INFO|Ethernet52"
30) "TRANSCEIVER_DOM_SENSOR|Ethernet40"
31) "TRANSCEIVER_DOM_SENSOR|Ethernet28"
32) "TRANSCEIVER_INFO|Ethernet56"
33) "TRANSCEIVER_DOM_SENSOR|Ethernet52"
34) "TRANSCEIVER_STATUS|Ethernet48"
35) "TRANSCEIVER_INFO|Ethernet24"
36) "TRANSCEIVER_DOM_SENSOR|Ethernet24"
37) "TRANSCEIVER_INFO|Ethernet32"
38) "TRANSCEIVER_DOM_SENSOR|Ethernet4"
39) "TRANSCEIVER_STATUS|Ethernet16"
40) "TRANSCEIVER_INFO|Ethernet40"
41) "TRANSCEIVER_STATUS|Ethernet20"
42) "TRANSCEIVER_INFO|Ethernet0"
43) "TRANSCEIVER_STATUS|Ethernet4"
44) "TRANSCEIVER_DOM_SENSOR|Ethernet60"
45) "TRANSCEIVER_STATUS|Ethernet60"
46) "TRANSCEIVER_STATUS|Ethernet44"
47) "TRANSCEIVER_STATUS|Ethernet40"
48) "TRANSCEIVER_DOM_SENSOR|Ethernet44"

database1

root@str--acs-1:/# redis-cli -n 6
127.0.0.1:6379[6]> keys *TRANS*
 1) "TRANSCEIVER_STATUS|Ethernet124"
 2) "TRANSCEIVER_DOM_SENSOR|Ethernet68"
 3) "TRANSCEIVER_DOM_SENSOR|Ethernet76"
 4) "TRANSCEIVER_STATUS|Ethernet112"
 5) "TRANSCEIVER_STATUS|Ethernet108"
 6) "TRANSCEIVER_DOM_SENSOR|Ethernet64"
 7) "TRANSCEIVER_DOM_SENSOR|Ethernet108"
 8) "TRANSCEIVER_DOM_SENSOR|Ethernet80"
 9) "TRANSCEIVER_STATUS|Ethernet120"
10) "TRANSCEIVER_STATUS|Ethernet88"
11) "TRANSCEIVER_DOM_SENSOR|Ethernet84"
12) "TRANSCEIVER_INFO|Ethernet72"
13) "TRANSCEIVER_INFO|Ethernet88"
14) "TRANSCEIVER_DOM_SENSOR|Ethernet72"
15) "TRANSCEIVER_STATUS|Ethernet76"
16) "TRANSCEIVER_DOM_SENSOR|Ethernet120"
17) "TRANSCEIVER_STATUS|Ethernet68"
18) "TRANSCEIVER_DOM_SENSOR|Ethernet124"
19) "TRANSCEIVER_INFO|Ethernet120"
20) "TRANSCEIVER_DOM_SENSOR|Ethernet92"
21) "TRANSCEIVER_INFO|Ethernet76"
22) "TRANSCEIVER_DOM_SENSOR|Ethernet88"
23) "TRANSCEIVER_STATUS|Ethernet72"
24) "TRANSCEIVER_INFO|Ethernet80"
25) "TRANSCEIVER_STATUS|Ethernet116"
26) "TRANSCEIVER_INFO|Ethernet108"
27) "TRANSCEIVER_DOM_SENSOR|Ethernet100"
28) "TRANSCEIVER_STATUS|Ethernet104"
29) "TRANSCEIVER_DOM_SENSOR|Ethernet112"
30) "TRANSCEIVER_STATUS|Ethernet64"
31) "TRANSCEIVER_INFO|Ethernet112"
32) "TRANSCEIVER_INFO|Ethernet92"
33) "TRANSCEIVER_INFO|Ethernet104"
34) "TRANSCEIVER_DOM_SENSOR|Ethernet104"
35) "TRANSCEIVER_INFO|Ethernet64"
36) "TRANSCEIVER_STATUS|Ethernet92"
37) "TRANSCEIVER_STATUS|Ethernet84"
38) "TRANSCEIVER_INFO|Ethernet100"
39) "TRANSCEIVER_INFO|Ethernet96"
40) "TRANSCEIVER_DOM_SENSOR|Ethernet96"
41) "TRANSCEIVER_STATUS|Ethernet80"
42) "TRANSCEIVER_INFO|Ethernet124"
43) "TRANSCEIVER_INFO|Ethernet84"
44) "TRANSCEIVER_STATUS|Ethernet96"
45) "TRANSCEIVER_STATUS|Ethernet100"
46) "TRANSCEIVER_INFO|Ethernet68"


admin@str--acs-1:~$ cat /sys/class/leds/port17:green/brightness
255
admin@str--acs-1:~$ sudo ip netns exec asic1 config interface shutdown Ethernet64 
admin@str--acs-1:~$ cat /sys/class/leds/port17:green/brightness
0
admin@str--acs-1:~$ sudo ip netns exec asic1 config interface startup  Ethernet64 
admin@str--acs-1:~$ cat /sys/class/leds/port17:green/brightness
255

@judyjoseph judyjoseph requested a review from jleveque July 10, 2020 06:44
@judyjoseph judyjoseph marked this pull request as ready for review July 10, 2020 06:44
sonic-ledd/scripts/ledd Outdated Show resolved Hide resolved
sonic-xcvrd/scripts/xcvrd Outdated Show resolved Hide resolved
sonic-xcvrd/scripts/xcvrd Outdated Show resolved Hide resolved
sonic-ledd/scripts/ledd Outdated Show resolved Hide resolved
sonic-ledd/scripts/ledd Outdated Show resolved Hide resolved
sonic-xcvrd/scripts/xcvrd Outdated Show resolved Hide resolved

# Get asic index from the namespace name
# With single ASIC platform, namespace is EMPTY_NAMESPACE, return index 0
def get_asic_id_from_namespace(namespace):
Copy link
Contributor

Choose a reason for hiding this comment

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

This function seems like a good candidate function for sonic-py-common. No?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated with PR sonic-net/sonic-buildimage#5224.

Additionally added tests results in single/multi-asic to the PR description.

sonic-xcvrd/scripts/xcvrd Outdated Show resolved Hide resolved
@judyjoseph judyjoseph merged commit e9628b6 into sonic-net:master Aug 25, 2020
@abdosi
Copy link
Contributor

abdosi commented Sep 4, 2020

@judyjoseph create PR for 201911

judyjoseph added a commit to judyjoseph/sonic-platform-daemons that referenced this pull request Sep 5, 2020
@judyjoseph
Copy link
Contributor Author

@judyjoseph create PR for 201911

Raised this PR #89

vdahiya12 pushed a commit to vdahiya12/sonic-platform-daemons that referenced this pull request Apr 4, 2022
* Add pcie_base and pcie_common function

* Add pcie_base and pcie_common function

* Add pcie_base and pcie_common funtion

* modify format

* modify prompt message

* modify prompt message
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.

None yet

5 participants