diff --git a/platform/mkrules/files/scripts/vppcfg_load.py b/platform/mkrules/files/scripts/vppcfg_load.py index 150608a..bbff77c 100755 --- a/platform/mkrules/files/scripts/vppcfg_load.py +++ b/platform/mkrules/files/scripts/vppcfg_load.py @@ -1,5 +1,18 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- +# Copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import sys import os diff --git a/platform/mkrules/src/sonic-vppcfgd/setup.py b/platform/mkrules/src/sonic-vppcfgd/setup.py index ace01db..60250a0 100755 --- a/platform/mkrules/src/sonic-vppcfgd/setup.py +++ b/platform/mkrules/src/sonic-vppcfgd/setup.py @@ -1,3 +1,16 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import setuptools setuptools.setup( diff --git a/platform/mkrules/src/sonic-vppcfgd/vpp.json b/platform/mkrules/src/sonic-vppcfgd/vpp.json deleted file mode 100644 index b0c684a..0000000 --- a/platform/mkrules/src/sonic-vppcfgd/vpp.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "PLATFORM": { - "vpp": { - "buffers": "{}", - "cpu": "{'workers': '2'}", - "dpdk": "{}", - "logging": "{}", - "memory": "{'main-heap-size': '512M'}" - } - } -} diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/__init__.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/__init__.py index e69de29..f0d52c2 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/__init__.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/__init__.py @@ -0,0 +1,12 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/__main__.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/__main__.py index 413eeee..2c3883f 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/__main__.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/__main__.py @@ -1,4 +1,17 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .main import main if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/config.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/config.py index 1db0bb8..df5fc74 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/config.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/config.py @@ -1,3 +1,16 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json from .vars import g_dev_debug, VPP_CONFIG_JSON_PATH, VPP_CFG_STARTUP_PATH, VPP_BOOTUP_CFG_PATH, INDENT from .log import dev_debug, log_notice diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/directory.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/directory.py index d2dfc91..ef55d1f 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/directory.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/directory.py @@ -1,3 +1,17 @@ +# Copyright 2016 Microsoft, Inc. +# Modifications copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from collections import defaultdict from .log import log_err @@ -156,4 +170,4 @@ def subscribe(self, deps, handler): """ for db, table, path in deps: slot = self.get_slot_name(db, table) - self.notify[slot][path].append(handler) \ No newline at end of file + self.notify[slot][path].append(handler) diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/log.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/log.py index 270aae2..da5d72a 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/log.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/log.py @@ -1,3 +1,17 @@ +# Copyright 2016 Microsoft, Inc. +# Modifications copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import syslog from .vars import g_debug, g_dev_debug diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/main.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/main.py index babbbab..a5bcf45 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/main.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/main.py @@ -1,3 +1,16 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import signal import sys diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/manager.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/manager.py index 6966a20..477d968 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/manager.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/manager.py @@ -1,3 +1,17 @@ +# Copyright 2016 Microsoft, Inc. +# Modifications copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from swsscommon import swsscommon from .log import log_debug, log_err @@ -68,4 +82,4 @@ def set_handler(self, key, data): def del_handler(self, key): """ Placeholder for 'DEL' command """ - log_err("del_handler wasn't implemented for %s" % self.__class__.__name__) \ No newline at end of file + log_err("del_handler wasn't implemented for %s" % self.__class__.__name__) diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/managers_vppcfg.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/managers_vppcfg.py index 5a6ed92..8ea493a 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/managers_vppcfg.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/managers_vppcfg.py @@ -1,3 +1,16 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import traceback from .log import log_crit, log_err, log_debug, log_notice, dev_debug, g_dev_debug from .manager import Manager diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/runner.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/runner.py index 7c1f82b..52b1fef 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/runner.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/runner.py @@ -1,3 +1,17 @@ +# Copyright 2016 Microsoft, Inc. +# Modifications copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from collections import defaultdict from swsscommon import swsscommon diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/template.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/template.py index a2b476e..9f60215 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/template.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/template.py @@ -1,3 +1,17 @@ +# Copyright 2016 Microsoft, Inc. +# Modifications copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from collections import OrderedDict from functools import partial diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/utils.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/utils.py index 0acc293..2601f12 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/utils.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/utils.py @@ -1,3 +1,17 @@ +# Copyright 2016 Microsoft, Inc. +# Modifications copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import subprocess import yaml diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/vars.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/vars.py index 585e4fc..5dd424e 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/vars.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/vars.py @@ -1,3 +1,17 @@ +# Copyright 2016 Microsoft, Inc. +# Modifications copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + g_debug = True # FIXME: read from env variable, or from constants g_dev_debug = True diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/vpp.json b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/vpp.json deleted file mode 100644 index 47a8596..0000000 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/vpp.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "PLATFORM": { - "vpp": { - "vports": { - "vpp1": {}, - "vpp2": {} - }, - "cpu": {"workers": "2"}, - "dpdk": { - "dev": { - "0000:00:00.1": {"name": "vpp-eth0", "num-rx-queues": "2"}, - "0000:00:00.2": {"name": "vpp-eth1", "num-rx-queues": "2"} - } - }, - "memory": {"main-heap-size": "512M"} - } - } -} diff --git a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/vpp.py b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/vpp.py index 4af8af7..bf5cd3a 100644 --- a/platform/mkrules/src/sonic-vppcfgd/vppcfgd/vpp.py +++ b/platform/mkrules/src/sonic-vppcfgd/vppcfgd/vpp.py @@ -1,3 +1,16 @@ +# Copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json class VppMgr(object): diff --git a/platform/vpp/docker-sonic-vpp/scripts/vppcfg_load.py b/platform/vpp/docker-sonic-vpp/scripts/vppcfg_load.py index 150608a..bbff77c 100755 --- a/platform/vpp/docker-sonic-vpp/scripts/vppcfg_load.py +++ b/platform/vpp/docker-sonic-vpp/scripts/vppcfg_load.py @@ -1,5 +1,18 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- +# Copyright (c) 2023 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import sys import os