Skip to content

Commit c22cb71

Browse files
Merge branch 'master' into mykolag/fix_boolean_for_yang
2 parents ba3613f + 327ad41 commit c22cb71

File tree

13 files changed

+173
-30
lines changed

13 files changed

+173
-30
lines changed

Makefile.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
# Run the 'touch cache.skip.common' command in the base directory to exclude the common files from caching
6969
SONIC_COMMON_FILES_LIST := $(if $(wildcard cache.skip.common),, .platform slave.mk rules/functions Makefile.cache)
7070
SONIC_COMMON_FLAGS_LIST := $(CONFIGURED_PLATFORM) \
71+
$(BLDENV) \
7172
$(SONIC_DEBUGGING_ON) \
7273
$(SONIC_PROFILING_ON) $(SONIC_ENABLE_SYNCD_RPC)
7374
SONIC_COMMON_DPKG_LIST := debian/control debian/changelog debian/rules \

Makefile.work

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ endif
197197
SONIC_NATIVE_DOCKERD_FOR_MUTLIARCH := dockerd --experimental=true --storage-driver=vfs \
198198
--data-root=$(DOCKER_DATA_ROOT_FOR_MULTIARCH) --exec-root=/var/run/march/docker/ \
199199
-H unix:///var/run/march/docker.sock -p /var/run/march/docker.pid
200+
201+
ifneq ($(DOCKER_CONFIG_FILE_FOR_MULTIARCH),)
202+
SONIC_NATIVE_DOCKERD_FOR_MUTLIARCH += --config-file=$(DOCKER_CONFIG_FILE_FOR_MULTIARCH)
203+
endif
204+
200205
DOCKER_RUN += -v /var/run/march/docker.sock:/var/run/docker.sock
201206
DOCKER_RUN += -v /var/run/march/docker.pid:/var/run/docker.pid
202207
DOCKER_RUN += -v /var/run/march/docker:/var/run/docker

device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_defaults_t0.j2

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
{#
2+
Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES.
3+
Apache-2.0
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
#}
17+
118
{% set default_cable = '5m' %}
219
{% set ingress_lossless_pool_size = '44566528' %}
320
{% set ingress_lossless_xoff_size = '3614720' %}

device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_defaults_t1.j2

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
{#
2+
Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES.
3+
Apache-2.0
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
#}
17+
118
{% set default_cable = '5m' %}
219
{% set ingress_lossless_pool_size = '43794432' %}
320
{% set ingress_lossless_xoff_size = '4386816' %}

device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/port_config.ini

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
##
2+
## Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES.
3+
## Apache-2.0
4+
##
5+
## Licensed under the Apache License, Version 2.0 (the "License");
6+
## you may not use this file except in compliance with the License.
7+
## You may obtain a copy of the License at
8+
##
9+
## http://www.apache.org/licenses/LICENSE-2.0
10+
##
11+
## Unless required by applicable law or agreed to in writing, software
12+
## distributed under the License is distributed on an "AS IS" BASIS,
13+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
## See the License for the specific language governing permissions and
15+
## limitations under the License.
16+
##
17+
118
# name lanes alias index speed
219
Ethernet0 0,1 etp1a 1 50000
320
Ethernet2 2,3 etp1b 1 50000

device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai_4600c_100x50g_12x100g_2x10g.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
<!--
2+
Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES.
3+
Apache-2.0
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
118
<root>
219
<platform_info type="4601">
320

platform/mellanox/mlnx-platform-api.mk

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
#
1717
# SONIC_PLATFORM_API_PY2 package
1818

19-
SONIC_PLATFORM_API_PY2 = mlnx_platform_api-1.0-py2-none-any.whl
20-
$(SONIC_PLATFORM_API_PY2)_SRC_PATH = $(PLATFORM_PATH)/mlnx-platform-api
21-
$(SONIC_PLATFORM_API_PY2)_PYTHON_VERSION = 2
22-
$(SONIC_PLATFORM_API_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) $(SONIC_PLATFORM_COMMON_PY2) $(SONIC_CONFIG_ENGINE_PY2)
23-
SONIC_PYTHON_WHEELS += $(SONIC_PLATFORM_API_PY2)
19+
ifeq ($(ENABLE_PY2_MODULES), y)
20+
SONIC_PLATFORM_API_PY2 = mlnx_platform_api-1.0-py2-none-any.whl
21+
$(SONIC_PLATFORM_API_PY2)_SRC_PATH = $(PLATFORM_PATH)/mlnx-platform-api
22+
$(SONIC_PLATFORM_API_PY2)_PYTHON_VERSION = 2
23+
$(SONIC_PLATFORM_API_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) $(SONIC_PLATFORM_COMMON_PY2) $(SONIC_CONFIG_ENGINE_PY2)
24+
SONIC_PYTHON_WHEELS += $(SONIC_PLATFORM_API_PY2)
25+
endif
2426

2527
export mlnx_platform_api_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_API_PY2))"
2628

