Skip to content

[docker-orchagent][201911] Pass ASIC vendor information to swss docker as docker level environment variable #8274

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

Merged
merged 2 commits into from
Sep 13, 2021

Conversation

stephenxs
Copy link
Collaborator

Why I did it

Recently, the reserved buffer of admin-down ports is going to be reclaimed.
However, the way to do this differs among vendors.
We need to find a way to pass vendor information to swss docker.

Signed-off-by: Stephen Sun [email protected]

How I did it

Fetch the ASIC vendor information when the docker is created and pass it to the docker as environment variable ASIC_VENDOR.

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

…nt variable

Motivation:
Recently, the reserved buffer of admin-down ports is going to be reclaimed.
However, the way to do this differs among vendors.
We need to find a way to pass vendor information to swss docker.
Implementation:
Fetch the ASIC vendor information when the docker is created and pass it to docker as ASIC_VENDOR

Signed-off-by: Stephen Sun <[email protected]>
@stephenxs stephenxs changed the title [docker-orchagent] Pass ASIC vendor information to swss docker as docker level environment variable [docker-orchagent][201911] Pass ASIC vendor information to swss docker as docker level environment variable Jul 28, 2021
@stephenxs stephenxs requested a review from abdosi July 28, 2021 15:48
@@ -245,6 +245,11 @@ start() {
echo "Creating new {{docker_container_name}}$DEV container with HWSKU $HWSKU"
{%- endif %}

{%- if docker_container_name == "swss" %}
# Obtain the vendor name
ASIC_VENDOR=`$SONIC_CFGGEN -y /etc/sonic/sonic_version.yml -v asic_type`
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the 'sonic_asic_platform' var instead of defining "ASIC_VENDOR"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed.

Copy link
Collaborator

@qiluo-msft qiluo-msft Jul 29, 2021

Choose a reason for hiding this comment

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

I agree with @neethajohn 's suggestion and it should go to master, 202012 and later branches. So please fix on master first, and then cherry-pick. If cherry-pick does not work, we can continue review here after master commit merged.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@qiluo-msft PR to master created #8361

@stephenxs stephenxs requested a review from neethajohn July 29, 2021 01:04
@qiluo-msft
Copy link
Collaborator

qiluo-msft commented Jul 29, 2021

You can get the info from inside swss container

sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type

If you still want to add a PR, could you add the feature on master first and request a cherry-pick?


In reply to: 888778587


In reply to: 888778587


In reply to: 888778587

@stephenxs
Copy link
Collaborator Author

You can get the info from inside swss container

sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type

If you still want to add a PR, could you add the feature on master first and request a cherry-pick?

Thanks, Qi.
I think fetching it once when the container is created is better than fetching it every time the daemon starts in swss container.
In 202012 and above, we have similiar logic.

@lguohan
Copy link
Collaborator

lguohan commented Jul 29, 2021

what is the motivation to move expose asic vendor to swss docker?

@neethajohn
Copy link
Contributor

what is the motivation to move expose asic vendor to swss docker?

Related to the comments in sonic-net/sonic-swss#1837

@stephenxs stephenxs marked this pull request as ready for review September 1, 2021 05:58
@qiluo-msft qiluo-msft merged commit 17948d0 into sonic-net:201911 Sep 13, 2021
@stephenxs stephenxs deleted the reclaim-201911 branch September 13, 2021 09:44
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.

5 participants