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

Add third generic media tuning key to search for (medium+lane) #591

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bobbymcgonigle
Copy link

Description

This change searches for a third generic key that covers medium type + lane speed. This will cover all Arista usecases as at Arista out tuning values are based off medium type + lane speed. Of course this will work for all vendors if they choose to do so. The consequence of this is that on bringup Arista can upload a single media_settings.json which will cover every possible speed and lane combination. Any users of our SKUs will not need to ever ask for updates to cover new optics, speeds etc.

Note if there is no xcvr present we will assume copper; this will cover internal phy to external phy connection, as well as any backplane links.

The new flow will look like: (Addition to current flow in green)
medium-speed-key

Motivation and Context

The current implementation of the the dynamic media tuning feature requires that you know either:

  1. Vendor Key E.g. AMPHENOL-1234
  2. Media Key E.g. QSFP28-40GBASE-CR4-1M

This is too specific. For example consider the following case. I am using QSFP-DDs, but last minute before deployment I change vendors and use QSFPs - now I need the vendor like Arista to upstream a new PR that includes different or even the same tuning values but with a new vendor/media key to match against. Same scenario if we change from DACs to optics last minute.

We can make this more generic by adding a third key that is a combination of physical medium (copper or optical) and lane speed (E.g. 400g-8 is 50000, 100g-4 is 25000).

This key can be easily derived in xcvrd because

  1. cmis spec can tell us if it is copper or optical
  2. We can easily derive the lane speed from config

This means that we can now have 1 media_settings.json file that can cover all scenarios. It does the check after Vendor+Media key - so you can still have very specific values if you want to take precedence over the generic.

How Has This Been Tested?

Added a new media_settings.json for Arista QuicksilverP with the following entries per port:

