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

minigraph: Add the ability to set a per-port speed in the minigraph #3527

Merged
merged 2 commits into from
May 28, 2021

Conversation

saiarcot895
Copy link
Contributor

@saiarcot895 saiarcot895 commented May 25, 2021

Signed-off-by: Saikrishna Arcot saiarcot895@gmail.com

Description of PR

In the case of devices with mixed port speeds, the speed for each port
has to be individually specified in the minigraph, and a single speed
for the entire device cannot be used. Instead, read the connection
graph, which contains the speed for each individual link, and use the
speed specified there for each port.

The speed specified in the connection graph is used only if
port_config.ini doesn't have a speed specified there. If there is a speed
specified there, then that is used.

If no speed is specified in port_config.ini, and there's no speed specified
for the port in the connection graph, then the speed in the inventory
yaml file is used.

Type of change

  • Bug fix

  • Testbed and Framework(new/improvement)

  • Test case(new/improvement)

    Testing done

Generated minigraph with and without this change for most of our internal testbeds (str and str2), as well as vms-s6000-t0. Verified that all of the generated minigraphs remained the same with this change, and that there are no minigraphs that are not getting successfully generated that were getting generated before this change.

Also verified that with a non-default speed in the connection graph data (i.e. a speed for one port that was different than the speed for the other ports), that speed correctly got populated in the minigraph.

In the case of devices with mixed port speeds, the speed for each port
has to be individually specified in the minigraph, and a single speed
for the entire device cannot be used. Instead, read the connection
graph, which contains the speed for each individual link, and use the
speed specified there for each port.

If a port/link isn't specified in the connection graph, then the speed
for each port in port_config.ini is still used. If no speed is specified
there, then the speed in the inventory yaml file is used.

Signed-off-by: Saikrishna Arcot <saiarcot895@gmail.com>
@lgtm-com
Copy link

lgtm-com bot commented May 25, 2021

This pull request introduces 1 alert when merging 3c13ea7 into 1a28408 - view on LGTM.com

new alerts:

  • 1 for Unused import

@yxieca
Copy link
Collaborator

yxieca commented May 25, 2021

@saiarcot895 please address the LGTM warning

@yxieca yxieca requested a review from bingwang-ms May 25, 2021 05:32
Copy link
Collaborator

@yxieca yxieca left a comment

Choose a reason for hiding this comment

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

waiting for Bing's comments

Instead of getting and using the connection graph data in port_alias.py,
use it instead in the template file, and add a new ansible task to load
in the connection graph data. This keeps port_alias.py strictly for
loading in the port_config.ini data, and instead moves the speed
selection logic into the template file.

Signed-off-by: Saikrishna Arcot <saiarcot895@gmail.com>
@saiarcot895 saiarcot895 merged commit cef1f77 into sonic-net:master May 28, 2021
saiarcot895 added a commit to saiarcot895/sonic-mgmt that referenced this pull request Jun 1, 2021
…onic-net#3527)

* minigraph: Add the ability to set a per-port speed in the minigraph

In the case of devices with mixed port speeds, the speed for each port
has to be individually specified in the minigraph, and a single speed
for the entire device cannot be used. Instead, read the connection
graph, which contains the speed for each individual link, and use the
speed specified there for each port.

The speed specified in the connection graph is used only if
port_config.ini doesn't have a speed specified there. If there is a speed
specified there, then that is used.

If no speed is specified in port_config.ini, and there's no speed specified
for the port in the connection graph, then the speed in the inventory
yaml file is used.

Signed-off-by: Saikrishna Arcot <saiarcot895@gmail.com>
(cherry picked from commit cef1f77)
saiarcot895 added a commit that referenced this pull request Jun 2, 2021
* minigraph: Add the ability to set a per-port speed in the minigraph (#3527)

* minigraph: Add the ability to set a per-port speed in the minigraph

(cherry picked from commit cef1f77)

* minigraph: Fix with_dict syntax in the playbook

That entry needs to be specified as referring to a variable.

Signed-off-by: Saikrishna Arcot <saiarcot895@gmail.com>

* [topo] Add test topology for 7050QX-32S-S4Q31 (#3568)

(cherry picked from commit 6d1720b)
vmittal-msft pushed a commit to vmittal-msft/sonic-mgmt that referenced this pull request Sep 28, 2021
…onic-net#3527)

* minigraph: Add the ability to set a per-port speed in the minigraph

In the case of devices with mixed port speeds, the speed for each port
has to be individually specified in the minigraph, and a single speed
for the entire device cannot be used. Instead, read the connection
graph, which contains the speed for each individual link, and use the
speed specified there for each port.

The speed specified in the connection graph is used only if
port_config.ini doesn't have a speed specified there. If there is a speed
specified there, then that is used.

If no speed is specified in port_config.ini, and there's no speed specified
for the port in the connection graph, then the speed in the inventory
yaml file is used.

Signed-off-by: Saikrishna Arcot <saiarcot895@gmail.com>
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.

4 participants