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

Update load_minigraph to disable unnecessary services (bgp, lldp...) for fabric asic #1493

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ngoc-do
Copy link

@ngoc-do ngoc-do commented Mar 11, 2021

Fabric asics do not need some services like bgp, lldp, teamd.
They just need database, swss, and syncd running.

Signed-off-by: ngocdo ngocdo@arista.com

What I did

How I did it

I disable them with FEATURE flag configured in CONFIG_DB, which is listened and reacted by hostcfgd.

This PR will update CONFIG_DB's FEATURE for fabric asics. The update is executed in load_minigraph, and saved to config_db.json. So the update will run only once.

If a system has both NPU and fabric, only services running on fabric are disabled. NPU's services are not affected.

One field, always_disabled_on_asics is added to FEATURE's services that we want to disable for fabric asics. For example, bgp@4.service and bgp@5.service will be disabled.

    "FEATURE": {
        "bgp": {
            "state": "enabled",
            "has_timer": "False",
            "has_global_scope": "False",
            "has_per_asic_scope": "True",
            "auto_restart": "enabled",
            "high_mem_alert": "disabled",
            "always_disabled_on_asics": "4,5"
        },
   }

hostcfg will act on that change and disable the services. This is done in another PR at sonic-buildimage,
which is sonic-net/sonic-buildimage#7026.

How to verify it

Tested on our systems with NPU and fabrics.

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

Fabric asics do not need some services like bgp, lldp, teamd.
We are disabling them with FEATURE flag configured in CONFIG_DB,
which is listened and reacted by hostcfgd. This change will
update CONFIG_DB's FEATURE for fabric asics. The update is
executed in load_minigraph, and saved to config_db.json. If a
system has both NPU and fabric, only services running on fabric
are disabled. NPU's services still run.

Signed-off-by: ngocdo <ngocdo@arista.com>
@lguohan
Copy link
Contributor

lguohan commented Mar 11, 2021

need unit test

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