-
Notifications
You must be signed in to change notification settings - Fork 163
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
Retrieve subport from CONFIG_DB to enable breakout support #342
Retrieve subport from CONFIG_DB to enable breakout support #342
Conversation
Signed-off-by: Mihir Patel <[email protected]>
…daemons into channel_breakout_support
@prgeor @jaganbal-a @keboliu @shyam77git - It will be great if you can help in reviewing this PR |
@shyam77git @jaganbal-a please review |
@keboliu please review |
how the 4x10 or 4x25 breakout is taken cared for 100G/40G module ? |
…be inline with CMIS spec
The API get_cmis_application_desired will return the application ID by matching the speed and number of active host lanes from CONFIG_DB. This application ID will then be used by get_cmis_host_lanes function to find the appropriate active host lanes. |
get_cmis_host_lanes() is not supposed to be invoked for non-CMIS module isn't it ? |
Yes, get_cmis_host_lanes() will not be invoked for non-CMIS module. |
@mihirpat1 , @prgeor
|
@mihirpat1
|
Wanted to keep following comment separate from above UT comment: |
@mihirpat1 #config interface breakout <interface_name> |
sonic-xcvrd/xcvrd/xcvrd.py
Outdated
@@ -1121,7 +1159,7 @@ def is_cmis_application_update_required(self, api, channel, speed): | |||
if speed == 0 or channel == 0 or api.is_flat_memory(): | |||
return False | |||
|
|||
app_new = self.get_cmis_application_desired(api, channel, speed) | |||
app_new = self.get_cmis_application_desired(api, host_lane_count, speed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- current logic checks for all 8 host lanes whereas we should care for the requested host lanes only
- Also we should make use of the selected/desired application during init state and compare it with the current active application
- Also we should check for DP != Activated early in the function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Removed unwanted parameter for is_cmis_application_update_required 3. Changed channel to host_lanes_mask in multiple functions to avoid confusion 4. Reading application code and host_lanes_mask as part of just CMIS_STATE_INSERTED
In the Notes, "Once the port_config.ini file has a new column for channel, the CONFIG_DB will be updated with the corresponding channel values (requires minigraph reload though)." I am a bit of concern that to extend "port_config.ini" for this purpose, AFAIK, "platform.json" was introduced for the dynamic port breakout, I think we should consider extending it instead of "port_config.ini". |
@keboliu we can remove the reference to port_config.ini as its not relevant to this Xcvrd changes. Please see my email. |
As I commented in PR, sonic-net/SONiC#1290 Using 'channel' to refer to a 'sub-port' is misleading. XCVRD is mainly dealing with optical cables. In the optical cables context, 'channel' is a concept which already widely used and has a clear definition, we even have SONiC platform APIs defined to handle optical cable 'channels'. I suggest to use use another name to avoid confusion. Another point is that not sure the 'channel' number should be provided explicitly from some configuration, can it be deduced by some logic? It's shouldn't be too complicated. |
I believe that instead of explicitly giving the subport/channel info in port_config.ini it should be derived from the existing information in port_config.ini (i.e.) we have defined the rules for "name" , "alias" and "index". Same convention should be following in DPB as well. If there is difference in DPB with the above rules, it should be addressed in the DPB document to match it. If we diverge here then we will have to do the same additional information in DPB as well. |
As discussed, having a logic in xcvrd to calculate subport info introduces dependencies on neighboring subports belonging to the same physical group. This also relies on the fact that redis-db will always populate info for all subports in a physical port group before xcvrd actually starts using info for a subport. |
sonic-xcvrd/xcvrd/xcvrd.py
Outdated
host_lane_count: | ||
Integer, number of lanes on the host side | ||
subport: | ||
Integer, subport id of the group which the host lanes belong to (1 based), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihirpat1 subport:
1-based logical port number of the physical port after breakout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in the new diff now.
@yxieca please help cherry pick to 202205 |
Retrieve subport from CONFIG_DB to enable breakout support --------- Signed-off-by: Mihir Patel <[email protected]>
Based on the port breakout HLD, we are now using subport instead of channel in the CONFIG_DB PORT table to handle port breakout. The yang schema needs to be modified accordingly to handle the corresponding change. The corresponding code changes have been merged through sonic-net/sonic-platform-daemons/pull/342 merged Signed-off-by: Mihir Patel <[email protected]>
Retrieve subport from CONFIG_DB to enable breakout support --------- Signed-off-by: Mihir Patel <[email protected]>
…14519) Based on the port breakout HLD, we are now using subport instead of channel in the CONFIG_DB PORT table to handle port breakout. The yang schema needs to be modified accordingly to handle the corresponding change. The corresponding code changes have been merged through sonic-net/sonic-platform-daemons/pull/342 merged Signed-off-by: Mihir Patel <[email protected]>
…14519) Based on the port breakout HLD, we are now using subport instead of channel in the CONFIG_DB PORT table to handle port breakout. The yang schema needs to be modified accordingly to handle the corresponding change. The corresponding code changes have been merged through sonic-net/sonic-platform-daemons/pull/342 merged Signed-off-by: Mihir Patel <[email protected]>
The changes with this PR needs to be merged along with sonic-net/sonic-platform-common#352
Description
Currently, xcvrd has a fixed logic to calculate active host lanes for a port. This needs to be changed to support ports with breakout cable.
Motivation and Context
The fixed host lane mapping will now be replaced by reading the subport from the CONFIG_DB. The subport will then be used to calculate active host lanes by reading the Application Descriptors.
Finding the desired application
The HostInterfaceID and HostLaneCount from Application Descriptors will be used to find the desired application for the port with breakout cable by comparing these with speed and lanes retrieved from CONFIG_DB.
Finding active host lane
Once the desired application is found, the HostLaneAssignmentOptions (bitmap of active host lanes) for the corresponding application and the subport from CONFIG_DB will be used to find the active host lanes.
In addition to the above, check_datapath_init_pending is now being called after ConfigStatusLane register has the value "ConfigSuccess". This has been done to be inline with the CMIS spec.
Note
Once the port_config.ini file has a new column for subport, the CONFIG_DB will be updated with the corresponding subport values (requires minigraph reload though).
The field "subport" will have the below value:
0 - This means the xcvr in non-breakout type
non-zero - The value here corresponds to the subport group (formed by a group of active lanes) to which the port belongs to
How Has This Been Tested?
Testcase summary
The value of host_lanes can be seen in the logs by finding lanemask.
400G related TCs
200G breakout related TCs - 200G side
200G breakout related TCs - 100G side
SFP EEPROM dump
show int status
LLDP o/p
Log dump for CMIS init
Shut/no shut on subports (200G and 100G sides)
config reload (of Fixed chassis) with both native and break-out optics inserted
reboot (of Fixed chassis) with both native and break-out optics inserted
Remove and re-insert 2x100G break-out optic at run-time (system running)
xcvrd restart - Ensure link flap is not seen
PMON restart - Ensure link flap is not seen
SWSS restart
SYNCD restart
CONFIG_DB for a port after adding subport to port_config.ini
For additional details, please refer to Unit-test_breakout_channel_v5.txt
The code changes have been tested on a chassis with 200G AOC breakout cable.
Also, the code changes have been tested on a chassis with 400ZR transceiver and 10GBase-SR
Additional Information (Optional)