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

Improve parsing of media-settings.json for non-CMIS and breakout ports #533

Merged

Conversation

longhuan-cisco
Copy link
Contributor

@longhuan-cisco longhuan-cisco commented Aug 18, 2024

Description

Enhance/fix media_settings infra in below aspects:

  1. Support/fix for 100G QSFP28 transceivers:

    • fix its issue of media_key parsed as QSFP28-Unknown-... due to its compliance code defined in Extended Specification Compliance field rather than 10/40G Ethernet Compliance Code
      Example transceiver info for 100G QSFP28:
      
      root@sonic:/home/cisco# show int trans info Ethernet176
      Ethernet176: SFP EEPROM detected
              Application Advertisement: N/A
              ...
              Identifier: QSFP28 or later
              ...
              Specification compliance:
                      10/40G Ethernet Compliance Code: Unknown
                      Extended Specification Compliance: 100GBASE-CR4, 25GBASE-CR CA-25G-L or 50GBASE-CR2 with RS
              ...
      

      Solution: Go check Extended Specification Compliance for QSFP28 100G modules

    • fix its issue of lane_speed_key parsed as None due to QSFP28 having no Application Advertisement (which is CMIS specific field and contains host_electrical_interface_id used by today's logic as speed key )

      Solution: For non-CMIS, directly use port_speed and lane_count to calculate lane speed and use it as key, e.g. 100G / 4 = 25G, then lane speed key is speed:25G

  2. Support/fix for DPB situations:

    • fix the issue that serdes SI values for wrong lanes get picked up from media_settings.json, due to below two mistakes made by today's logic of get_media_val_str():
      Problem example:
      
      root@sonic:/home/cisco# config interface breakout Ethernet176 "4x25G" -fy 
      root@sonic:/home/cisco# show int status | grep -E "Ethernet17[6-9]"
      Ethernet176                   20      25G   9100    N/A   etp44a  routed      up       up  100GBASE-CR4         N/A
      Ethernet177                   21      25G   9100    N/A   etp44b  routed      up       up  100GBASE-CR4         N/A
      Ethernet178                   22      25G   9100    N/A   etp44c  routed      up       up  100GBASE-CR4         N/A
      Ethernet179                   23      25G   9100    N/A   etp44d  routed      up       up  100GBASE-CR4         N/A
      
      >>-- port_mapping.handle_port_change_event() called for Ethernet176, and got inserted to port_mapping.physical_to_logical[44]
      Aug 18 04:46:51.967840 sonic NOTICE pmon#xcvrd[151847]: Publishing ASIC-side SI setting for port Ethernet176 (num_logical_ports=1, logical_idx=0) in APP_DB:
      Aug 18 04:46:51.967840 sonic NOTICE pmon#xcvrd[151847]: 0:(main,0x1a,0x1b,0x1c,0x1d)     --> should be (main,0x1a) instead
      ......
      >>-- port_mapping.handle_port_change_event() called for Ethernet177, and got inserted to port_mapping.physical_to_logical[44]      
      Aug 18 04:46:52.027793 sonic NOTICE pmon#xcvrd[151847]: Publishing ASIC-side SI setting for port Ethernet177 (num_logical_ports=2, logical_idx=1) in APP_DB:
      Aug 18 04:46:52.027818 sonic NOTICE pmon#xcvrd[151847]: 0:(main,0x1c,0x1d)     --> should be (main,0x1b) instead
      ......
      >>-- port_mapping.handle_port_change_event() called for Ethernet178, and got inserted to port_mapping.physical_to_logical[44]
      Aug 18 04:46:52.085544 sonic NOTICE pmon#xcvrd[151847]: Publishing ASIC-side SI setting for port Ethernet178 (num_logical_ports=3, logical_idx=2) in APP_DB:
      Aug 18 04:46:52.085544 sonic NOTICE pmon#xcvrd[151847]: 0:(main,0x1c)
      ......
      >>-- port_mapping.handle_port_change_event() called for Ethernet179, and got inserted to port_mapping.physical_to_logical[44]
      Aug 18 04:46:52.142960 sonic NOTICE pmon#xcvrd[151847]: Publishing ASIC-side SI setting for port Ethernet179 (num_logical_ports=4, logical_idx=3) in APP_DB:
      Aug 18 04:46:52.142960 sonic NOTICE pmon#xcvrd[151847]: 0:(main,0x1d)
      ......
      

      Solution: Use lane_count per logical port directly obtained from 'lanes' field in config DB port table

      Problem example:
      
      Upon xcvrd coming up (system bootup/process restart), here Ethernet176 is the real 1st logical port, but last one inserted into port_mapping.logical_port_list, thus wrongly treated as 4th logical port:
      Aug 18 04:32:21.155536 sonic NOTICE pmon#xcvrd[151847]: Publishing ASIC-side SI setting for port Ethernet177 (num_logical_ports=4, logical_idx=0) in APP_DB:
      Aug 18 04:32:21.155536 sonic NOTICE pmon#xcvrd[151847]: 0:(main,0x1b)
      Aug 18 04:32:21.830787 sonic NOTICE pmon#xcvrd[151847]: Publishing ASIC-side SI setting for port Ethernet178 (num_logical_ports=4, logical_idx=1) in APP_DB:
      Aug 18 04:32:21.830855 sonic NOTICE pmon#xcvrd[151847]: 0:(main,0x1c)
      Aug 18 04:32:21.895498 sonic NOTICE pmon#xcvrd[151847]: Publishing ASIC-side SI setting for port Ethernet179 (num_logical_ports=4, logical_idx=2) in APP_DB:
      Aug 18 04:32:21.895537 sonic NOTICE pmon#xcvrd[151847]: 0:(main,0x1d)
      Aug 18 04:32:22.166040 sonic NOTICE pmon#xcvrd[151847]: Publishing ASIC-side SI setting for port Ethernet176 (num_logical_ports=4, logical_idx=3) in APP_DB:
      Aug 18 04:32:22.166121 sonic NOTICE pmon#xcvrd[151847]: 0:(main,0x1a)
      

      Solution: Use subport number directly obtained from config DB port table as index of logical port (nowadays subport will always get automatically populated)

  3. Add regular expression support for lane_speed_key, so that multiple lane speed keys can be grouped together if they share the same lane speed value or same serdes SI values, e.g. speed:200GAUI-8|100GAUI-4|50GAUI-2|25G

  4. Add lane_speed_key support under Default vendor/media key. Also add support for speed:Default, which is useful if default serdes SI setting value is desired when no match is found for available lane speed keys.

    Example:
     {
        'GLOBAL_MEDIA_SETTINGS': {
            '0-31': {
                'Default': {
                    'speed:400GAUI-8': {'idriver': {'lane0': '0x1a', ...}, ...},
                    'speed:200GAUI-8|100GAUI-4|50GAUI-2|25G': {'idriver': {'lane0': '0x1b', ...}, ...},
                    'speed:Default': {'idriver': {'lane0': '0x1c', ...}, ...},
                }
            },
        }
    }
    
  5. Improved code coverage of media_settings_parser.py to 97%

Motivation and Context

This PR is mainly to make sure media_settings infra can work properly for 100G QSFP28 and DPB cases/etc

How Has This Been Tested?

Verified proper settings got notified with different transceivers under both DPB and non-DPB cases
Verified compatibility with existing media_settings.json

Additional Information (Optional)

@longhuan-cisco longhuan-cisco changed the title Enhance and fix media_settings infra to support 100G xcvr and DPB etc Enhance and fix media_settings infra to support 100G QSFP28 and DPB etc Aug 18, 2024
@longhuan-cisco longhuan-cisco changed the title Enhance and fix media_settings infra to support 100G QSFP28 and DPB etc Enhance/fix media_settings infra for 100G QSFP28 and DPB etc Aug 18, 2024
@longhuan-cisco
Copy link
Contributor Author

@prgeor @mihirpat1 Could you please review?

Copy link
Contributor

@mihirpat1 mihirpat1 left a comment

Choose a reason for hiding this comment

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

Approved with minor comments

@prgeor
Copy link
Collaborator

prgeor commented Sep 12, 2024

@liat-grozovik can you assign reviewer ?

Copy link
Collaborator

@prgeor prgeor left a comment

Choose a reason for hiding this comment

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

@longhuan-cisco @AnoopKamath could you please attach the test result on Cisco 8111 ?

@prgeor prgeor changed the title Enhance/fix media_settings infra for 100G QSFP28 and DPB etc Improve parsing of media-settings.json for non-CMIS and breakout ports Sep 12, 2024
@AnoopKamath
Copy link
Contributor

AnoopKamath commented Sep 17, 2024

@longhuan-cisco @AnoopKamath could you please attach the test result on Cisco 8111 ?

@prgeor : DPB feature is currently supported on 8102 only and will be extended to all other platforms soon.

if app_id and app_id in appl_adv_dict:
host_electrical_interface_id = appl_adv_dict[app_id].get('host_electrical_interface_id')
if host_electrical_interface_id:
lane_speed_key = LANE_SPEED_KEY_PREFIX + host_electrical_interface_id.split()[0]

if not lane_speed_key:
Copy link
Collaborator

Choose a reason for hiding this comment

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

@longhuan-cisco would suggest to use else of if xcvrd.is_cmis_api(api) so that we know this is a non-CMIS case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally I used else of if xcvrd.is_cmis_api(api)

if not lane_speed_key:
    lane_speed_key = '{}{}G'.format(LANE_SPEED_KEY_PREFIX, port_speed // lane_count // 1000)

But the above code can make sure lane_speed_key always gets generated even if some CMIS module somehow doesn't have host_electrical_interface_id (due to bad/corrupted eeprom, etc). It has better survivability/robustness

I'm ok to change it back to else of if xcvrd.is_cmis_api(api), and print a error message for the case of No host_electrical_interface_id found for this CMIS module to construct lane_speed_key

Copy link
Collaborator

@prgeor prgeor left a comment

Choose a reason for hiding this comment

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

@@ -17,6 +18,9 @@
VENDOR_KEY = 'vendor_key'
MEDIA_KEY = 'media_key'
LANE_SPEED_KEY = 'lane_speed_key'
DEFAULT_KEY = 'Default'
# This is useful if default value is desired when no match is found for lane speed key
Copy link
Collaborator

Choose a reason for hiding this comment

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

@longhuan-cisco not able to understand. Can you please explain with an example. Can you capture these in the HLD:- https://github.com/sonic-net/SONiC/blob/master/doc/media-settings/Media-based-Port-settings.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Below is an example mentioned in PR description:

Example:
 {
    'GLOBAL_MEDIA_SETTINGS': {
        '0-31': {
            'Default': {
                'speed:400GAUI-8': {'idriver': {'lane0': '0x1a', ...}, ...},
                'speed:Default': {'idriver': {'lane0': '0x1c', ...}, ...},
            }
        },
    }
}

In this example, the speed key entry 'speed:400GAUI-8') covers lane_speed 50G, the 'speed:Default' entry is handy to cover all the reset of lane_speeds (10G, 25G, 100G ...)

yea, will raise PR for the HLD update.

# For 100G transceivers, it's usually in extended specification compliance
if media_compliance_code in sup_compliance_extended_values and \
extended_spec_compliance_str in media_compliance_dict:
media_compliance_code = media_compliance_dict[extended_spec_compliance_str]
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you provide an example for the media_key generated for a module with the following entry (from the PR description):
Extended Specification Compliance: 100GBASE-CR4, 25GBASE-CR CA-25G-L or 50GBASE-CR2 with RS

Will the media_key include all three options listed here, or only the one relevant to the module's speed and lane count? If the entire string is included, the key might end up very long.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

example:
'media_key': 'QSFP28-100GBASE-CR4, 25GBASE-CR CA-25G-L or 50GBASE-CR2 with RS-1.0M',

entire string will be included, we just take the entire extended_spec_compliance as the first part of media_key, so that we can keep original information as much as possible in the key, and based on which platform has the max flexibility to define its matching pattern in media_settings.json. The pattern can be shorter (e.g. just prefix QSFP28-100GBASE-CR4) or in regular expression (e.g. QSFP28-100GBASE-CR4.*-1.0M)

@longhuan-cisco
Copy link
Contributor Author

@prgeor
basic test on 8111 with breakout:

root@sonic:/home/cisco# show plat sum
Platform: x86_64-8111_32eh_o-r0
HwSKU: Cisco-8111-O64
ASIC: cisco-8000
ASIC Count: 1
Serial Number: FLM2632096P
Model Number: 8111-32EH-O
Hardware Revision: 1.0


root@sonic:/home/cisco# show int st
  Interface                Lanes    Speed    MTU    FEC    Alias    Vlan    Oper    Admin                                             Type    Asym PFC
-----------  -------------------  -------  -----  -----  -------  ------  ------  -------  -----------------------------------------------  ----------
  Ethernet0  2048,2049,2050,2051     400G   9100    N/A    etp0a  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
  Ethernet4  2052,2053,2054,2055     400G   9100    N/A    etp0b  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A



root@sonic:/home/cisco# show int trans info Ethernet0
Ethernet0: SFP EEPROM detected
        Active Firmware: 0.7.0
        Active application selected code assigned to host lane 1: 1
        Active application selected code assigned to host lane 2: 1
        Active application selected code assigned to host lane 3: 1
        Active application selected code assigned to host lane 4: 1
        Active application selected code assigned to host lane 5: N/A
        Active application selected code assigned to host lane 6: N/A
        Active application selected code assigned to host lane 7: N/A
        Active application selected code assigned to host lane 8: N/A
        Application Advertisement: 400GAUI-4-S C2M (Annex 120G) - Host Assign (0x11) - Active Cable assembly with BER < 10^-6 - Media Assign (0x11)
                                   400GAUI-4-L C2M (Annex 120G) - Host Assign (0x11) - Active Cable assembly with BER < 10^-6 - Media Assign (0x11)
        CMIS Rev: 5.0
        Connector: No separable connector
        E1 Active Firmware: 0.7.0
        E1 Inactive Firmware: 0.7.0
        E1 Server Firmware: N/A
        E2 Active Firmware: 0.7.0
        E2 Inactive Firmware: 0.7.0
        E2 Server Firmware: N/A
        Encoding: N/A
        Extended Identifier: Power Class 6 (12.0W Max)
        Extended RateSelect Compliance: N/A
        Host Lane Count: 4
        Identifier: QSFP-DD Double Density 8X Pluggable Transceiver
        Inactive Firmware: 0.7.0
        Length Cable Assembly(m): 1.5
        Media Interface Technology: Copper cable, near and far end limiting active equalizers
        Media Lane Count: 4
        Module Hardware Rev: 10.0
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: active_cable_media_interface
        Supported Max Laser Frequency: N/A
        Supported Max TX Power: N/A
        Supported Min Laser Frequency: N/A
        Supported Min TX Power: N/A
        Vendor Date Code(YYYY-MM-DD Lot): 2023-12-20
        Vendor Name: Credo
        Vendor OUI: 9a-ad-ca
        Vendor PN: CAC815321M2MC1MS
        Vendor Rev:
        Vendor SN: BD8D41535200T


2024 Sep 26 05:49:21.870114 sonic NOTICE pmon#xcvrd: Retrieving media settings for port Ethernet0 speed 400000 num_lanes 4, using key {'vendor_key': 'CREDO           -CAC815321M2MC1MS', 'media_key': 'QSFP-DD-active_cable_media_interface', 'lane_speed_key': 'speed:400GAUI-4-S'}
2024 Sep 26 05:49:21.870342 sonic NOTICE pmon#xcvrd: Publishing ASIC-side SI setting for port Ethernet0 in APP_DB:
2024 Sep 26 05:49:21.870659 sonic NOTICE pmon#xcvrd: 0:(idriver,0x6,0x6,0x6,0x6)

2024 Sep 26 05:49:21.911192 sonic NOTICE swss#orchagent: :- setPortSerdesAttribute: Created port serdes object 0x57000000000977 for port 0x1000000000002
2024 Sep 26 05:49:21.911192 sonic NOTICE swss#orchagent: :- doPortTask: Set port Ethernet0 SI settings is successful


2024 Sep 26 05:49:28.921779 sonic NOTICE pmon#xcvrd: Retrieving media settings for port Ethernet4 speed 400000 num_lanes 4, using key {'vendor_key': 'CREDO           -CAC815321M2MC1MS', 'media_key': 'QSFP-DD-active_cable_media_interface', 'lane_speed_key': 'speed:400GAUI-4-S'}
2024 Sep 26 05:49:28.921779 sonic NOTICE pmon#xcvrd: Publishing ASIC-side SI setting for port Ethernet4 in APP_DB:
2024 Sep 26 05:49:28.921909 sonic NOTICE pmon#xcvrd: 0:(idriver,0x6,0x6,0x6,0x6)

2024 Sep 26 05:49:28.981666 sonic NOTICE swss#orchagent: :- setPortSerdesAttribute: Created port serdes object 0x57000000000978 for port 0x1000000000003
2024 Sep 26 05:49:28.981666 sonic NOTICE swss#orchagent: :- doPortTask: Set port Ethernet4 SI settings is successful


root@sonic:/home/cisco# cat /usr/share/sonic/device/x86_64-8111_32eh_o-r0/media_settings.json
{
    "GLOBAL_MEDIA_SETTINGS": {
        "0-0": {
            "Default": {
                "speed:400GAUI-4-(S|L)": {
                    "idriver": {
                        "lane0":"0x2",
                        "lane1":"0x2",
                        "lane2":"0x2",
                        "lane3":"0x2",
                        "lane4":"0x2",
                        "lane5":"0x2",
                        "lane6":"0x2",
                        "lane7":"0x2"
                    }
                },
                "speed:Default": {
                    "idriver": {
                        "lane0":"0x7",
                        "lane1":"0x7",
                        "lane2":"0x7",
                        "lane3":"0x7",
                        "lane4":"0x7",
                        "lane5":"0x7",
                        "lane6":"0x7",
                        "lane7":"0x7"
                    }
                }
            },
            "QSFP-DD-active_cable_media_interface": {
                "speed:400GAUI-4-(S|L)": {
                    "idriver": {
                        "lane0":"0x6",
                        "lane1":"0x6",
                        "lane2":"0x6",
                        "lane3":"0x6",
                        "lane4":"0x6",
                        "lane5":"0x6",
                        "lane6":"0x6",
                        "lane7":"0x6"
                    }
                },
                "speed:Default": {
                    "idriver": {
                        "lane0":"0x0",
                        "lane1":"0x0",
                        "lane2":"0x0",
                        "lane3":"0x0",
                        "lane4":"0x0",
                        "lane5":"0x0",
                        "lane6":"0x0",
                        "lane7":"0x0"
                    }
                }
            }
        }
    }
}


@longhuan-cisco
Copy link
Contributor Author

@mihirpat1

tested on 8101-O32 with 400G AOC:

root@sonic:/home/cisco# show plat sum
Platform: x86_64-8101_32fh_o-r0
HwSKU: Cisco-8101-O32
ASIC: cisco-8000
ASIC Count: 1
Serial Number: FLM251102C6
Model Number: 8101-32FH-O
Hardware Revision: 0.41


root@sonic:/home/cisco# show int trans info Ethernet16
Ethernet16: SFP EEPROM detected
        Active Firmware: 1.4.0
        Active application selected code assigned to host lane 1: 1
        Active application selected code assigned to host lane 2: 1
        Active application selected code assigned to host lane 3: 1
        Active application selected code assigned to host lane 4: 1
        Active application selected code assigned to host lane 5: 1
        Active application selected code assigned to host lane 6: 1
        Active application selected code assigned to host lane 7: 1
        Active application selected code assigned to host lane 8: 1
        Application Advertisement: 400GAUI-8 C2M (Annex 120E) - Host Assign (0x1) - Active Cable assembly with BER < 2.6x10^-4 - Media Assign (0x1)
                                   CAUI-4 C2M (Annex 83E) - Host Assign (0x11) - Active Cable assembly with BER < 5x10^-5 - Media Assign (0x11)
                                   200GAUI-4 C2M (Annex 120E) - Host Assign (0x11) - Active Cable assembly with BER < 2.6x10^-4 - Media Assign (0x11)
                                   100GAUI-2 C2M (Annex 135G) - Host Assign (0x55) - Active Cable assembly with BER < 2.6x10^-4 - Media Assign (0x55)
                                   50GAUI-1 C2M (Annex 135G) - Host Assign (0xff) - Active Cable assembly with BER < 2.6x10^-4 - Media Assign (0xff)
                                   25GAUI C2M (Annex 109B) - Host Assign (0xff) - Active Cable assembly with BER < 5x10^-5 - Media Assign (0xff)
        CMIS Rev: 5.2
        Connector: No separable connector
        Encoding: N/A
        Extended Identifier: Power Class 4 (8.0W Max)
        Extended RateSelect Compliance: N/A
        Host Lane Count: 8
        Identifier: QSFP-DD Double Density 8X Pluggable Transceiver
        Inactive Firmware: 1.4.0
        Length Cable Assembly(m): 9.0
        Media Interface Technology: 850 nm VCSEL
        Media Lane Count: 8
        Module Hardware Rev: 1.1
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: active_cable_media_interface
        Supported Max Laser Frequency: N/A
        Supported Max TX Power: N/A
        Supported Min Laser Frequency: N/A
        Supported Min TX Power: N/A
        Vendor Date Code(YYYY-MM-DD Lot): 2024-08-14
        Vendor Name: AOI
        Vendor OUI: 00-29-26
        Vendor PN: ALQA9N09ADLA1580
        Vendor Rev: 11
        Vendor SN: 86524H60021B


root@sonic:/home/cisco# show int trans info Ethernet160
Ethernet160: SFP EEPROM detected
        Active Firmware: 0.1.20
        Active application selected code assigned to host lane 1: 1
        Active application selected code assigned to host lane 2: 1
        Active application selected code assigned to host lane 3: 1
        Active application selected code assigned to host lane 4: 1
        Active application selected code assigned to host lane 5: 1
        Active application selected code assigned to host lane 6: 1
        Active application selected code assigned to host lane 7: 1
        Active application selected code assigned to host lane 8: 1
        Application Advertisement: 400GAUI-8 C2M (Annex 120E) - Host Assign (0x1) - Active Cable assembly with BER < 5x10^-5 - Media Assign (0x1)
                                   CAUI-4 C2M (Annex 83E) - Host Assign (0x11) - Active Cable assembly with BER < 5x10^-5 - Media Assign (0x11)
        CMIS Rev: 5.0
        Connector: No separable connector
        Encoding: N/A
        Extended Identifier: Power Class 4 (8.0W Max)
        Extended RateSelect Compliance: N/A
        Host Lane Count: 8
        Identifier: QSFP-DD Double Density 8X Pluggable Transceiver
        Inactive Firmware: 1.0.0
        Length Cable Assembly(m): 9.0
        Media Interface Technology: 850 nm VCSEL
        Media Lane Count: 8
        Module Hardware Rev: 3.1
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: active_cable_media_interface
        Supported Max Laser Frequency: N/A
        Supported Max TX Power: N/A
        Supported Min Laser Frequency: N/A
        Supported Min TX Power: N/A
        Vendor Date Code(YYYY-MM-DD Lot): 2024-08-16
        Vendor Name: Cloud Light
        Vendor OUI: a8-bc-9c
        Vendor PN: 7123-G78-09
        Vendor Rev: 03
        Vendor SN: BA24320020


root@sonic:/home/cisco# grep 'pif_counts": 8' /usr/share/sonic/device/x86_64-8101_32fh_o-r0/Cisco-8101-O32/asic_cfg.json -A 6
                        "pif_counts": 8,
                        "speed": 400000,
                        "fec": "RS",
                        "mtu": 9100,
                        "media_type": "COPPER",
                        "admin_state": false
                    },


