-
Notifications
You must be signed in to change notification settings - Fork 543
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
[orchagent] Init field of supported speeds while port initialization #1622
base: master
Are you sure you want to change the base?
Conversation
orchagent/portsorch.cpp
Outdated
auto supp_speed_temp = getSupportedSpeed(port.m_alias, port.m_port_id); | ||
/* Copy the vector to be able to modify it */ | ||
auto supp_speed(supp_speed_temp); | ||
if (supp_speed.size() > 0) { |
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.
{ -> new line
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.
Done.
orchagent/portsorch.cpp
Outdated
sort(supp_speed.begin(), supp_speed.end()); | ||
|
||
string tmp_supp_speed_str = ""; | ||
/* Add (cound - 1) elements to the string with separator*/ |
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.
count - typo
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.
Done.
@dgsudharsan , can you review this? |
We also get the list of allowed speeds from platform.json eg ("breakout_modes": "1x100G[50G,40G,25G,10G],2x50G[40G,25G,10G]") The hardware supported speeds would be generally more than the allowable speeds listed in platform.json (which are the platform validated ones). Shouldn't we be using this instead of fetching from the hardware and using it as valid speeds? |
I am not sure about using of configuration of Breakout Mode feature for supported speed determination purpose. Is it a good idea to establish dependencies between those features? What if the Breakout Mode configuration parameters will not be provided in |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
Hi, A capability file for a platform with port breakout capabilities is provided. It defines the initial configurations like lanes, speed, alias etc. This file will be used for CLI later to pick the parent port and breakout mode. It can be used for speed checks based on the current mode. It (in conjunction with hwsku.json talked later) will also replace the functionality of the current existing port_config.ini. Speeds in the breakout modes will be used for speed validation when we change the individual ports speed later. Eg, In 4x25G[10G] mode, we can change the individual port in that port group to 25G or 10G, but not some other speeds. |
@zhenggen-xu Please decide if this PR is needed given that port breakout handles the speed checks |
I think we could keep both speed checks to get more protection. orchagent check is based on ASIC SAI for ports, and breakout mode and platform.json should be more restrict since the speed was based on the platform (not just ASIC) capabilities and breakout mods. In general, breakout speed check is better. However, not all platforms have adopted the breakout design, and meanwhile having backend SAI checks won't be conflicting with that and can provide protection to some extend before all platforms are onboarded with breakout feature. |
@zhenggen-xu, so, if my understanding is correct, we could use this solution as a temporary, till breakout feature will be completely integrated to all the platforms? @prsunny, could you check the comment from @zhenggen-xu? |
Fine with me. @zhenggen-xu, can we take up breakout later? |
We will make the check in CLI if dynamic breakout (DPB) is utilized, it is up to box vendor to onboard the platform with DPB feature. |
@prsunny, is there any updates regarding the PR? |
@prsunny - Do you have an update for this PR ? |
can you please rebase? Also @zhenggen-xu to signoff |
@maksymbelei95 Is there any update on this PR? |
Rebase sonic-net#1622 to master Signed-off-by: Mykola Horb <mykola_horb@jabil.com>
* Reading of supported speed list from the ASIC and saving it inside PORT_TABLE:EthernetXX table in APPL_DB to be able to check supported speeds while changing a current speed through CLI commands. Signed-off-by: Maksym Belei <Maksym_Belei@jabil.com>
/AzurePipelines run |
Commenter does not have sufficient privileges for PR 1622 in repo Azure/sonic-swss |
@prsunny , @zhenggen-xu please review it |
orchagent/portsorch.cpp
Outdated
@@ -1783,21 +1783,73 @@ bool PortsOrch::setHostIntfsStripTag(Port &port, sai_hostif_vlan_tag_t strip) | |||
return true; | |||
} | |||
|
|||
bool PortsOrch::isSpeedSupported(const std::string& alias, sai_object_id_t port_id, sai_uint32_t speed) | |||
const PortSupportedSpeeds& PortsOrch::getSupportedSpeed(const std::string& alias, sai_object_id_t port_id) |
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.
This function seemed to share a lot code with void PortsOrch::getPortSupportedSpeeds(), can we re-use the code by introduce some common function block?
Can you update the PR with the changes so they could be reviewed here? |
@zhenggen-xu, Could you please review the latest changes? |
@pshulik @KonstiantynHalushka As mentioned above, please update the PR itself instead of sharing commits from different places so we can review the finial code here. |
@zhenggen-xu @prsunny Sorry for the wrong update of the PR. Please, review the finial code. |
orchagent/portsorch.cpp
Outdated
if (!m_portSupportedSpeeds.count(port_id)) | ||
{ | ||
PortSupportedSpeeds supported_speeds; | ||
getPortSupportedSpeeds(alias, port_id, &supported_speeds); |
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.
should be getPortSupportedSpeeds(alias, port_id, supported_speeds);
?
// This method will return false if we get a list of supported speeds and the requested speed | ||
// is not supported | ||
// Otherwise the method will return true (even if did not receive list of supported 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.
Since we removed initPortSupportedSpeeds
in this function, just want to make sure initPortSupportedSpeeds
was called always before calling this function.
… function, since when calling isSpeedSupported, you need to initialize m_portStateTable if it has not already been done Signed-off-by: KonstiantynHalushka <Konstiantyn_Halushka@gabil.com>
@zhenggen-xu I accepted your comments |
Just checked the PR again, I failed to understand the reason we introduce the new functions and code to collect the speeds. Isn't that done in the existing function Sorry for being late for these findings, or maybe I am missing something here? |
Hi zhenggen-xu |
The port speeds were obtained by SAI API CALLs which should not care about optical transceivers. This is purely ASIC capabilities, and we can just reuse the same support speeds as got during init time? |
The latest version of pyroute2 introduce breaking change
PORT_TABLE:EthernetXX table in APPL_DB to be able to check supported
speeds while changing a current speed through CLI commands.
Signed-off-by: Maksym Belei Maksym_Belei@jabil.com
What I did
New field
"supp_speed"
in eachPORT_TABLE:EthernetXX
table inside APPL_DB have started to initialize while initialization of Ethernet ports. The field will contain list of supported by the port speeds, like"1000,10000,50000,10000"
.If there was something wrong during reading information regarding supported speeds from ASIC, the field will not be preset in the table of APPL_DB. This situation should be properly handled in sonic-net/sonic-utilities#1395.
Why I did it
To provide information to sonic-utilities regarding supported speeds of all the Ethernet ports.
How I verified it
redis-cli -n 0
KEYS *
PORT_TABLE:
prefix and executeHGETALL PORT_TABLE:EthernetXX
"supp_speed"
(if there were no errors during reading the information from ASIC), like thisDetails if related
Related PRs:
sonic-net/sonic-utilities#1395
sonic-net/sonic-utilities#1391