aristanetworks / sonic

Open source drivers and initialization library for Arista platforms running SONiC
GNU General Public License v2.0
25 stars 30 forks source link

[chassis] [multi-asic card] get_transceiver_info return noop #88

Closed wenyiz2021 closed 1 year ago

wenyiz2021 commented 1 year ago

on one of the CL2 linecard, transceiver info is missing in state DB, it is more likely due to platform_chassis.get_sfp(physical_port).get_transceiver_info() return noop transceiver info. it's also seen on multi-asic linecard, and SUP, but another CL2 linecard is fine.

admin@str2-7804-lc7-1:~$ redis-cli --raw -n 6 keys TRANSCEIVER_INFO*

admin@str2-7804-lc7-1:~$ 
admin@str2-7804-lc7-1:~$ sudo sfputil show eeprom  
> /usr/local/lib/python3.9/dist-packages/sfputil/main.py(652)eeprom()
-> try:
(Pdb) list
647                 if not presence:
648                     output += "{}: SFP EEPROM not detected\n".format(port_name)
649                 else:
650                     output += "{}: SFP EEPROM detected\n".format(port_name)
651                     import pdb; pdb.set_trace()
652  ->                 try:
653                         xcvr_info = platform_chassis.get_sfp(physical_port).get_transceiver_info()
654                     except NotImplementedError:
655                         click.echo("Sfp.get_transceiver_info() is currently not implemented for this platform")
656                         sys.exit(ERROR_NOT_IMPLEMENTED)
657  
(Pdb) physical_port
17
(Pdb) logical_port
*** NameError: name 'logical_port' is not defined
(Pdb) logical_port_name
'Ethernet64'
(Pdb) logical_port_list
['Ethernet128', 'Ethernet64', 'Ethernet116', 'Ethernet140', 'Ethernet32', 'Ethernet24', 'Ethernet40', 'Ethernet16', 'Ethernet48', 'Ethernet152', 'Ethernet28', 'Ethernet72', 'Ethernet108', 'Ethernet4', 'Ethernet8', 'Ethernet76', 'Ethernet60', 'Ethernet44', 'Ethernet84', 'Ethernet52', 'Ethernet136', 'Ethernet180', 'Ethernet80', 'Ethernet88', 'Ethernet124', 'Ethernet168', 'Ethernet144', 'Ethernet164', 'Ethernet176', 'Ethernet20', 'Ethernet56', 'Ethernet92', 'Ethernet132', 'Ethernet148', 'Ethernet172', 'Ethernet36', 'Ethernet100', 'Ethernet104', 'Ethernet68', 'Ethernet0', 'Ethernet96', 'Ethernet112', 'Ethernet188', 'Ethernet184', 'Ethernet156', 'Ethernet12', 'Ethernet120', 'Ethernet160']
(Pdb) physical_port_list
[17]
(Pdb) platform_chassis.get_sfp(physical_port)
<arista.utils.sonic_platform.sfp_optoe.SfpOptoe object at 0x7f7449e3b850>
(Pdb) platform_chassis.get_sfp(physical_port).get_transceiver_info()
(Pdb) 
wenyiz2021 commented 1 year ago

cc @Staphylo @arlakshm @kartik for viz

wenyiz2021 commented 1 year ago

issue is only seen on multi-asic LC:

multi-asic LC:

admin@str2-7804-lc5-1:~$ redis-cli --raw -n 6 keys TRANSCEIVER_INFO*

admin@str2-7804-lc5-1:~$ 

CL2 LC:

admin@str2-7804-lc3-1:~$ redis-cli --raw -n 6 keys TRANSCEIVER_INFO*