"PORT_MEDIA_SETTINGS": {
    "1": {
        "COPPER25000": {
            "main": {
                "lane0": "0x6b",
                "lane1": "0x6b",
                "lane2": "0x6b",
                "lane3": "0x6b",
                "lane4": "0x6b",
                "lane5": "0x6b",
                "lane6": "0x6b",
                "lane7": "0x6b"
               ...
             },
             "COPPER50000": {
                ...
             }
              "OPTICAL100000": {
                ...
             }
              "OPTICAL25000": {
               ...
             }

Changing speeds and doing xcvr swap I can see that the different and correct values are applied in APPL_DB. I also added a print to xcvrd to show what keys it looks for at different speeds and xcvr types:

{'vendor_key': 'ARISTA NETWORKS -CAB-O-O-400G-1M ', 'media_key': 'OSFP-8X-passive_copper_media_interface-1.0M', 'lane_speed_key': 'speed:400G', 'medium_lane_speed_key': 'COPPER50000'}
found COPPER50000 in media_dict for physical port 16
{'vendor_key': 'ARISTA NETWORKS -CAB-O-O-400G-1M ', 'media_key': 'OSFP-8X-passive_copper_media_interface-1.0M', 'lane_speed_key': 'speed:400G', 'medium_lane_speed_key': 'COPPER50000'}
found COPPER50000 in media_dict for physical port 23
{'vendor_key': 'ARISTA NETWORKS -CAB-O-O-400G-1M ', 'media_key': 'OSFP-8X-passive_copper_media_interface-1.0M', 'lane_speed_key': 'speed:400G', 'medium_lane_speed_key': 'COPPER50000'}
found COPPER50000 in media_dict for physical port 15
{'vendor_key': 'ARISTA NETWORKS -CAB-O-O-400G-1M ', 'media_key': 'OSFP-8X-passive_copper_media_interface-1.0M', 'lane_speed_key': 'speed:400G', 'medium_lane_speed_key': 'COPPER50000'}
found COPPER50000 in media_dict for physical port 10
{'vendor_key': 'ARISTA NETWORKS -OSFP-400G-PLR4  ', 'media_key': 'OSFP-8X-sm_media_interface', 'lane_speed_key': 'speed:400GAUI-8', 'medium_lane_speed_key': 'OPTICAL50000'}
found OPTICAL50000 in media_dict for physical port 21
{'vendor_key': 'ARISTA NETWORKS -CAB-O-O-400G-1M ', 'media_key': 'OSFP-8X-passive_copper_media_interface-1.0M', 'lane_speed_key': 'speed:400G', 'medium_lane_speed_key': 'COPPER50000'}
found COPPER50000 in media_dict for physical port 29
{'vendor_key': 'ARISTA NETWORKS -OSFP-800G-2XDR4 ', 'media_key': 'OSFP-8X-sm_media_interface', 'lane_speed_key': None, 'medium_lane_speed_key': 'OPTICAL50000'}
found OPTICAL50000 in media_dict for physical port 13
{'vendor_key': 'ARISTA NETWORKS -OSFP-800G-2XDR4 ', 'media_key': 'OSFP-8X-sm_media_interface', 'lane_speed_key': 'speed:100GAUI-1-L', 'medium_lane_speed_key': 'OPTICAL100000'}
found OPTICAL100000 in media_dict for physical port 1
{'vendor_key': 'ARISTA NETWORKS -CAB-O-O-400G-1M ', 'media_key': 'OSFP-8X-passive_copper_media_interface-1.0M', 'lane_speed_key': 'speed:400G', 'medium_lane_speed_key': 'COPPER50000'}
found COPPER50000 in media_dict for physical port 40
{'vendor_key': 'ARISTA NETWORKS -OSFP-400G-FR4   ', 'media_key': 'OSFP-8X-sm_media_interface', 'lane_speed_key': 'speed:400GAUI-8', 'medium_lane_speed_key': 'OPTICAL50000'}
found OPTICAL50000 in media_dict for physical port 8
{'vendor_key': 'ARISTA NETWORKS -CAB-O-O-400G-1M ', 'media_key': 'OSFP-8X-passive_copper_media_interface-1.0M', 'lane_speed_key': 'speed:400G', 'medium_lane_speed_key': 'COPPER50000'}
found COPPER50000 in media_dict for physical port 62
{'vendor_key': 'ARISTA NETWORKS -OSFP-400G-SR8   ', 'media_key': 'OSFP-8X-nm_850_media_interface', 'lane_speed_key': 'speed:400GAUI-8', 'medium_lane_speed_key': 'OPTICAL50000'}
found OPTICAL50000 in media_dict for physical port 32
{'vendor_key': 'ARISTA NETWORKS -OSFP-800G-2XDR4 ', 'media_key': 'OSFP-8X-sm_media_interface', 'lane_speed_key': None, 'medium_lane_speed_key': 'OPTICAL50000'}
found OPTICAL50000 in media_dict for physical port 35
{'vendor_key': 'ARISTA NETWORKS -CAB-O-O-400G-1M ', 'media_key': 'OSFP-8X-passive_copper_media_interface-1.0M', 'lane_speed_key': 'speed:400G', 'medium_lane_speed_key': 'COPPER50000'}
found COPPER50000 in media_dict for physical port 38
{'vendor_key': 'ARISTA NETWORKS -OSFP-400G-DR4   ', 'media_key': 'OSFP-8X-sm_media_interface', 'lane_speed_key': 'speed:400GAUI-8', 'medium_lane_speed_key': 'OPTICAL50000'}
found OPTICAL50000 in media_dict for physical port 55
{'vendor_key': 'ARISTA NETWORKS -CAB-O-O-400G-1M ', 'media_key': 'OSFP-8X-passive_copper_media_interface-1.0M', 'lane_speed_key': 'speed:400G', 'medium_lane_speed_key': 'COPPER50000'}
found COPPER50000 in media_dict for physical port 37
{'vendor_key': 'ARISTA NETWORKS -AOC-O-O-400G-1M ', 'media_key': 'OSFP-8X-active_cable_media_interface', 'lane_speed_key': 'speed:400GAUI-8', 'medium_lane_speed_key': 'OPTICAL50000'}
found OPTICAL50000 in media_dict for physical port 57
{'vendor_key': 'ARISTA NETWORKS -AOC-O-O-400G-1M ', 'media_key': 'OSFP-8X-active_cable_media_interface', 'lane_speed_key': 'speed:400GAUI-8', 'medium_lane_speed_key': 'OPTICAL50000'}
found OPTICAL50000 in media_dict for physical port 53
{'vendor_key': 'ARISTA NETWORKS -CAB-O-O-400G-1M ', 'media_key': 'OSFP-8X-passive_copper_media_interface-1.0M', 'lane_speed_key': 'speed:400G', 'medium_lane_speed_key': 'COPPER50000'}
found COPPER50000 in media_dict for physical port 46

I also added test cases and made sure other testcases pass tests/test_xcvrd.py unit tests.

Additional Information (Optional)

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prgeor
Copy link
Collaborator

prgeor commented Feb 27, 2025

@bobbymcgonigle seems still in draft?

@bobbymcgonigle
Copy link
Author

@bobbymcgonigle seems still in draft?

Yes, need to make one amendment to my unit testing before taking this out of draft mode. Should be ready for review in the next day

@prgeor
Copy link
Collaborator

prgeor commented Mar 5, 2025

@bobbymcgonigle seems still in draft?

Yes, need to make one amendment to my unit testing before taking this out of draft mode. Should be ready for review in the next day

ok. will review once out of draft

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bobbymcgonigle bobbymcgonigle marked this pull request as ready for review March 5, 2025 21:34
@bobbymcgonigle
Copy link
Author

@bobbymcgonigle seems still in draft?

Yes, need to make one amendment to my unit testing before taking this out of draft mode. Should be ready for review in the next day

ok. will review once out of draft

Hi Prince, I've added the test cases and it's now ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants