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

Introduce the asic_subtype field for adding the sub platform variants. #10235

Merged
merged 2 commits into from
Mar 28, 2022

Conversation

judyjoseph
Copy link
Contributor

@judyjoseph judyjoseph commented Mar 14, 2022

Why I did it

Introduce the asic_subtype field for adding the sub platform variants.
This is to add broadcom-dnx as a asic subtype of broadcom. For the broadcom XGS type ASIC platforms the asic_subtype will be "broadcom" itsef.

So for DNX platforms
"asic_type": "broadcom",
"asic_subtype": "broadcom-dnx",

XGS platforms
"asic_type": "broadcom",
"asic_subtype": "broadcom",

Related PR : sonic-net/sonic-swss#2178

How I did it

The TARGET_MACHINE variable will contain $($_MACHINE), $($_DEPENDENT_MACHINE) which will have values like broadcom, broadcom-dnx for the different asic types within the $(sonic_asic_platform). This will be used to populate the asic_subtype in sonic_version.yml and inturn into swss_vars

The asic_type will come from the PLATFORM which we use while compilation eg: broadcom. The asic_subtypes will be various $($_MACHINE), $($_DEPENDENT_MACHINE) variables used to compile and get the asic family specific images.

How to verify it

Verified that "sub_platform" environment variable gets populated, when used along with sonic-net/sonic-swss#2178.

root@str-s6000-acs-8:/# cat /etc/sonic/sonic_version.yml 
---
build_version: 'master.0-dirty-20220319.025049'
debian_version: '11.2'
kernel_version: '5.10.0-8-2-amd64'
asic_type: broadcom
asic_subtype: 'broadcom'
commit_id: 'fb7f04614'
branch: 'master'
release: 'none'
build_date: Sat Mar 19 14:03:52 UTC 2022

root@str-s6000-acs-8:/# cat /usr/share/sonic/templates/swss_vars.j2 
{
    "asic_type": "{{ asic_type }}",
    {% if asic_subtype is defined and asic_subtype != '' -%}
    "asic_subtype": "{{ asic_subtype }}",
    {% endif -%}
    "asic_id": "{{ DEVICE_METADATA.localhost.asic_id }}",
    "mac": "{{ DEVICE_METADATA.localhost.mac }}",
    "resource_type": "{{ DEVICE_METADATA.localhost.resource_type }}",
    "synchronous_mode": {% if DEVICE_METADATA.localhost.synchronous_mode == "disable" %}"disable"{% else %}"enable"{% endif %}
}

admin@str-s6000-acs-8:~$ docker exec -it swss bash
root@str-s6000-acs-8:/# sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/swss_vars.j2 
{
    "asic_type": "broadcom",
    "asic_subtype": "broadcom",
    "asic_id": "",
    "mac": "ec:f4:bb:fe:80:84",
    "resource_type": "",
    "synchronous_mode": "enable"}

In case of dnx-based devices 

admin@sonic:~$ cat /etc/sonic/sonic_version.yml 
---
build_version: 'master.0-dirty-20220319.025049'
debian_version: '11.2'
kernel_version: '5.10.0-8-2-amd64'
asic_type: broadcom
asic_subtype: 'broadcom-dnx'
commit_id: 'fb7f04614'
branch: 'master'
release: 'none'
build_date: Sat Mar 19 14:19:24 UTC 2022



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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

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

This is to add broadcom-dnx as a asic subtype of broadcom.
Copy link
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

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

lgtm

@judyjoseph judyjoseph merged commit 8e64284 into sonic-net:master Mar 28, 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.

2 participants