TRANSCEIVER_INFO|Ethernet40
TRANSCEIVER_INFO|Ethernet68
TRANSCEIVER_INFO|Ethernet56
TRANSCEIVER_INFO|Ethernet20
TRANSCEIVER_INFO|Ethernet92
TRANSCEIVER_INFO|Ethernet104
TRANSCEIVER_INFO|Ethernet112
TRANSCEIVER_INFO|Ethernet32
TRANSCEIVER_INFO|Ethernet24
TRANSCEIVER_INFO|Ethernet88
TRANSCEIVER_INFO|Ethernet8
TRANSCEIVER_INFO|Ethernet76
TRANSCEIVER_INFO|Ethernet100
TRANSCEIVER_INFO|Ethernet72
TRANSCEIVER_INFO|Ethernet52
TRANSCEIVER_INFO|Ethernet96
TRANSCEIVER_INFO|Ethernet48
TRANSCEIVER_INFO|Ethernet28
TRANSCEIVER_INFO|Ethernet44
TRANSCEIVER_INFO|Ethernet0
TRANSCEIVER_INFO|Ethernet16
TRANSCEIVER_INFO|Ethernet116
TRANSCEIVER_INFO|Ethernet84
TRANSCEIVER_INFO|Ethernet80
TRANSCEIVER_INFO|Ethernet120
TRANSCEIVER_INFO|Ethernet60
TRANSCEIVER_INFO|Ethernet36
TRANSCEIVER_INFO|Ethernet108
TRANSCEIVER_INFO|Ethernet12
TRANSCEIVER_INFO|Ethernet64
TRANSCEIVER_INFO|Ethernet124
TRANSCEIVER_INFO|Ethernet4
Staphylo commented 1 year ago

@wenyiz2021 this is expected based on the design of multi-asic in SONiC. You have to perform your query in the correct namespace if you want this information.

Here's an example on a 7800R3AK-36DM2-LC linecard

root@lc-6:~# sonic-db-cli -n asic0 STATE_DB keys 'TRANSCEIVER_INFO*' | sort -V
TRANSCEIVER_INFO|Ethernet0
TRANSCEIVER_INFO|Ethernet8
TRANSCEIVER_INFO|Ethernet16
TRANSCEIVER_INFO|Ethernet24
TRANSCEIVER_INFO|Ethernet32
TRANSCEIVER_INFO|Ethernet40
TRANSCEIVER_INFO|Ethernet72
TRANSCEIVER_INFO|Ethernet80
TRANSCEIVER_INFO|Ethernet96
TRANSCEIVER_INFO|Ethernet104
TRANSCEIVER_INFO|Ethernet112
TRANSCEIVER_INFO|Ethernet128
TRANSCEIVER_INFO|Ethernet136
root@cmp214-6:~# sonic-db-cli -n asic1 STATE_DB keys 'TRANSCEIVER_INFO*' | sort -V
TRANSCEIVER_INFO|Ethernet144
TRANSCEIVER_INFO|Ethernet152
TRANSCEIVER_INFO|Ethernet160
TRANSCEIVER_INFO|Ethernet168
TRANSCEIVER_INFO|Ethernet176
TRANSCEIVER_INFO|Ethernet184
TRANSCEIVER_INFO|Ethernet192
TRANSCEIVER_INFO|Ethernet200
TRANSCEIVER_INFO|Ethernet216
TRANSCEIVER_INFO|Ethernet224
TRANSCEIVER_INFO|Ethernet232
TRANSCEIVER_INFO|Ethernet240
TRANSCEIVER_INFO|Ethernet248
TRANSCEIVER_INFO|Ethernet256

Some of SONiC CLI are multi-asic aware and will source the information from the correct namespace but it's not the case for all. For example checking a transceiver presence via the show interface transceiver CLI can be deceiving if you forget about the asic namespace.

root@lc-6:~# show interface transceiver presence Ethernet0
Port       Presence
---------  -----------
Ethernet0  Not present
root@lc-6:~# show interface transceiver presence -n asic0 Ethernet0
Port       Presence
---------  ----------
Ethernet0  Present
root@lc-6:~# show interface transceiver presence -n asic1 Ethernet0
Port       Presence
---------  -----------
Ethernet0  Not present

You can see that the xcvrd daemon is namespace aware and in the case of multi-asic will therefore push the xcvr data in the namespace db instead of the global one.

Since this is a SONiC specific issue and not a vendor on, I will close this thread.

wenyiz2021 commented 1 year ago

thanks @Staphylo for mentioning the multi-asic behavior. originally the issue is seen on all linecards, then with latest image it seems to be fixed.