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

Buffers configuration update on port speed change #1250

Merged
merged 9 commits into from
Jan 26, 2018

Conversation

andriymoroz-mlnx
Copy link
Collaborator

@andriymoroz-mlnx andriymoroz-mlnx commented Dec 19, 2017

REVIEW ONLY.
Please do not commit yet.
submodules pointers needs to be updated after related PRs merged

related PRs:
sonic-net/sonic-swss#417
sonic-net/sonic-swss-common#169 (merged)
sonic-net/sonic-utilities#174 (merged)

- What I did
Config files for PG Buffers update on port speed change

- How I did it
See: https://github.com/Azure/SONiC/wiki/Run-Time-Buffers-Configuration-Update-design

- How to verify it
Buffers configuration should exist in Config DB after boot
redis-cli -n 4 keys \* | grep BUFFER

Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
@lguohan
Copy link
Collaborator

lguohan commented Dec 20, 2017

@yxieca to check?

@andriymoroz-mlnx andriymoroz-mlnx changed the title Buffers port speed Buffers configuration update on port speed change Dec 21, 2017
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- if cable_len -%}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you need to test if the list is non-empty, but this test seems to be testing if the list has been defined. Which is defined in line 17 above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right, thanks. I already implemented this in #1263 need to back-merge to this PR as well

{%- endif -%}
{%- endfor -%}
{%- if cable_len -%}
{{ cable_len.0 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Under what circumstances would there be more than one length in the list?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

there should be no more than one value in the list. cable_len.0 is the way to get first (and only) element of the list. All that weird usage of the cable_len list here is the workaround for jinja templates limitation for variables visibility in blocks. Only list or dictionary can be modified in block and maintain that value outside the block.

{%- set neighbor_role = neighbor.type -%}
{%- set roles1 = switch_role + '_' + neighbor_role %}
{%- set roles2 = neighbor_role + '_' + switch_role -%}
{%- if roles1 in ports2cable -%}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have enforcement elsewhere to make sure that the switch_role and neighbor_role's case is as expected?

If we cannot guarantee the case, then we might want to cast the string to upper or lower case, just in case?

Same question for line 27 below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, we don't have case enforcement. Agree, need to convert to common case before the comparison

25000 300m 71680 18432 53248 1
40000 300m 94208 18432 75776 1
50000 300m 94208 18432 75776 1
100000 300m 184320 18432 165888 1
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't see matching code using this look up table. Who is using it where and how?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@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.

The change generally looks good to me, with some minor issues inlined. These comments probably would apply to all commits. I didn't copy them to the next 2.

For converting the old buffer.json file to the new template, if possible, can you come up with a converting tool to take the source file and generate a template?

This tool would be really useful for other platforms under work.

Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
@liatgrozovik
Copy link

following a session on that PR, it is agreed that the tool is nice to have and is not blocking the PR to be merged. But a wiki should be provided inorder to indicate how to convert an old configuration file to the new format. This should be done on another PR.

@andriymoroz-mlnx let's fix the build issues and move on to merge.

Conflicts:
	dockers/docker-orchagent/msn27xx.32ports.buffers.json.j2
	dockers/docker-orchagent/swssconfig.sh
	src/sonic-config-engine/tests/sample_output/msn27.32ports.json
Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
@lguohan
Copy link
Collaborator

lguohan commented Jan 16, 2018

@liatgrozovik , pending on sonic-net/sonic-swss#417, other PRs are merged.

Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
- fixed support of sonic-to-sonic install

Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
@yxieca yxieca merged commit 814e50f into sonic-net:master Jan 26, 2018
yxieca added a commit that referenced this pull request Jan 26, 2018
lguohan pushed a commit that referenced this pull request Jan 26, 2018
abdosi added a commit that referenced this pull request Dec 10, 2020
ccb52454a11e6906bb074d888740d279e4a3c8e3 (HEAD -> 201911, origin/201911) [fast-reboot] Fix fast-reboot when NDP entries are present (#1295)
d09667b86abb7d3cd31b92bedf6e4d4bdac4937f Multi-ASIC support for show ip(v6) route (201911 branch) (#1283)
28399bfcad2a40f1a85095bc679540531c4e673c [201911-Mellanox] SKU creator Tool (#1163) (#1250)

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
abdosi added a commit that referenced this pull request Oct 11, 2021
ce8b1af9d2200c570c102a38e04cbd9659470585 (HEAD -> 201911, origin/201911) const initializer_list is not a constant expression (#1250)
acdb03324fc268f5330d2632a02d0856f35fb880 [201911] Add lgtm.yml (#1901)

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
theasianpianist pushed a commit to theasianpianist/sonic-buildimage that referenced this pull request Feb 5, 2022
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.

4 participants