sonic-net / sonic-platform-daemons

Platform module daemons for SONiC
Other
23 stars 152 forks source link

Add speed media key for non CMIS cable #512

Closed Junchao-Mellanox closed 3 weeks ago

Junchao-Mellanox commented 3 months ago

Description

There is a function get_media_settings_key in media_settings_parser.py which is used to extract media setting keys for a given module. The key contains 3 parts: vendor key, media key, speed lane key.

  1. Currently, speed lane key for non CMIS module is always None. For a given module, it could apply different media setting values when it is working on different speed. So, we need to add speed lane key for non CMIS module.

  2. Currently, media key for non CMIS module does not consider the "Extended Specification Compliance". So, the media key could be something like "QSFP+-Extended-255M" or "QSFP+-Unknown-255M", this media key is not good enough. This PR also extends the media key.

Motivation and Context

Add media key and speed key for non CMIS cable.

How Has This Been Tested?

unit test

Additional Information (Optional)

HaiHuang008 commented 3 months ago

Hi @Junchao-Mellanox, I'm also keeping an eye on this issue. I have a few minor suggestions regarding this.
For the get_lane_speed_key method, the application advertisement in some optical modules does not fully display the supported speeds, so I think it is worth considering having a default lane speed key (via port speed / lane_count ). Return lane_speed_key as a list allows more flexibility and compatibility. You can refer to my patch:media_settings_parser.patch

Junchao-Mellanox commented 3 months ago

Hi @prgeor , @mihirpat1 , could you please review @HaiHuang008 's suggestion? It looks good to me.

liat-grozovik commented 2 months ago

Hi @prgeor , @mihirpat1 , could you please review @HaiHuang008 's suggestion? It looks good to me.

kindly reminder as this is needed also for 202405

prgeor commented 2 months ago

Hi @Junchao-Mellanox, I'm also keeping an eye on this issue. I have a few minor suggestions regarding this. For the get_lane_speed_key method, the application advertisement in some optical modules does not fully display the supported speeds, so I think it is worth considering having a default lane speed key (via port speed / lane_count ). Return lane_speed_key as a list allows more flexibility and compatibility. You can refer to my patch:media_settings_parser.patch

@HaiHuang008 You mean some CMIS cable don't advertise application speed?

HaiHuang008 commented 1 month ago

@prgeor Yes, some cables do not advertise application speed.

prgeor commented 1 month ago

@prgeor Yes, some cables do not advertise application speed.

@HaiHuang008 How does the host then know which application to load?

Junchao-Mellanox commented 3 weeks ago

close this one, since there is a similar PR https://github.com/sonic-net/sonic-platform-daemons/pull/533