OpenNetworkLinux icon indicating copy to clipboard operation
OpenNetworkLinux copied to clipboard

x86-64-accton-wedge100bf-32x-r0 - transcievers bitmap is not updated on removal

Open Vladimir-NTCT opened this issue 6 years ago • 5 comments

x86-64-accton-wedge100bf-32x-r0

onlp_sfp_presence_bitmap_get() returns bitmap of transceivers present. Insertion of the new transceiver causes bitmap change. Removal of the previously inserted transceiver does not change bitmap, removed transceiver is still marked as present.

Compared to the same function for x86-64-accton-as7312-54x-r0. There it works properly.

Vladimir-NTCT avatar Jun 05 '18 21:06 Vladimir-NTCT

I cannot reproduce this problem. I tried to reproduce this issue with wedge100BF_32x device and also used four transceivers with insertion and removal on random ports and used "onlpdump" command to view SFP Presence bitmap and finally I cannot reproduce this issue.

I kindly request to provide more detail on how to reproduce this issue. For example, console log or which ports to test and how many transceivers used to test.

phani-karanam avatar Jun 06 '18 10:06 phani-karanam

We are NOT using "onlpdump" command.

There is a periodic (500 mS) poll which is using ONLP API onlp_sfp_presence_bitmap_get(&sfp_bitmap_new)

Call returns 32 bit bitmap word. When QSFP is inserted to any of the empty ports appropriate bit in the the bitmap is changing from 0b to 1b. If you remove QSFP next poll(s) keep returning the same bitmap with 1b in the position related to the removed QSFP. Naturally plugging QSFP back to the same port does not change the bitmap, bit remains 1b. Plugging QSFP to a different port, which was empty before, changes bitmap with new 1b in a new position.

Our assumption was that onlp_sfp_presence_bitmap_get(&sfp_bitmap_new) should be sufficient for transceivers presence poll.

Vladimir-NTCT avatar Jun 06 '18 17:06 Vladimir-NTCT

Found a workaround:

Calling function should clear transceivers bitmap each time before polling presence with ONLP library API:

        sfp_bitmap_new.words[0] = 0;
        sfp_bitmap_new.words[1] = 0;
	rc = onlp_sfp_presence_bitmap_get(&sfp_bitmap_new);

When it is done result bitmap has correct presence information.

Suggestions:

  1. Add bitmap clearing to the ONLP function; OR
  2. Document necessary cleaning in a library header file comments.

Vladimir-NTCT avatar Jun 13 '18 17:06 Vladimir-NTCT

Maybe lines 370~372 in the following link can be a good reference on using that API. https://github.com/opencomputeproject/OpenNetworkLinux/blob/116fc560dc69ea53ab31ce26cd45b1f36ab98a73/packages/base/any/onlp/src/onlp/module/src/onlp_main.c#L370

Lewis-Kang avatar Jun 14 '18 00:06 Lewis-Kang

Transceiver bit map clearing is done inside function "onlp_sfp_presence_bitmap_get_locked__" in sfp.c file

phani-karanam avatar Jun 21 '18 06:06 phani-karanam