root@sonic:/home/cisco# cat /usr/share/sonic/device/x86_64-8101_32fh_o-r0/media_settings.json
{
    "GLOBAL_MEDIA_SETTINGS": {
...
        "2-3,24,28-29": {
            "(SFP|QSFP(\\+|28|-DD)*)-(?!.*((40|100)GBASE-CR|100G ACC|Active Copper Cable|passive_copper_media_interface)).*": {
...
                "speed:400GAUI-8|200GAUI-4|100GAUI-2|50GAUI-1|50G": {
                    "main": {
                        "lane0": "0x370",
                        "lane1": "0x370",
                        "lane2": "0x370",
                        "lane3": "0x370",
                        "lane4": "0x370",
                        "lane5": "0x370",
                        "lane6": "0x370",
                        "lane7": "0x370"
                    },
                    "post1": {
                        "lane0": "0xffffffc4",
                        "lane1": "0xffffffc4",
                        "lane2": "0xffffffc4",
                        "lane3": "0xffffffc4",
                        "lane4": "0xffffffc4",
                        "lane5": "0xffffffc4",
                        "lane6": "0xffffffc4",
                        "lane7": "0xffffffc4"
                    },
                    "pre1": {
                        "lane0": "0xffffffc4",
                        "lane1": "0xffffffc4",
                        "lane2": "0xffffffc4",
                        "lane3": "0xffffffc4",
                        "lane4": "0xffffffc4",
                        "lane5": "0xffffffc4",
                        "lane6": "0xffffffc4",
                        "lane7": "0xffffffc4"
                    },
                    "attn": {
                        "lane0": "0x4",
                        "lane1": "0x4",
                        "lane2": "0x4",
                        "lane3": "0x4",
                        "lane4": "0x4",
                        "lane5": "0x4",
                        "lane6": "0x4",
                        "lane7": "0x4"
                    },
                    "idriver": {
                        "lane0": "0x7",
                        "lane1": "0x7",
                        "lane2": "0x7",
                        "lane3": "0x7",
                        "lane4": "0x7",
                        "lane5": "0x7",
                        "lane6": "0x7",
                        "lane7": "0x7"
                    },
                    "ipredriver": {
                        "lane0": "0x0",
                        "lane1": "0x0",
                        "lane2": "0x0",
                        "lane3": "0x0",
                        "lane4": "0x0",
                        "lane5": "0x0",
                        "lane6": "0x0",
                        "lane7": "0x0"
                    }
                }
            },
...


2024 Sep 20 00:56:56.142691 sonic NOTICE pmon#xcvrd: Retrieving media settings for port Ethernet16 speed 400000 num_lanes 8, using key {'vendor_key': 'AOI             -ALQA9N09ADLA1580', 'media_key': 'QSFP-DD-active_cable_media_interface', 'lane_speed_key': 'speed:400GAUI-8'}
2024 Sep 20 00:56:56.142769 sonic NOTICE pmon#xcvrd: Publishing ASIC-side SI setting for port Ethernet16 in APP_DB:
2024 Sep 20 00:56:56.143142 sonic NOTICE pmon#xcvrd: 0:(main,0x370,0x370,0x370,0x370,0x370,0x370,0x370,0x370)
2024 Sep 20 00:56:56.143460 sonic NOTICE pmon#xcvrd: 1:(post1,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4)
2024 Sep 20 00:56:56.143827 sonic NOTICE pmon#xcvrd: 2:(pre1,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4)
2024 Sep 20 00:56:56.144112 sonic NOTICE pmon#xcvrd: 3:(attn,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x4)
2024 Sep 20 00:56:56.144371 sonic NOTICE pmon#xcvrd: 4:(idriver,0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7)
2024 Sep 20 00:56:56.144640 sonic NOTICE pmon#xcvrd: 5:(ipredriver,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0)

2024 Sep 20 00:56:56.331847 sonic NOTICE swss#orchagent: :- setPortSerdesAttribute: Created port serdes object 0x57000000000508 for port 0x1000000000004
2024 Sep 20 00:56:56.331847 sonic NOTICE swss#orchagent: :- doPortTask: Set port Ethernet16 SI settings is successful


2024 Sep 20 00:56:48.831794 sonic NOTICE pmon#xcvrd: Retrieving media settings for port Ethernet160 speed 400000 num_lanes 8, using key {'vendor_key': 'CLOUD LIGHT     -7123-G78-09     ', 'media_key': 'QSFP-DD-active_cable_media_interface', 'lane_speed_key': 'speed:400GAUI-8'}
2024 Sep 20 00:56:48.831889 sonic NOTICE pmon#xcvrd: Publishing ASIC-side SI setting for port Ethernet160 in APP_DB:
2024 Sep 20 00:56:48.832413 sonic NOTICE pmon#xcvrd: 0:(main,0x370,0x370,0x370,0x370,0x370,0x370,0x370,0x370)
2024 Sep 20 00:56:48.832875 sonic NOTICE pmon#xcvrd: 1:(post1,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4)
2024 Sep 20 00:56:48.833327 sonic NOTICE pmon#xcvrd: 2:(pre1,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4,0xffffffc4)
2024 Sep 20 00:56:48.833681 sonic NOTICE pmon#xcvrd: 3:(attn,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x4)
2024 Sep 20 00:56:48.833990 sonic NOTICE pmon#xcvrd: 4:(idriver,0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7)
2024 Sep 20 00:56:48.834260 sonic NOTICE pmon#xcvrd: 5:(ipredriver,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0)

2024 Sep 20 00:56:49.054276 sonic NOTICE swss#orchagent: :- setPortSerdesAttribute: Created port serdes object 0x570000000004ff for port 0x1000000000016
2024 Sep 20 00:56:49.054276 sonic NOTICE swss#orchagent: :- doPortTask: Set port Ethernet160 SI settings is successful

root@sonic:/home/cisco# show int st
  Interface                                    Lanes    Speed    MTU    FEC    Alias    Vlan    Oper    Admin                                             Type    Asym PFC
-----------  ---------------------------------------  -------  -----  -----  -------  ------  ------  -------  -----------------------------------------------  ----------
  Ethernet0  2304,2305,2306,2307,2308,2309,2310,2311     400G   9100    N/A     etp0  routed    down       up                                  QSFP28 or later         N/A
  Ethernet8  2320,2321,2322,2323,2324,2325,2326,2327     400G   9100    N/A     etp1  routed    down       up                                  QSFP28 or later         N/A
 Ethernet16  2312,2313,2314,2315,2316,2317,2318,2319     400G   9100    N/A     etp2  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
 Ethernet24  2056,2057,2058,2059,2060,2061,2062,2063     400G   9100    N/A     etp3  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
 Ethernet32  1792,1793,1794,1795,1796,1797,1798,1799     400G   9100    N/A     etp4  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
 Ethernet40  2048,2049,2050,2051,2052,2053,2054,2055     400G   9100    N/A     etp5  routed    down       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
 Ethernet48  2560,2561,2562,2563,2564,2565,2566,2567     400G   9100    N/A     etp6  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
 Ethernet56  2824,2825,2826,2827,2828,2829,2830,2831     400G   9100    N/A     etp7  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
 Ethernet64  2832,2833,2834,2835,2836,2837,2838,2839     400G   9100    N/A     etp8  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
 Ethernet72  2816,2817,2818,2819,2820,2821,2822,2823     400G   9100    N/A     etp9  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
 Ethernet80  2568,2569,2570,2571,2572,2573,2574,2575     400G   9100    N/A    etp10  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
 Ethernet88  2576,2577,2578,2579,2580,2581,2582,2583     400G   9100    N/A    etp11  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
 Ethernet96  1536,1537,1538,1539,1540,1541,1542,1543     400G   9100    N/A    etp12  routed    down       up                                  QSFP28 or later         N/A
Ethernet104  1800,1801,1802,1803,1804,1805,1806,1807     400G   9100    N/A    etp13  routed    down       up                                  QSFP28 or later         N/A
Ethernet112  1552,1553,1554,1555,1556,1557,1558,1559     400G   9100    N/A    etp14  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
Ethernet120  1544,1545,1546,1547,1548,1549,1550,1551     400G   9100    N/A    etp15  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
Ethernet128  1296,1297,1298,1299,1300,1301,1302,1303     400G   9100    N/A    etp16  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
Ethernet136  1288,1289,1290,1291,1292,1293,1294,1295     400G   9100    N/A    etp17  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
Ethernet144  1280,1281,1282,1283,1284,1285,1286,1287     400G   9100    N/A    etp18  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
Ethernet152  1032,1033,1034,1035,1036,1037,1038,1039     400G   9100    N/A    etp19  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
Ethernet160          264,265,266,267,268,269,270,271     400G   9100    N/A    etp20  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A
Ethernet168          272,273,274,275,276,277,278,279     400G   9100    N/A    etp21  routed      up       up  QSFP-DD Double Density 8X Pluggable Transceiver         N/A



root@sonic:/home/cisco# show lldp table
Capability codes: (R) Router, (B) Bridge, (O) Other
LocalPort    RemoteDevice    RemotePortID       Capability    RemotePortDescr
-----------  --------------  -----------------  ------------  -----------------
Ethernet16   sonic           b0:c5:3c:3e:84:00  BR            Ethernet24
Ethernet24   sonic           b0:c5:3c:3e:84:00  BR            Ethernet16
Ethernet32   sonic           b0:c5:3c:3e:84:00  BR            Ethernet200
Ethernet48   sonic           b0:c5:3c:3e:84:00  BR            Ethernet56
Ethernet56   sonic           b0:c5:3c:3e:84:00  BR            Ethernet48
Ethernet64   sonic           b0:c5:3c:3e:84:00  BR            Ethernet72
Ethernet72   sonic           b0:c5:3c:3e:84:00  BR            Ethernet64
Ethernet80   sonic           b0:c5:3c:3e:84:00  BR            Ethernet88
Ethernet88   sonic           b0:c5:3c:3e:84:00  BR            Ethernet80
Ethernet112  sonic           b0:c5:3c:3e:84:00  BR            Ethernet120
Ethernet120  sonic           b0:c5:3c:3e:84:00  BR            Ethernet112
Ethernet128  sonic           b0:c5:3c:3e:84:00  BR            Ethernet136
Ethernet136  sonic           b0:c5:3c:3e:84:00  BR            Ethernet128
Ethernet144  sonic           b0:c5:3c:3e:84:00  BR            Ethernet152
Ethernet152  sonic           b0:c5:3c:3e:84:00  BR            Ethernet144
Ethernet160  sonic           b0:c5:3c:3e:84:00  BR            Ethernet168
Ethernet168  sonic           b0:c5:3c:3e:84:00  BR            Ethernet160
Ethernet176  sonic           b0:c5:3c:3e:84:00  BR            Ethernet184
Ethernet184  sonic           b0:c5:3c:3e:84:00  BR            Ethernet176
Ethernet200  sonic           b0:c5:3c:3e:84:00  BR            Ethernet32
Ethernet208  sonic           b0:c5:3c:3e:84:00  BR            Ethernet216
Ethernet216  sonic           b0:c5:3c:3e:84:00  BR            Ethernet208
--------------------------------------------------

@prgeor prgeor merged commit 604e454 into sonic-net:master Oct 1, 2024
5 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-platform-daemons that referenced this pull request Oct 1, 2024
sonic-net#533)

* Enhance media_settings_parser for 100G xcvr and DPB etc

* Revert space change

* Cover corner cases

* Change log message level

* Fix docstring and update name of get_speed_lane_count_and_subport

* Address comment

* Change to re.fullmatch for lane_speed key
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #543

mssonicbld pushed a commit that referenced this pull request Oct 1, 2024
#533)

* Enhance media_settings_parser for 100G xcvr and DPB etc

* Revert space change

* Cover corner cases

* Change log message level

* Fix docstring and update name of get_speed_lane_count_and_subport

* Address comment

* Change to re.fullmatch for lane_speed key
longhuan-cisco added a commit to longhuan-cisco/sonic-platform-daemons that referenced this pull request Oct 3, 2024
sonic-net#533)

* Enhance media_settings_parser for 100G xcvr and DPB etc

* Revert space change

* Cover corner cases

* Change log message level

* Fix docstring and update name of get_speed_lane_count_and_subport

* Address comment

* Change to re.fullmatch for lane_speed key
yxieca pushed a commit that referenced this pull request Oct 3, 2024
#533) (#545)

* Enhance media_settings_parser for 100G xcvr and DPB etc

* Change to re.fullmatch for lane_speed key
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.

9 participants