@@ -410,7 +410,7 @@ static void bf_pltfm_onlp_mntr_transceiver()
410410 int module ;
411411 int max_sfp_modules ;
412412 int max_qsfp_modules ;
413- uint8_t buf [MAX_QSFP_PAGE_SIZE * 4 ] = {0 };
413+ uint8_t buf [MAX_QSFP_PAGE_SIZE * 6 ] = {0 };
414414 uint32_t flags = bf_pltfm_mgr_ctx ()-> flags ;
415415
416416 struct qsfp_ctx_t * qsfp , * qsfp_ctx ;
@@ -491,6 +491,14 @@ static void bf_pltfm_onlp_mntr_transceiver()
491491 }
492492 }
493493
494+
495+ /* Providing limited memory pages should be enough since
496+ the claim is only for DDM information.
497+ SFF8436 & SFF8636: LP00h + UP(00-03)h, 128 * 5
498+ CMIS: LM + P(00-04)h, 128 * 6
499+ Thus we need a buffer of at least size 128 * 6.
500+ By SunZheng, 2025/04/11.
501+ */
494502 if (bf_qsfp_get_cached_info (i ,
495503 QSFP_PAGE0_LOWER , buf )) {
496504 continue ;
@@ -500,13 +508,33 @@ static void bf_pltfm_onlp_mntr_transceiver()
500508 buf + MAX_QSFP_PAGE_SIZE )) {
501509 continue ;
502510 }
503- #if 0
504- if (bf_qsfp_is_cmis (i )) {
511+ if (bf_qsfp_get_cached_info (
512+ i , QSFP_PAGE1 ,
513+ buf + MAX_QSFP_PAGE_SIZE * 2 )) {
505514 continue ;
506515 }
507- #endif
508- onlp_save (path , (char * )buf ,
509- MAX_QSFP_PAGE_SIZE * 2 );
516+ if (bf_qsfp_get_cached_info (
517+ i , QSFP_PAGE2 ,
518+ buf + MAX_QSFP_PAGE_SIZE * 3 )) {
519+ continue ;
520+ }
521+ if (bf_qsfp_get_cached_info (
522+ i , QSFP_PAGE3 ,
523+ buf + MAX_QSFP_PAGE_SIZE * 4 )) {
524+ continue ;
525+ }
526+ if (bf_qsfp_is_cmis (i )) {
527+ if (bf_qsfp_get_cached_info (
528+ i , QSFP_PAGE4 ,
529+ buf + MAX_QSFP_PAGE_SIZE * 5 )) {
530+ continue ;
531+ }
532+ onlp_save (path , (char * )buf ,
533+ MAX_QSFP_PAGE_SIZE * 6 );
534+ } else {
535+ onlp_save (path , (char * )buf ,
536+ MAX_QSFP_PAGE_SIZE * 5 );
537+ }
510538 }
511539 sprintf (path , ONLP_LOG_QSFP_PRES_PATH ,
512540 "presence" );
@@ -573,12 +601,12 @@ static void bf_pltfm_onlp_mntr_transceiver()
573601 continue ;
574602 }
575603 if (bf_sfp_get_cached_info (i , 1 ,
576- buf + 2 * MAX_QSFP_PAGE_SIZE ) ) {
604+ buf + MAX_QSFP_PAGE_SIZE ) ) {
577605 continue ;
578606 }
579607 /* $ hexdump /var/asterfusion/qsfp_10_eeprom is helpful. */
580608 onlp_save (path , (char * )buf ,
581- MAX_QSFP_PAGE_SIZE * 4 );
609+ MAX_QSFP_PAGE_SIZE * 2 );
582610 }
583611 sprintf (path , ONLP_LOG_SFP_PRES_PATH ,
584612 "presence" );
0 commit comments