slave.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ DOCKERS_PATH = dockers
3030
BLDENV = $(shell lsb_release -cs)
3131
DEBS_PATH = $(TARGET_PATH)/debs/$(BLDENV)
3232
FILES_PATH = $(TARGET_PATH)/files/$(BLDENV)
33-
PYTHON_DEBS_PATH = $(TARGET_PATH)/python-debs
34-
PYTHON_WHEELS_PATH = $(TARGET_PATH)/python-wheels
33+
PYTHON_DEBS_PATH = $(TARGET_PATH)/python-debs/$(BLDENV)
34+
PYTHON_WHEELS_PATH = $(TARGET_PATH)/python-wheels/$(BLDENV)
3535
PROJECT_ROOT = $(shell pwd)
3636
JESSIE_DEBS_PATH = $(TARGET_PATH)/debs/jessie
3737
JESSIE_FILES_PATH = $(TARGET_PATH)/files/jessie
@@ -978,6 +978,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
978978
$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_COMMON_PY3)) \
979979
$(addprefix $(PYTHON_WHEELS_PATH)/,$(REDIS_DUMP_LOAD_PY2)) \
980980
$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_API_PY2)) \
981+
$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_API_PY3)) \
981982
$(if $(findstring y,$(PDDF_SUPPORT)),$(addprefix $(PYTHON_WHEELS_PATH)/,$(PDDF_PLATFORM_API_BASE_PY2))) \
982983
$(if $(findstring y,$(PDDF_SUPPORT)),$(addprefix $(PYTHON_WHEELS_PATH)/,$(PDDF_PLATFORM_API_BASE_PY3))) \
983984
$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_YANG_MODELS_PY3)) \

src/sonic-yang-models/tests/files/sample_config_db.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,47 +1224,53 @@
12241224
"has_per_asic_scope": "True",
12251225
"has_timer": "False",
12261226
"high_mem_alert": "disabled",
1227-
"state": "enabled"
1227+
"state": "enabled",
1228+
"set_owner": "local"
12281229
},
12291230
"database": {
12301231
"auto_restart": "always_enabled",
12311232
"has_global_scope": "true",
12321233
"has_per_asic_scope": "true",
12331234
"has_timer": "false",
12341235
"high_mem_alert": "disabled",
1235-
"state": "always_enabled"
1236+
"state": "always_enabled",
1237+
"set_owner": "local"
12361238
},
12371239
"snmp": {
12381240
"auto_restart": "enabled",
12391241
"has_global_scope": "true",
12401242
"has_per_asic_scope": "false",
12411243
"has_timer": "true",
12421244
"high_mem_alert": "disabled",
1243-
"state": "enabled"
1245+
"state": "enabled",
1246+
"set_owner": "kube"
12441247
},
12451248
"swss": {
12461249
"auto_restart": "enabled",
12471250
"has_global_scope": "false",
12481251
"has_per_asic_scope": "true",
12491252
"has_timer": "false",
12501253
"high_mem_alert": "disabled",
1251-
"state": "enabled"
1254+
"state": "enabled",
1255+
"set_owner": "local"
12521256
},
12531257
"syncd": {
12541258
"auto_restart": "enabled",
12551259
"has_global_scope": "false",
12561260
"has_per_asic_scope": "true",
12571261
"has_timer": "false",
12581262
"high_mem_alert": "disabled",
1259-
"state": "enabled"
1263+
"state": "enabled",
1264+
"set_owner": "local"
12601265
},
12611266
"lldp": {
12621267
"auto_restart": "enabled",
12631268
"has_global_scope": "false",
12641269
"has_per_asic_scope": "true",
12651270
"has_timer": "false",
12661271
"high_mem_alert": "disabled",
1267-
"state": "enabled"
1272+
"state": "enabled",
1273+
"set_owner": "kube"
12681274
}
12691275
},
12701276
"DHCP_RELAY": {

src/sonic-yang-models/tests/yang_model_tests/tests/feature.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@
55
"FEATURE_WITH_INVALID_STATE" : {
66
"desc": "Referring invalid feature state.",
77
"eStrKey": "Pattern",
8-
"eStr": ["enabled|disabled|always_enabled"]
8+
"eStr": ["enabled|disabled|always_enabled|always_disabled"]
99
},
1010
"FEATURE_WITH_INVALID_BOOLEAN_TYPE" : {
1111
"desc": "Referring invalid feature boolean types.",
1212
"eStrKey": "Pattern",
1313
"eStr": ["false|true|False|True"]
14+
},
15+
"FEATURE_WITH_INVALID_OWNER" : {
16+
"desc": "Referring invalid feature set_owner field.",
17+
"eStrKey": "Pattern",
18+
"eStr": ["kube|local"]
19+
},
20+
"FEATURE_WITH_NO_OWNER" : {
21+
"desc": "Config feature table without set_owner"
1422
}
1523
}

