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

Added Support to runtime render bgp and teamd feature state and lldp has_asic_scope flag #11796

Merged
merged 35 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4766fcf
[submodule update] sonic-db-syncd
abdosi Apr 3, 2021
9746bb3
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 5, 2021
061821d
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 6, 2021
9e61e53
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 21, 2021
5c3a87f
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 28, 2021
5775c20
Merge remote-tracking branch 'upsteam/master'
abdosi May 14, 2021
3c20361
Merge remote-tracking branch 'upsteam/master'
abdosi May 29, 2021
cc1210d
Merge remote-tracking branch 'upsteam/master'
abdosi Aug 17, 2021
7bae398
Merge remote-tracking branch 'upsteam/master'
abdosi Sep 29, 2021
7126f88
Merge remote-tracking branch 'upsteam/master'
abdosi Oct 13, 2021
63c037c
Merge remote-tracking branch 'upsteam/master'
abdosi Nov 17, 2021
2eb13c6
Merge remote-tracking branch 'upsteam/master'
abdosi Dec 28, 2021
6f09dea
Merge remote-tracking branch 'upsteam/master'
abdosi Jan 13, 2022
cec65fc
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 1, 2022
54f0ea3
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 19, 2022
d1eeb39
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 21, 2022
9a3598e
Merge remote-tracking branch 'upsteam/master'
abdosi May 2, 2022
ea7a084
Merge remote-tracking branch 'upsteam/master'
abdosi May 9, 2022
a92b47d
Merge remote-tracking branch 'upstream/master'
abdosi Jul 15, 2022
3baf0b8
Merge remote-tracking branch 'upstream/master'
abdosi Aug 11, 2022
d49e1f0
Merge remote-tracking branch 'upstream/master'
abdosi Aug 16, 2022
dad01cb
Merge remote-tracking branch 'upstream/master'
abdosi Aug 19, 2022
6b3248a
Added Support to runtime render bgp and teamd feature state and lldp
abdosi Aug 19, 2022
1f5b6da
Added Support to runtime render bgp and teamd feature state and lldp
abdosi Aug 19, 2022
53ab35e
Modified the Yang model files to support the has_per_asic_scope as st…
mlok-nokia Oct 14, 2022
9dcbafc
Merge remote-tracking branch 'upstream/master' into feature_init
abdosi Nov 5, 2022
90776d0
Merge branch 'feature_init' of https://github.com/abdosi/sonic-buildi…
abdosi Nov 5, 2022
8b0c2f1
Resolve Conflict
abdosi Nov 5, 2022
4bd4c19
Merge remote-tracking branch 'upstream/master' into feature_init
abdosi Nov 7, 2022
5f0e8b7
Merge remote-tracking branch 'upstream/master' into feature_init
abdosi Nov 8, 2022
b5c8531
Merge remote-tracking branch 'upstream/master' into feature_init
abdosi Nov 9, 2022
bbccc7b
Merge remote-tracking branch 'upstream/master' into feature_init
abdosi Nov 10, 2022
08977ba
Fix the KVM failure.
abdosi Nov 11, 2022
9af84ac
Fix
abdosi Nov 11, 2022
963cc5b
Address review comment.
abdosi Nov 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions files/build_templates/init_cfg.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"tsa_enabled": "false"
}
},
{%- set features = [("bgp", "enabled", false, "enabled"),
{%- set features = [("bgp", "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}disabled{% else %}enabled{% endif %}", false, "enabled"),
("database", "always_enabled", false, "always_enabled"),
("lldp", "enabled", true, "enabled"),
("pmon", "enabled", true, "enabled"),
Expand All @@ -42,7 +42,7 @@
("eventd", "enabled", false, "enabled"),
("swss", "enabled", false, "enabled"),
("syncd", "enabled", false, "enabled"),
("teamd", "enabled", false, "enabled")] %}
("teamd", "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] %}disabled{% else %}enabled{% endif %}", false, "enabled")] %}
{% do features.append(("dhcp_relay", "{% if not (DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and DEVICE_METADATA['localhost']['type'] is not in ['ToRRouter', 'EPMS', 'MgmtTsToR', 'MgmtToRRouter', 'BmcMgmtToRRouter']) %}enabled{% else %}disabled{% endif %}", false, "enabled")) %}
{%- if sonic_asic_platform == "vs" %}{% do features.append(("gbsyncd", "enabled", false, "enabled")) %}{% endif %}
{%- if include_iccpd == "y" %}{% do features.append(("iccpd", "disabled", false, "enabled")) %}{% endif %}
Expand All @@ -61,7 +61,11 @@
"state": "{{state}}",
"has_timer" : {{has_timer | lower()}},
"has_global_scope": {% if feature + '.service' in installer_services.split(' ') %}true{% else %}false{% endif %},
"has_per_asic_scope": {% if feature + '@.service' in installer_services.split(' ') %}true{% else %}false{% endif %},
{%- if feature in ["lldp"] %}
"has_per_asic_scope": {% raw %}"{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}False{% else %}True{% endif %}"{% endraw %},
{%- else %}
"has_per_asic_scope": {% if feature + '@.service' in installer_services.split(' ') %}"True"{% else %}"False"{% endif %},
{%- endif %}
"auto_restart": "{{autorestart}}",
{# Set check_up_status to true here when app readiness will be marked in state db #}
{# For now, to support the infrastrucure, setting the check_up_status to false for bgp,swss,pmon #}
Expand Down
33 changes: 27 additions & 6 deletions files/scripts/swss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ LOCKFILE="/tmp/swss-syncd-lock$DEV"
NAMESPACE_PREFIX="asic"
ETC_SONIC_PATH="/etc/sonic/"

# DEPENDENT initially contains namespace independent services
# namespace specific services are added later in this script.
DEPENDENT="radv"
MULTI_INST_DEPENDENT="teamd"

. /usr/local/bin/asic_status.sh

Expand Down Expand Up @@ -299,8 +295,6 @@ stop() {

function check_peer_gbsyncd()
{
PLATFORM=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' platform`
HWSKU=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' hwsku`
GEARBOX_CONFIG=/usr/share/sonic/device/$PLATFORM/$HWSKU/$DEV/gearbox_config.json

if [ -f $GEARBOX_CONFIG ]; then
Expand All @@ -321,6 +315,22 @@ function check_macsec()
fi
}

function check_ports_present()
{
PORT_CONFIG_INI=/usr/share/sonic/device/$PLATFORM/$HWSKU/$DEV/port_config.ini
HWSKU_JSON=/usr/share/sonic/device/$PLATFORM/$HWSKU/$DEV/hwsku.json

if [[ -f $PORT_CONFIG_INI ]] || [[ -f $HWSKU_JSON ]]; then
judyjoseph marked this conversation as resolved.
Show resolved Hide resolved
return 0
fi
return 1
}

# DEPENDENT initially contains namespace independent services
# namespace specific services are added later in this script.
DEPENDENT="radv"
MULTI_INST_DEPENDENT=""

if [ "$DEV" ]; then
NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace
SONIC_DB_CLI="sonic-db-cli -n $NET_NS"
Expand All @@ -331,8 +341,19 @@ else
DEPENDENT+=" bgp"
fi

PLATFORM=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' platform`
HWSKU=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' hwsku`

check_peer_gbsyncd
check_macsec

check_ports_present
PORTS_PRESENT=$?

if [[ $PORTS_PRESENT == 0 ]]; then
MULTI_INST_DEPENDENT="teamd"
fi

read_dependent_services

case "$1" in
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@
"lldp": {
"auto_restart": "enabled",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"has_per_asic_scope": "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}False{% else %}True{% endif %}",
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"auto_restart": "disabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"has_per_asic_scope": "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}False{% else %}True{% endif %}",
"set_owner": "kube",
"check_up_status": "false"
},
Expand Down Expand Up @@ -77,7 +77,7 @@
"auto_restart": "disabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"has_per_asic_scope": "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}False{% else %}True{% endif %}",
"set_owner": "invalid",
"check_up_status": "false"
}
Expand All @@ -95,7 +95,7 @@
"auto_restart": "disabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"has_per_asic_scope": "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}False{% else %}True{% endif %}",
"check_up_status": "false"
}
]
Expand Down
7 changes: 6 additions & 1 deletion src/sonic-yang-models/yang-models/sonic-feature.yang
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ module sonic-feature{
}
}

typedef feature-scope-status {
description "configuration to set the feature has asic scope as true/false";
type string;
}

container sonic-feature {

container FEATURE {
Expand Down Expand Up @@ -69,7 +74,7 @@ module sonic-feature{
leaf has_per_asic_scope {
description "This configuration identicates there will only one service
spawned per asic";
type stypes:boolean_type;
type feature-scope-status;
default "false";
}

Expand Down