src/sonic-yang-models/tests/yang_model_tests/tests_config/feature.json

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,44 @@
99
"auto_restart": "always_enabled",
1010
"has_timer": "False",
1111
"has_global_scope": "True",
12-
"has_per_asic_scope": "True"
12+
"has_per_asic_scope": "True",
13+
"set_owner": "local"
1314
},
1415
{
1516
"name": "swss",
1617
"state": "always_enabled",
1718
"auto_restart": "always_enabled",
1819
"has_timer": "false",
1920
"has_global_scope": "false",
20-
"has_per_asic_scope": "true"
21+
"has_per_asic_scope": "true",
22+
"set_owner": "local"
2123
},
2224
{
2325
"name": "syncd",
2426
"state": "always_enabled",
2527
"auto_restart": "always_enabled",
2628
"has_timer": "false",
2729
"has_global_scope": "false",
28-
"has_per_asic_scope": "true"
30+
"has_per_asic_scope": "true",
31+
"set_owner": "local"
2932
},
3033
{
3134
"name": "snmp",
3235
"state": "enabled",
3336
"auto_restart": "enabled",
3437
"has_timer": "false",
3538
"has_global_scope": "true",
36-
"has_per_asic_scope": "false"
39+
"has_per_asic_scope": "false",
40+
"set_owner": "kube"
3741
},
3842
{
3943
"name": "lldp",
4044
"state": "disabled",
4145
"auto_restart": "disabled",
4246
"has_timer": "false",
4347
"has_global_scope": "false",
44-
"has_per_asic_scope": "true"
48+
"has_per_asic_scope": "true",
49+
"set_owner": "kube"
4550
}
4651
]
4752
}
@@ -57,6 +62,40 @@
5762
"auto_restart": "always_enabled",
5863
"has_timer": "false",
5964
"has_global_scope": "true",
65+
"has_per_asic_scope": "true",
66+
"set_owner": "local"
67+
}
68+
]
69+
}
70+
}
71+
},
72+
"FEATURE_WITH_INVALID_OWNER": {
73+
"sonic-feature:sonic-feature": {
74+
"sonic-feature:FEATURE": {
75+
"FEATURE_LIST": [
76+
{
77+
"name": "lldp",
78+
"state": "disabled",
79+
"auto_restart": "disabled",
80+
"has_timer": "false",
81+
"has_global_scope": "false",
82+
"has_per_asic_scope": "true",
83+
"set_owner": "invalid"
84+
}
85+
]
86+
}
87+
}
88+
},
89+
"FEATURE_WITH_NO_OWNER": {
90+
"sonic-feature:sonic-feature": {
91+
"sonic-feature:FEATURE": {
92+
"FEATURE_LIST": [
93+
{
94+
"name": "lldp",
95+
"state": "disabled",
96+
"auto_restart": "disabled",
97+
"has_timer": "false",
98+
"has_global_scope": "false",
6099
"has_per_asic_scope": "true"
61100
}
62101
]

src/sonic-yang-models/yang-models/sonic-feature.yang

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@ module sonic-feature{
55
namespace "http://github.com/Azure/sonic-feature";
66
prefix feature;
77

8-
import sonic-types {
9-
prefix stypes;
8+
description "Feature Table yang Module for SONiC";
9+
10+
typedef feature-state {
11+
description "configuration to set the feature running state";
12+
type string {
13+
pattern "enabled|disabled|always_enabled|always_disabled";
14+
}
1015
}
1116

12-
description "Feature Table yang Module for SONiC OS";
17+
typedef feature-owner {
18+
description "configuration to set if the container is controlled
19+
by kubernetes or locally";
20+
type string {
21+
pattern "kube|local";
22+
}
23+
}
1324

1425
container sonic-feature {
1526

@@ -30,12 +41,12 @@ module sonic-feature{
3041

3142
leaf state {
3243
description "state of the feature";
33-
type stypes:feature_state;
44+
type feature-state;
3445
default "enabled";
3546
}
3647

3748
leaf auto_restart {
38-
type stypes:feature_state;
49+
type feature-state;
3950
default "enabled";
4051
}
4152

@@ -63,9 +74,16 @@ module sonic-feature{
6374
leaf high_mem_alert {
6475
description "This configuration controls the trigger to generate
6576
alert on high memory utilization";
66-
type stypes:feature_state;
77+
type feature-state;
6778
default "disabled";
6879
}
80+
81+
leaf set_owner {
82+
description " This configuration set the feature owner is
83+
kubernetes or local";
84+
type feature-owner;
85+
default "local";
86+
}
6987
}
7088
}
7189
}

src/sonic-yang-models/yang-templates/sonic-types.yang.j2

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,6 @@ module sonic-types {
197197
}
198198
}
199199

200-
typedef feature_state {
201-
type string {
202-
pattern "enabled|disabled|always_enabled";
203-
}
204-
}
205200
typedef meter_type {
206201
type enumeration {
207202
enum packets;

0 commit comments

Comments
 (0)