From fc7afa2f846b5d52b391ad28cf181f92b87404c6 Mon Sep 17 00:00:00 2001 From: sonic-otn Date: Wed, 31 Jan 2024 17:12:02 +0800 Subject: [PATCH] add otn platform, device, otss service and otairedis repository redirect submodules to sonic-otn repositories add otn vs platform, virtual-ot device, otss service and otairedis repository add otairedis and otss submodule update otairedis and swss-common submodule add docker-orchagent-ot in the bullseye dockers add otss_vars.j2 in otss docker image delete board mode in virtual transponder default configuration update sonic-swss-common submodule --- .gitmodules | 6 + README.md | 3 + .../x86_64-ot_kvm_x86_64_4_asic-r0/asic.conf | 1 + .../default_sku | 1 + .../installer.conf | 1 + .../linecards/e110c/config_db.json.j2 | 322 +++++ .../linecards/e110c/flexcounter.json | 738 ++++++++++ .../p230c/L1_400G_CA_100GE/config_db.json.j2 | 436 ++++++ .../linecards/p230c/config_db.json.j2 | 436 ++++++ .../linecards/p230c/flexcounter.json | 1233 +++++++++++++++++ .../platform_asic | 1 + .../plugins/eeprom.py | 40 + .../pmon_daemon_control.json | 8 + dockers/docker-orchagent-ot/Dockerfile.j2 | 71 + .../base_image_files/otssloglevel | 44 + dockers/docker-orchagent-ot/buffermgrd.sh | 18 + .../docker-orchagent-ot/critical_processes.j2 | 3 + dockers/docker-orchagent-ot/docker-init.j2 | 32 + dockers/docker-orchagent-ot/events_info.json | 9 + dockers/docker-orchagent-ot/orchagent.sh | 49 + .../docker-orchagent-ot/supervisord.conf.j2 | 63 + dockers/docker-orchagent-ot/swss_regex.json | 7 + .../docker-orchagent-ot/watchdog_processes.j2 | 1 + files/build_templates/init_cfg.json.j2 | 39 +- files/build_templates/otss_vars.j2 | 5 + .../per_namespace/bgp.service.j2 | 4 + .../per_namespace/otss.service.j2 | 22 + .../per_namespace/syncd-ot.service.j2 | 25 + .../build_templates/sonic_debian_extension.j2 | 2 + files/image_config/config-setup/config-setup | 37 + files/scripts/otss.sh | 115 ++ files/scripts/syncd-ot.sh | 52 + platform/ot-vs/docker-syncd-ot-vs.dep | 11 + platform/ot-vs/docker-syncd-ot-vs.mk | 18 + .../ot-vs/docker-syncd-ot-vs/Dockerfile.j2 | 32 + .../docker-syncd-ot-vs/critical_processes | 1 + .../ot-vs/docker-syncd-ot-vs/supervisord.conf | 39 + platform/ot-vs/kvm-image.dep | 2 + platform/ot-vs/kvm-image.mk | 14 + platform/ot-vs/one-image.dep | 2 + platform/ot-vs/one-image.mk | 13 + platform/ot-vs/onie.dep | 2 + platform/ot-vs/onie.mk | 10 + platform/ot-vs/platform.conf | 0 platform/ot-vs/rules.dep | 6 + platform/ot-vs/rules.mk | 8 + platform/ot-vs/sonic-version.dep | 2 + platform/ot-vs/sonic-version.mk | 15 + platform/ot-vs/syncd-ot-vs.dep | 11 + platform/ot-vs/syncd-ot-vs.mk | 10 + rules/docker-orchagent-ot.dep | 11 + rules/docker-orchagent-ot.mk | 40 + rules/otairedis.dep | 17 + rules/otairedis.mk | 50 + rules/otss.dep | 12 + rules/otss.mk | 22 + rules/scripts.mk | 4 + slave.mk | 4 +- src/sonic-otairedis | 1 + src/sonic-otss | 1 + src/sonic-swss-common | 1 - 61 files changed, 4174 insertions(+), 9 deletions(-) create mode 100644 device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/asic.conf create mode 100644 device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/default_sku create mode 100644 device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/installer.conf create mode 100644 device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/e110c/config_db.json.j2 create mode 100644 device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/e110c/flexcounter.json create mode 100644 device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/L1_400G_CA_100GE/config_db.json.j2 create mode 100644 device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/config_db.json.j2 create mode 100644 device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/flexcounter.json create mode 100644 device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/platform_asic create mode 100644 device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/plugins/eeprom.py create mode 100644 device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/pmon_daemon_control.json create mode 100755 dockers/docker-orchagent-ot/Dockerfile.j2 create mode 100755 dockers/docker-orchagent-ot/base_image_files/otssloglevel create mode 100755 dockers/docker-orchagent-ot/buffermgrd.sh create mode 100644 dockers/docker-orchagent-ot/critical_processes.j2 create mode 100755 dockers/docker-orchagent-ot/docker-init.j2 create mode 100644 dockers/docker-orchagent-ot/events_info.json create mode 100755 dockers/docker-orchagent-ot/orchagent.sh create mode 100644 dockers/docker-orchagent-ot/supervisord.conf.j2 create mode 100644 dockers/docker-orchagent-ot/swss_regex.json create mode 100644 dockers/docker-orchagent-ot/watchdog_processes.j2 create mode 100644 files/build_templates/otss_vars.j2 create mode 100644 files/build_templates/per_namespace/otss.service.j2 create mode 100644 files/build_templates/per_namespace/syncd-ot.service.j2 create mode 100755 files/scripts/otss.sh create mode 100755 files/scripts/syncd-ot.sh create mode 100644 platform/ot-vs/docker-syncd-ot-vs.dep create mode 100644 platform/ot-vs/docker-syncd-ot-vs.mk create mode 100644 platform/ot-vs/docker-syncd-ot-vs/Dockerfile.j2 create mode 100644 platform/ot-vs/docker-syncd-ot-vs/critical_processes create mode 100644 platform/ot-vs/docker-syncd-ot-vs/supervisord.conf create mode 100644 platform/ot-vs/kvm-image.dep create mode 100644 platform/ot-vs/kvm-image.mk create mode 100644 platform/ot-vs/one-image.dep create mode 100644 platform/ot-vs/one-image.mk create mode 100644 platform/ot-vs/onie.dep create mode 100644 platform/ot-vs/onie.mk create mode 100644 platform/ot-vs/platform.conf create mode 100644 platform/ot-vs/rules.dep create mode 100644 platform/ot-vs/rules.mk create mode 100644 platform/ot-vs/sonic-version.dep create mode 100644 platform/ot-vs/sonic-version.mk create mode 100644 platform/ot-vs/syncd-ot-vs.dep create mode 100644 platform/ot-vs/syncd-ot-vs.mk create mode 100644 rules/docker-orchagent-ot.dep create mode 100644 rules/docker-orchagent-ot.mk create mode 100644 rules/otairedis.dep create mode 100644 rules/otairedis.mk create mode 100644 rules/otss.dep create mode 100644 rules/otss.mk create mode 160000 src/sonic-otairedis create mode 160000 src/sonic-otss delete mode 160000 src/sonic-swss-common diff --git a/.gitmodules b/.gitmodules index 2682970d44fc..68ffcb645335 100644 --- a/.gitmodules +++ b/.gitmodules @@ -121,3 +121,9 @@ [submodule "platform/marvell-arm64/sonic-platform-marvell"] path = platform/marvell-arm64/sonic-platform-marvell url = https://github.com/Marvell-switching/sonic-platform-arm64.git +[submodule "src/sonic-otairedis"] + path = src/sonic-otairedis + url = https://github.com/Weitang-Zheng/sonic-otairedis.git +[submodule "src/sonic-otss"] + path = src/sonic-otss + url = https://github.com/Weitang-Zheng/sonic-otss.git diff --git a/README.md b/README.md index 5cf88ebc49ab..552fa0ff7e82 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,9 @@ The supported ASIC vendors are: * PLATFORM=innovium * PLATFORM=vs +The supported OTN vendors are: +* PLATFORM=ot-vs + ## Usage for ARM Architecture ```shell diff --git a/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/asic.conf b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/asic.conf new file mode 100644 index 000000000000..3e0fdee25c25 --- /dev/null +++ b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/asic.conf @@ -0,0 +1 @@ +NUM_ASIC=4 diff --git a/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/default_sku b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/default_sku new file mode 100644 index 000000000000..19e7c44249c1 --- /dev/null +++ b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/default_sku @@ -0,0 +1 @@ +alibaba_4_asic_vs t1 diff --git a/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/installer.conf b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/installer.conf new file mode 100644 index 000000000000..530ee964f330 --- /dev/null +++ b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="swiotlb=65536" diff --git a/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/e110c/config_db.json.j2 b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/e110c/config_db.json.j2 new file mode 100644 index 000000000000..0eae598f663b --- /dev/null +++ b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/e110c/config_db.json.j2 @@ -0,0 +1,322 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "asic_id": "{{ASIC_ID}}", + "hwsku": "e110c" + } + }, + "LINECARD": { + "LINECARD-1-{{SLOT_ID}}": { + "linecard-type": "E110C" + } + }, + "AMPLIFIER": { + "AMPLIFIER-1-{{SLOT_ID}}-1": { + "index": 1, + "id": 1, + "name": "AMPLIFIER-1-{{SLOT_ID}}-1", + "location": "1-{{SLOT_ID}}", + "component": "AMPLIFIER-1-{{SLOT_ID}}-1", + "parent": "LINECARD-1-{{SLOT_ID}}", + "subcomponents": "PORT-1-{{SLOT_ID}}-1-EDFAIN,PORT-1-{{SLOT_ID}}-1-EDFAOUT" + }, + "AMPLIFIER-1-{{SLOT_ID}}-2": { + "index": 2, + "id": 2, + "name": "AMPLIFIER-1-{{SLOT_ID}}-2", + "location": "1-{{SLOT_ID}}", + "component": "AMPLIFIER-1-{{SLOT_ID}}-2", + "parent": "LINECARD-1-{{SLOT_ID}}", + "subcomponents": "PORT-1-{{SLOT_ID}}-2-EDFAIN,PORT-1-{{SLOT_ID}}-2-EDFAOUT" + } + }, + "OSC": { + "OSC-1-{{SLOT_ID}}-1": { + "index": 1, + "id": 1, + "name": "OSC-1-{{SLOT_ID}}-1", + "location": "1-{{SLOT_ID}}", + "interface": "INTERFACE-1-{{SLOT_ID}}-1-OSC", + "parent": "LINECARD-1-{{SLOT_ID}}" + } + }, + "INTERFACE": { + "INTERFACE-1-{{SLOT_ID}}-1-OSC": { + "index": 1, + "interface-type": "OSC", + "interface-id": 1, + "name": "INTERFACE-1-{{SLOT_ID}}-1-OSC" + } + }, + "APS": { + "APS-1-{{SLOT_ID}}-1": { + "index": 1, + "id": 1, + "name": "APS-1-{{SLOT_ID}}-1", + "location": "1-{{SLOT_ID}}", + "parent": "LINECARD-1-{{SLOT_ID}}", + "subcomponents": "PORT-1-{{SLOT_ID}}-OLPSECOUT,PORT-1-{{SLOT_ID}}-OLPSECIN,PORT-1-{{SLOT_ID}}-OLPPRIOUT,PORT-1-{{SLOT_ID}}-OLPCOMIN,PORT-1-{{SLOT_ID}}-OLPCOMOUT,PORT-1-{{SLOT_ID}}-OLPPRIIN" + } + }, + "APS_PORT": { + "APS-1-{{SLOT_ID}}-1_LinePrimaryIn": { + "index": 1, + "id": 1, + "port-type": "LINE_PRIMARY_IN" + }, + "APS-1-{{SLOT_ID}}-1_LineSecondaryIn": { + "index": 2, + "id": 1, + "port-type": "LINE_SECONDARY_IN" + }, + "APS-1-{{SLOT_ID}}-1_CommonIn": { + "index": 3, + "id": 1, + "port-type": "COMMON_IN" + }, + "APS-1-{{SLOT_ID}}-1_LinePrimaryOut": { + "index": 4, + "id": 1, + "port-type": "LINE_PRIMARY_OUT" + }, + "APS-1-{{SLOT_ID}}-1_LineSecondaryOut": { + "index": 5, + "id": 1, + "port-type": "LINE_SECONDARY_OUT" + }, + "APS-1-{{SLOT_ID}}-1_CommonOutput": { + "index": 6, + "id": 1, + "port-type": "COMMON_OUTPUT" + } + }, + "PORT": { + "PORT-1-{{SLOT_ID}}-1-EDFAIN": { + "index": 1, + "port-type": "EDFA_IN", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "AMPLIFIER-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-1-EDFAOUT": { + "index": 2, + "port-type": "EDFA_OUT", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "AMPLIFIER-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-2-EDFAIN": { + "index": 3, + "port-type": "EDFA_IN", + "port-id": 2, + "location": "1-{{SLOT_ID}}", + "parent": "AMPLIFIER-1-{{SLOT_ID}}-2" + }, + "PORT-1-{{SLOT_ID}}-2-EDFAOUT": { + "index": 4, + "port-type": "EDFA_OUT", + "port-id": 2, + "location": "1-{{SLOT_ID}}", + "parent": "AMPLIFIER-1-{{SLOT_ID}}-2" + }, + "PORT-1-{{SLOT_ID}}-OLPPRIIN": { + "index": 5, + "port-type": "OLP_PRI_IN", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "APS-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-OLPPRIOUT": { + "index": 6, + "port-type": "OLP_PRI_OUT", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "APS-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-OLPSECIN": { + "index": 7, + "port-type": "OLP_SEC_IN", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "APS-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-OLPSECOUT": { + "index": 8, + "port-type": "OLP_SEC_OUT", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "APS-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-OLPCOMIN": { + "index": 9, + "port-type": "OLP_COM_IN", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "APS-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-OLPCOMOUT": { + "index": 10, + "port-type": "OLP_COM_OUT", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "APS-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-EXTIN": { + "index": 11, + "port-type": "MD_EXP_IN", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-EXTOUT": { + "index": 12, + "port-type": "MD_EXP_OUT", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD33IN": { + "index": 13, + "port-type": "MD_IN", + "port-id": 33, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD33OUT": { + "index": 14, + "port-type": "MD_OUT", + "port-id": 33, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD38IN": { + "index": 15, + "port-type": "MD_IN", + "port-id": 38, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD38OUT": { + "index": 16, + "port-type": "MD_OUT", + "port-id": 38, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD43IN": { + "index": 17, + "port-type": "MD_IN", + "port-id": 43, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD43OUT": { + "index": 18, + "port-type": "MD_OUT", + "port-id": 43, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD48IN": { + "index": 19, + "port-type": "MD_IN", + "port-id": 48, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD48OUT": { + "index": 20, + "port-type": "MD_OUT", + "port-id": 48, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD53IN": { + "index": 21, + "port-type": "MD_IN", + "port-id": 53, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD53OUT": { + "index": 22, + "port-type": "MD_OUT", + "port-id": 53, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD58IN": { + "index": 23, + "port-type": "MD_IN", + "port-id": 58, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-MD58OUT": { + "index": 24, + "port-type": "MD_OUT", + "port-id": 58, + "location": "1-{{SLOT_ID}}", + "parent": "MUX-1-{{SLOT_ID}}-1" + }, + "PORT-1-{{SLOT_ID}}-L1IN": { + "index": 25, + "port-type": "LINE_IN", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "LINECARD-1-{{SLOT_ID}}" + }, + "PORT-1-{{SLOT_ID}}-L1OUT": { + "index": 26, + "port-type": "LINE_OUT", + "port-id": 1, + "location": "1-{{SLOT_ID}}", + "parent": "LINECARD-1-{{SLOT_ID}}" + }, + "PORT-1-{{SLOT_ID}}-L2IN": { + "index": 27, + "port-type": "LINE_IN", + "port-id": 2, + "location": "1-{{SLOT_ID}}", + "parent": "LINECARD-1-{{SLOT_ID}}" + }, + "PORT-1-{{SLOT_ID}}-L2OUT": { + "index": 28, + "port-type": "LINE_OUT", + "port-id": 2, + "location": "1-{{SLOT_ID}}", + "parent": "LINECARD-1-{{SLOT_ID}}" + } + }, + "ATTENUATOR": { + "ATTENUATOR-1-{{SLOT_ID}}-1": { + "index": 1, + "id": 1, + "name": "ATTENUATOR-1-{{SLOT_ID}}-1", + "component": "ATTENUATOR-1-{{SLOT_ID}}-1" + }, + "ATTENUATOR-1-{{SLOT_ID}}-2": { + "index": 2, + "id": 2, + "name": "ATTENUATOR-1-{{SLOT_ID}}-2", + "component": "ATTENUATOR-1-{{SLOT_ID}}-2" + }, + "ATTENUATOR-1-{{SLOT_ID}}-3": { + "index": 3, + "id": 3, + "name": "ATTENUATOR-1-{{SLOT_ID}}-3", + "component": "ATTENUATOR-1-{{SLOT_ID}}-3" + } + }, + "MUX": { + "MUX-1-{{SLOT_ID}}-1": { + "index": 1, + "empty": "false", + "name": "MUX-1-{{SLOT_ID}}-1", + "oper-status": "ACTIVE", + "admin-state": "ENABLED", + "removable": "false", + "parent": "LINECARD-1-{{SLOT_ID}}" + } + } +} diff --git a/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/e110c/flexcounter.json b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/e110c/flexcounter.json new file mode 100644 index 000000000000..04adea5083eb --- /dev/null +++ b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/e110c/flexcounter.json @@ -0,0 +1,738 @@ + +[ + { + "PORT_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_PORT_ATTR_OPER_STATUS", + + + "attr2": "OTAI_PORT_ATTR_ADMIN_STATE", + + + "attr3": "OTAI_PORT_ATTR_EQUIPMENT_FAILURE", + + + "attr4": "OTAI_PORT_ATTR_EQUIPMENT_MISMATCH", + + + "attr5": "OTAI_PORT_ATTR_HIGH_THRESHOLD", + + + "attr6": "OTAI_PORT_ATTR_LED_COLOR", + + + "attr7": "OTAI_PORT_ATTR_LED_MODE", + + + "attr8": "OTAI_PORT_ATTR_LOS_THRESHOLD", + + + "attr9": "OTAI_PORT_ATTR_LOW_THRESHOLD", + + + "attr10": "OTAI_PORT_ATTR_ROLL_OFF", + + + "attr11": "OTAI_PORT_ATTR_RX_CD_RANGE", + + + "attr12": "OTAI_PORT_ATTR_EMPTY", + + + "attr13": "OTAI_PORT_ATTR_REMOVABLE", + + + "attr14": "OTAI_PORT_ATTR_INPUT_OFFSET", + + + "attr15": "OTAI_PORT_ATTR_OUTPUT_OFFSET", + + + "attr16": "OTAI_PORT_ATTR_OPTICAL_PORT_TYPE" + + + }, + "OP": "SET" + }, + { + "INPORT_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_PORT_STAT_INPUT_POWER" + + + }, + "OP": "SET" + }, + { + "OUTPORT_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_PORT_STAT_OUTPUT_POWER" + + + }, + "OP": "SET" + }, + { + "OA_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_OA_ATTR_OPER_STATUS", + + + "attr2": "OTAI_OA_ATTR_TYPE", + + + "attr3": "OTAI_OA_ATTR_TARGET_GAIN", + + + "attr4": "OTAI_OA_ATTR_MIN_GAIN", + + + "attr5": "OTAI_OA_ATTR_MAX_GAIN", + + + "attr6": "OTAI_OA_ATTR_TARGET_GAIN_TILT", + + + "attr7": "OTAI_OA_ATTR_GAIN_RANGE", + + + "attr8": "OTAI_OA_ATTR_AMP_MODE", + + + "attr9": "OTAI_OA_ATTR_TARGET_OUTPUT_POWER", + + + "attr10": "OTAI_OA_ATTR_MAX_OUTPUT_POWER", + + + "attr11": "OTAI_OA_ATTR_ENABLED", + + + "attr12": "OTAI_OA_ATTR_FIBER_TYPE_PROFILE", + + + "attr13": "OTAI_OA_ATTR_INGRESS_PORT", + + + "attr14": "OTAI_OA_ATTR_EGRESS_PORT", + + + "attr15": "OTAI_OA_ATTR_INPUT_LOS_THRESHOLD", + + + "attr16": "OTAI_OA_ATTR_INPUT_LOS_HYSTERESIS", + + + "attr17": "OTAI_OA_ATTR_OUTPUT_LOS_THRESHOLD", + + + "attr18": "OTAI_OA_ATTR_OUTPUT_LOS_HYSTERESIS", + + + "attr19": "OTAI_OA_ATTR_SERIAL_NO", + + + "attr20": "OTAI_OA_ATTR_PART_NO", + + + "attr21": "OTAI_OA_ATTR_MFG_NAME", + + + "attr22": "OTAI_OA_ATTR_MFG_DATE", + + + "attr23": "OTAI_OA_ATTR_EMPTY", + + + "attr24": "OTAI_OA_ATTR_REMOVABLE", + + + "attr25": "OTAI_OA_ATTR_EQUIPMENT_FAILURE", + + + "attr26": "OTAI_OA_ATTR_EQUIPMENT_MISMATCH", + + + "attr27": "OTAI_OA_ATTR_SOFTWARE_VERSION", + + + "attr28": "OTAI_OA_ATTR_FIRMWARE_VERSION", + + + "attr29": "OTAI_OA_ATTR_HARDWARE_VERSION", + + + "attr30": "OTAI_OA_ATTR_LOS_ASE_DELAY", + + + "attr31": "OTAI_OA_ATTR_ADMIN_STATE", + + + "attr32": "OTAI_OA_ATTR_GAIN_LOW_THRESHOLD", + + + "attr33": "OTAI_OA_ATTR_GAIN_LOW_HYSTERESIS", + + + "attr34": "OTAI_OA_ATTR_INPUT_LOW_THRESHOLD", + + + "attr35": "OTAI_OA_ATTR_OUTPUT_LOW_THRESHOLD", + + + "attr36": "OTAI_OA_ATTR_WORKING_STATE", + + + "attr37": "OTAI_OA_ATTR_INPUT_OFFSET_LINEP_RX", + + + "attr38": "OTAI_OA_ATTR_OUTPUT_OFFSET_LINEP_TX", + + + "attr39": "OTAI_OA_ATTR_INPUT_OFFSET_LINES_RX", + + + "attr40": "OTAI_OA_ATTR_OUTPUT_OFFSET_LINES_TX" + + + }, + "OP": "SET" + }, + { + "OA_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_OA_STAT_ACTUAL_GAIN", + + + "attr2": "OTAI_OA_STAT_ACTUAL_GAIN_TILT", + + + "attr3": "OTAI_OA_STAT_TEMPERATURE", + + + "attr4": "OTAI_OA_STAT_INPUT_POWER_TOTAL", + + + "attr5": "OTAI_OA_STAT_INPUT_POWER_C_BAND", + + + "attr6": "OTAI_OA_STAT_INPUT_POWER_L_BAND", + + + "attr7": "OTAI_OA_STAT_OUTPUT_POWER_TOTAL", + + + "attr8": "OTAI_OA_STAT_OUTPUT_POWER_C_BAND", + + + "attr9": "OTAI_OA_STAT_OUTPUT_POWER_L_BAND", + + + "attr10": "OTAI_OA_STAT_LASER_BIAS_CURRENT", + + + "attr11": "OTAI_OA_STAT_OPTICAL_RETURN_LOSS", + + + "attr12": "OTAI_OA_STAT_LASER_TEC_CURRENT", + + + "attr13": "OTAI_OA_STAT_LASER_TEMPERATURE", + + + "attr14": "OTAI_OA_STAT_PANEL_INPUT_POWER_LINEP_RX", + + + "attr15": "OTAI_OA_STAT_PANEL_OUTPUT_POWER_LINEP_TX", + + + "attr16": "OTAI_OA_STAT_PANEL_INPUT_POWER_LINES_RX", + + + "attr17": "OTAI_OA_STAT_PANEL_OUTPUT_POWER_LINES_TX", + + + "attr18": "OTAI_OA_STAT_INGRESS_VOA_ATTEN" + + + }, + "OP": "SET" + }, + { + "OSC_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_OSC_ATTR_OPER_STATUS", + + + "attr2": "OTAI_OSC_ATTR_OUTPUT_FREQUENCY", + + + "attr3": "OTAI_OSC_ATTR_ADMIN_STATE", + + + "attr4": "OTAI_OSC_ATTR_ENABLED", + + + "attr5": "OTAI_OSC_ATTR_EMPTY", + + + "attr6": "OTAI_OSC_ATTR_MFG_DATE", + + + "attr7": "OTAI_OSC_ATTR_SERIAL_NO", + + + "attr8": "OTAI_OSC_ATTR_PART_NO", + + + "attr9": "OTAI_OSC_ATTR_MFG_NAME", + + + "attr10": "OTAI_OSC_ATTR_REMOVABLE", + + + "attr11": "OTAI_OSC_ATTR_EQUIPMENT_FAILURE", + + + "attr12": "OTAI_OSC_ATTR_EQUIPMENT_MISMATCH", + + + "attr13": "OTAI_OSC_ATTR_FIRMWARE_VERSION", + + + "attr14": "OTAI_OSC_ATTR_SOFTWARE_VERSION", + + + "attr15": "OTAI_OSC_ATTR_HARDWARE_VERSION", + + + "attr16": "OTAI_OSC_ATTR_RX_LOW_THRESHOLD", + + + "attr17": "OTAI_OSC_ATTR_RX_HIGH_THRESHOLD", + + + "attr18": "OTAI_OSC_ATTR_TX_LOW_THRESHOLD" + + + }, + "OP": "SET" + }, + { + "OSC_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_OSC_STAT_INPUT_POWER", + + + "attr2": "OTAI_OSC_STAT_OUTPUT_POWER", + + + "attr3": "OTAI_OSC_STAT_LASER_BIAS_CURRENT", + + + "attr4": "OTAI_OSC_STAT_INPUT_OFFSET_LINEP_RX", + + + "attr5": "OTAI_OSC_STAT_OUTPUT_OFFSET_LINEP_TX", + + + "attr6": "OTAI_OSC_STAT_INPUT_OFFSET_LINES_RX", + + + "attr7": "OTAI_OSC_STAT_OUTPUT_OFFSET_LINES_TX", + + + "attr8": "OTAI_OSC_STAT_TEMPERATURE", + + + "attr9": "OTAI_OSC_STAT_PANEL_INPUT_POWER_LINEP_RX", + + + "attr10": "OTAI_OSC_STAT_PANEL_OUTPUT_POWER_LINEP_TX", + + + "attr11": "OTAI_OSC_STAT_PANEL_INPUT_POWER_LINES_RX", + + + "attr12": "OTAI_OSC_STAT_PANEL_OUTPUT_POWER_LINES_TX" + + + }, + "OP": "SET" + }, + { + "APS_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_APS_ATTR_ADMIN_STATE", + + + "attr2": "OTAI_APS_ATTR_TYPE", + + + "attr3": "OTAI_APS_ATTR_REVERTIVE", + + + "attr4": "OTAI_APS_ATTR_WAIT_TO_RESTORE_TIME", + + + "attr5": "OTAI_APS_ATTR_HOLD_OFF_TIME", + + + "attr6": "OTAI_APS_ATTR_PRIMARY_SWITCH_THRESHOLD", + + + "attr7": "OTAI_APS_ATTR_PRIMARY_SWITCH_HYSTERESIS", + + + "attr8": "OTAI_APS_ATTR_SECONDARY_SWITCH_THRESHOLD", + + + "attr9": "OTAI_APS_ATTR_RELATIVE_SWITCH_THRESHOLD", + + + "attr10": "OTAI_APS_ATTR_RELATIVE_SWITCH_THRESHOLD_OFFSET", + + + "attr11": "OTAI_APS_ATTR_FORCE_TO_PORT", + + + "attr12": "OTAI_APS_ATTR_ACTIVE_PATH", + + + "attr13": "OTAI_APS_ATTR_SERIAL_NO", + + + "attr14": "OTAI_APS_ATTR_PART_NO", + + + "attr15": "OTAI_APS_ATTR_MFG_NAME", + + + "attr16": "OTAI_APS_ATTR_MFG_DATE", + + + "attr17": "OTAI_APS_ATTR_OPER_STATUS", + + + "attr18": "OTAI_APS_ATTR_EMPTY", + + + "attr19": "OTAI_APS_ATTR_REMOVABLE", + + + "attr20": "OTAI_APS_ATTR_EQUIPMENT_FAILURE", + + + "attr21": "OTAI_APS_ATTR_EQUIPMENT_MISMATCH", + + + "attr22": "OTAI_APS_ATTR_FIRMWARE_VERSION", + + + "attr23": "OTAI_APS_ATTR_HARDWARE_VERSION", + + + "attr24": "OTAI_APS_ATTR_SOFTWARE_VERSION", + + + "attr25": "OTAI_APS_ATTR_ALARM_HYSTERESIS" + + + }, + "OP": "SET" + }, + { + "APSPORT_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_APSPORT_ATTR_ENABLED", + + + "attr2": "OTAI_APSPORT_ATTR_TARGET_ATTENUATION", + + + "attr3": "OTAI_APSPORT_ATTR_POWER_LOS_THRESHOLD", + + + "attr4": "OTAI_APSPORT_ATTR_POWER_LOW_THRESHOLD" + + + }, + "OP": "SET" + }, + { + "APSPORT_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_APSPORT_STAT_OPTICAL_POWER", + + + "attr2": "OTAI_APSPORT_STAT_ATTENUATION" + + + }, + "OP": "SET" + }, + { + "ATTENUATOR_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_ATTENUATOR_ATTR_ATTENUATION_MODE", + + + "attr2": "OTAI_ATTENUATOR_ATTR_TARGET_OUTPUT_POWER", + + + "attr3": "OTAI_ATTENUATOR_ATTR_ATTENUATION", + + + "attr4": "OTAI_ATTENUATOR_ATTR_INGRESS_PORT", + + + "attr5": "OTAI_ATTENUATOR_ATTR_EGRESS_PORT", + + + "attr6": "OTAI_ATTENUATOR_ATTR_FIX_ATTENUATION", + + + "attr7": "OTAI_ATTENUATOR_ATTR_ENABLED" + + + }, + "OP": "SET" + }, + { + "ATTENUATOR_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_ATTENUATOR_STAT_ACTUAL_ATTENUATION", + + + "attr2": "OTAI_ATTENUATOR_STAT_OUTPUT_POWER_TOTAL", + + + "attr3": "OTAI_ATTENUATOR_STAT_OPTICAL_RETURN_LOSS" + + + }, + "OP": "SET" + }, + { + "LINECARD_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_LINECARD_ATTR_ADMIN_STATE", + + + "attr2": "OTAI_LINECARD_ATTR_OPER_STATUS", + + + "attr3": "OTAI_LINECARD_ATTR_RELAY", + + + "attr4": "OTAI_LINECARD_ATTR_CPLD_VERSION", + + + "attr5": "OTAI_LINECARD_ATTR_SCRIPT_VERSION", + + + "attr6": "OTAI_LINECARD_ATTR_MFG_NAME", + + + "attr7": "OTAI_LINECARD_ATTR_BAUD_RATE", + + + "attr8": "OTAI_LINECARD_ATTR_SOFTWARE_VERSION", + + + "attr9": "OTAI_LINECARD_ATTR_FPGA_VERSION", + + + "attr10": "OTAI_LINECARD_ATTR_UCD_VERSION", + + + "attr11": "OTAI_LINECARD_ATTR_TEMP_HIGH_ALARM_THRESHOLD", + + + "attr12": "OTAI_LINECARD_ATTR_TEMP_HIGH_WARN_THRESHOLD", + + + "attr13": "OTAI_LINECARD_ATTR_TEMP_LOW_ALARM_THRESHOLD", + + + "attr14": "OTAI_LINECARD_ATTR_TEMP_LOW_WARN_THRESHOLD", + + + "attr15": "OTAI_LINECARD_ATTR_SLOT_ID", + + + "attr16": "OTAI_LINECARD_ATTR_LED_MODE", + + + "attr17": "OTAI_LINECARD_ATTR_LED_FLASH_INTERVAL", + + + "attr18": "OTAI_LINECARD_ATTR_LED_COLOR", + + + "attr19": "OTAI_LINECARD_ATTR_EQUIPMENT_FAILURE", + + + "attr20": "OTAI_LINECARD_ATTR_EQUIPMENT_MISMATCH" + + + }, + "OP": "SET" + }, + { + "LINECARD_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_LINECARD_STAT_MEMORY_AVAILABLE", + + + "attr2": "OTAI_LINECARD_STAT_MEMORY_UTILIZED", + + + "attr3": "OTAI_LINECARD_STAT_CPU_UTILIZATION", + + + "attr4": "OTAI_LINECARD_STAT_TEMPERATURE" + + + }, + "OP": "SET" + }, + { + "INTERFACE_COUNTER_ID_LIST_COUNTER": { + + "attr1": "OTAI_INTERFACE_STAT_OUT_MULTICAST_PKTS", + + + "attr2": "OTAI_INTERFACE_STAT_IN_OCTETS", + + + "attr3": "OTAI_INTERFACE_STAT_OUT_PKTS", + + + "attr4": "OTAI_INTERFACE_STAT_OUT_BROADCAST_PKTS", + + + "attr5": "OTAI_INTERFACE_STAT_OUT_OCTETS", + + + "attr6": "OTAI_INTERFACE_STAT_LAST_CLEAR", + + + "attr7": "OTAI_INTERFACE_STAT_IN_PKTS", + + + "attr8": "OTAI_INTERFACE_STAT_IN_MULTICAST_PKTS", + + + "attr9": "OTAI_INTERFACE_STAT_IN_ERRORS", + + + "attr10": "OTAI_INTERFACE_STAT_IN_BROADCAST_PKTS", + + + "attr11": "OTAI_INTERFACE_STAT_OUT_ERRORS", + + + "attr12": "OTAI_INTERFACE_STAT_IN_CRC_ERRORS", + + + "attr13": "OTAI_INTERFACE_STAT_IN_UNDERSIZE_FRAMES", + + + "attr14": "OTAI_INTERFACE_STAT_IN_FRAMES_1024_1518_OCTETS", + + + "attr15": "OTAI_INTERFACE_STAT_IN_FRAMES_256_511_OCTETS", + + + "attr16": "OTAI_INTERFACE_STAT_IN_FRAMES_65_127_OCTETS", + + + "attr17": "OTAI_INTERFACE_STAT_IN_FRAMES_128_255_OCTETS", + + + "attr18": "OTAI_INTERFACE_STAT_IN_FRAMES_512_1023_OCTETS", + + + "attr19": "OTAI_INTERFACE_STAT_IN_FRAMES_64_OCTETS", + + + "attr20": "OTAI_INTERFACE_STAT_IN_OVERSIZE_FRAMES", + + + "attr21": "OTAI_INTERFACE_STAT_IN_JABBER_FRAMES", + + + "attr22": "OTAI_INTERFACE_STAT_CARRIER_TRANSITIONS", + + + "attr23": "OTAI_INTERFACE_STAT_IN_8021Q_FRAMES", + + + "attr24": "OTAI_INTERFACE_STAT_IN_BLOCK_ERRORS", + + + "attr25": "OTAI_INTERFACE_STAT_IN_CARRIER_ERRORS", + + + "attr26": "OTAI_INTERFACE_STAT_IN_DISCARDS", + + + "attr27": "OTAI_INTERFACE_STAT_IN_FCS_ERRORS", + + + "attr28": "OTAI_INTERFACE_STAT_IN_FRAGMENT_FRAMES", + + + "attr29": "OTAI_INTERFACE_STAT_IN_INTERRUPTED_TX", + + + "attr30": "OTAI_INTERFACE_STAT_IN_LATE_COLLISION", + + + "attr31": "OTAI_INTERFACE_STAT_IN_MAC_CONTROL_FRAMES", + + + "attr32": "OTAI_INTERFACE_STAT_IN_MAC_ERRORS_RX", + + + "attr33": "OTAI_INTERFACE_STAT_IN_MAC_PAUSE_FRAMES", + + + "attr34": "OTAI_INTERFACE_STAT_IN_MAXSIZE_EXCEEDED", + + + "attr35": "OTAI_INTERFACE_STAT_IN_SINGLE_COLLISION", + + + "attr36": "OTAI_INTERFACE_STAT_IN_SYMBOL_ERROR", + + + "attr37": "OTAI_INTERFACE_STAT_IN_UNICAST_PKTS", + + + "attr38": "OTAI_INTERFACE_STAT_IN_UNKNOWN_PROTOS", + + + "attr39": "OTAI_INTERFACE_STAT_OUT_8021Q_FRAMES", + + + "attr40": "OTAI_INTERFACE_STAT_OUT_DISCARDS", + + + "attr41": "OTAI_INTERFACE_STAT_OUT_MAC_CONTROL_FRAMES", + + + "attr42": "OTAI_INTERFACE_STAT_OUT_MAC_ERRORS_TX", + + + "attr43": "OTAI_INTERFACE_STAT_OUT_MAC_PAUSE_FRAMES", + + + "attr44": "OTAI_INTERFACE_STAT_OUT_UNICAST_PKTS" + + + }, + "OP": "SET" + } +] diff --git a/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/L1_400G_CA_100GE/config_db.json.j2 b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/L1_400G_CA_100GE/config_db.json.j2 new file mode 100644 index 000000000000..8ead313ed29a --- /dev/null +++ b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/L1_400G_CA_100GE/config_db.json.j2 @@ -0,0 +1,436 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "asic_id": "{{ASIC_ID}}", + "hwsku": "p230c" + } + }, + "LOGICAL_CHANNEL": { + "CH{{SLOT_ID}}01": { + "index": "{{SLOT_ID}}01", + "channel-id": "{{SLOT_ID}}01", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C1", + "description": "GE-1-{{SLOT_ID}}-C1", + "alias": "CH{{SLOT_ID}}01" + }, + "CH{{SLOT_ID}}02": { + "index": "{{SLOT_ID}}02", + "channel-id": "{{SLOT_ID}}02", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C2", + "description": "GE-1-{{SLOT_ID}}-C2", + "alias": "CH{{SLOT_ID}}02" + }, + "CH{{SLOT_ID}}03": { + "index": "{{SLOT_ID}}03", + "channel-id": "{{SLOT_ID}}03", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C3", + "description": "GE-1-{{SLOT_ID}}-C3", + "alias": "CH{{SLOT_ID}}03" + }, + "CH{{SLOT_ID}}04": { + "index": "{{SLOT_ID}}04", + "channel-id": "{{SLOT_ID}}04", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C4", + "description": "GE-1-{{SLOT_ID}}-C4", + "alias": "CH{{SLOT_ID}}04" + }, + "CH{{SLOT_ID}}15": { + "index": "{{SLOT_ID}}15", + "channel-id": "{{SLOT_ID}}15", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-L1", + "description": "OTUCN-1-{{SLOT_ID}}-L1", + "alias": "CH{{SLOT_ID}}15" + }, + "CH{{SLOT_ID}}17": { + "index": "{{SLOT_ID}}17", + "channel-id": "{{SLOT_ID}}17", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C1", + "description": "ODUCN-1-{{SLOT_ID}}-C1", + "alias": "CH{{SLOT_ID}}17" + }, + "CH{{SLOT_ID}}18": { + "index": "{{SLOT_ID}}18", + "channel-id": "{{SLOT_ID}}18", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C2", + "description": "ODUCN-1-{{SLOT_ID}}-C2", + "alias": "CH{{SLOT_ID}}18" + }, + "CH{{SLOT_ID}}19": { + "index": "{{SLOT_ID}}19", + "channel-id": "{{SLOT_ID}}19", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C3", + "description": "ODUCN-1-{{SLOT_ID}}-C3", + "alias": "CH{{SLOT_ID}}19" + }, + "CH{{SLOT_ID}}20": { + "index": "{{SLOT_ID}}10", + "channel-id": "{{SLOT_ID}}10", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C4", + "description": "ODUCN-1-{{SLOT_ID}}-C4", + "alias": "CH{{SLOT_ID}}20" + } + }, + "PORT": { + "PORT-1-{{SLOT_ID}}-L1": { + "index": "1", + "port-type": "LINE", + "port-id": "1", + "subcomponents": "TRANSCEIVER-1-{{SLOT_ID}}-L1", + "alias": "PORT-1-{{SLOT_ID}}-L1" + }, + "PORT-1-{{SLOT_ID}}-C1": { + "index": "3", + "port-type": "CLIENT", + "port-id": "1", + "subcomponents": "TRANSCEIVER-1-{{SLOT_ID}}-C1", + "alias": "PORT-1-{{SLOT_ID}}-C1" + }, + "PORT-1-{{SLOT_ID}}-C2": { + "index": "4", + "port-type": "CLIENT", + "port-id": "2", + "subcomponents": "TRANSCEIVER-1-{{SLOT_ID}}-C2", + "alias": "PORT-1-{{SLOT_ID}}-C2" + }, + "PORT-1-{{SLOT_ID}}-C3": { + "index": "5", + "port-type": "CLIENT", + "port-id": "3", + "subcomponents": "TRANSCEIVER-1-{{SLOT_ID}}-C3", + "alias": "PORT-1-{{SLOT_ID}}-C3" + }, + "PORT-1-{{SLOT_ID}}-C4": { + "index": "6", + "port-type": "CLIENT", + "port-id": "4", + "subcomponents": "TRANSCEIVER-1-{{SLOT_ID}}-C4", + "alias": "PORT-1-{{SLOT_ID}}-C4" + } + }, + "LINECARD": { + "LINECARD-1-{{SLOT_ID}}": { + "linecard-type": "P230C" + } + }, + "TRANSCEIVER": { + "TRANSCEIVER-1-{{SLOT_ID}}-C1": { + "index": 1, + "port-type": "CLIENT", + "port-id": 1, + "parent": "PORT-1-{{SLOT_ID}}-C1", + "physical-channel": "TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-1,TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-2,TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-3,TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-4", + "logical-channel": "CH{{SLOT_ID}}01,CH{{SLOT_ID}}17", + "ethernet": "CH{{SLOT_ID}}01", + "otn": "CH{{SLOT_ID}}17", + "interface": "INTERFACE-1-{{SLOT_ID}}-C1" + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C2": { + "index": 2, + "port-type": "CLIENT", + "port-id": 2, + "parent": "PORT-1-{{SLOT_ID}}-C2", + "physical-channel": "TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-1,TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-2,TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-3,TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-4", + "logical-channel": "CH{{SLOT_ID}}02,CH{{SLOT_ID}}18", + "ethernet": "CH{{SLOT_ID}}02", + "otn": "CH{{SLOT_ID}}18", + "interface": "INTERFACE-1-{{SLOT_ID}}-C2" + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C3": { + "index": 3, + "port-type": "CLIENT", + "port-id": 3, + "parent": "PORT-1-{{SLOT_ID}}-C3", + "physical-channel": "TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-1,TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-2,TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-3,TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-4", + "logical-channel": "CH{{SLOT_ID}}03,CH{{SLOT_ID}}19", + "ethernet": "CH{{SLOT_ID}}03", + "otn": "CH{{SLOT_ID}}19", + "interface": "INTERFACE-1-{{SLOT_ID}}-C3" + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C4": { + "index": 4, + "port-type": "CLIENT", + "port-id": 4, + "parent": "PORT-1-{{SLOT_ID}}-C4", + "physical-channel": "TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-1,TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-2,TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-3,TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-4", + "logical-channel": "CH{{SLOT_ID}}04,CH{{SLOT_ID}}20", + "ethernet": "CH{{SLOT_ID}}04", + "otn": "CH{{SLOT_ID}}20", + "interface": "INTERFACE-1-{{SLOT_ID}}-C4" + }, + "TRANSCEIVER-1-{{SLOT_ID}}-L1": { + "index": 5, + "port-type": "LINE", + "port-id": 1, + "parent": "PORT-1-{{SLOT_ID}}-L1", + "logical-channel": "CH{{SLOT_ID}}15", + "otn": "CH{{SLOT_ID}}15", + "och": "OCH-1-{{SLOT_ID}}-L1" + } + }, + "PHYSICAL_CHANNEL": { + "TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-1": { + "index": 1, + "port-type": "CLIENT", + "port-id": 1, + "lane-id": 1 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-2": { + "index": 2, + "port-type": "CLIENT", + "port-id": 1, + "lane-id": 2 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-3": { + "index": 3, + "port-type": "CLIENT", + "port-id": 1, + "lane-id": 3 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-4": { + "index": 4, + "port-type": "CLIENT", + "port-id": 1, + "lane-id": 4 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-1": { + "index": 5, + "port-type": "CLIENT", + "port-id": 2, + "lane-id": 1 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-2": { + "index": 6, + "port-type": "CLIENT", + "port-id": 2, + "lane-id": 2 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-3": { + "index": 7, + "port-type": "CLIENT", + "port-id": 2, + "lane-id": 3 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-4": { + "index": 8, + "port-type": "CLIENT", + "port-id": 2, + "lane-id": 4 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-1": { + "index": 9, + "port-type": "CLIENT", + "port-id": 3, + "lane-id": 1 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-2": { + "index": 10, + "port-type": "CLIENT", + "port-id": 3, + "lane-id": 2 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-3": { + "index": 11, + "port-type": "CLIENT", + "port-id": 3, + "lane-id": 3 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-4": { + "index": 12, + "port-type": "CLIENT", + "port-id": 3, + "lane-id": 4 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-1": { + "index": 13, + "port-type": "CLIENT", + "port-id": 4, + "lane-id": 1 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-2": { + "index": 14, + "port-type": "CLIENT", + "port-id": 4, + "lane-id": 2 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-3": { + "index": 15, + "port-type": "CLIENT", + "port-id": 4, + "lane-id": 3 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-4": { + "index": 16, + "port-type": "CLIENT", + "port-id": 4, + "lane-id": 4 + } + }, + "OCH": { + "OCH-1-{{SLOT_ID}}-L1": { + "index": 1, + "port-type": "LINE", + "port-id": 1 + } + }, + "LLDP": { + "CH{{SLOT_ID}}01": { + "index": {{SLOT_ID}}01, + "channel-id": {{SLOT_ID}}01 + }, + "CH{{SLOT_ID}}02": { + "index": {{SLOT_ID}}02, + "channel-id": {{SLOT_ID}}02 + }, + "CH{{SLOT_ID}}03": { + "index": {{SLOT_ID}}03, + "channel-id": {{SLOT_ID}}03 + }, + "CH{{SLOT_ID}}04": { + "index": {{SLOT_ID}}04, + "channel-id": {{SLOT_ID}}04 + } + }, + "ETHERNET": { + "CH{{SLOT_ID}}01": { + "index": {{SLOT_ID}}01, + "channel-id": {{SLOT_ID}}01 + }, + "CH{{SLOT_ID}}02": { + "index": {{SLOT_ID}}02, + "channel-id": {{SLOT_ID}}02 + }, + "CH{{SLOT_ID}}03": { + "index": {{SLOT_ID}}03, + "channel-id": {{SLOT_ID}}03 + }, + "CH{{SLOT_ID}}04": { + "index": {{SLOT_ID}}04, + "channel-id": {{SLOT_ID}}04 + } + }, + "OTN": { + "CH{{SLOT_ID}}15": { + "index": {{SLOT_ID}}15, + "channel-id": {{SLOT_ID}}15 + }, + "CH{{SLOT_ID}}17": { + "index": {{SLOT_ID}}17, + "channel-id": {{SLOT_ID}}17 + }, + "CH{{SLOT_ID}}18": { + "index": {{SLOT_ID}}18, + "channel-id": {{SLOT_ID}}18 + }, + "CH{{SLOT_ID}}19": { + "index": {{SLOT_ID}}19, + "channel-id": {{SLOT_ID}}19 + }, + "CH{{SLOT_ID}}20": { + "index": {{SLOT_ID}}10, + "channel-id": {{SLOT_ID}}10 + } + }, + "INTERFACE": { + "INTERFACE-1-{{SLOT_ID}}-C1": { + "index": 1, + "type": "ethernetCsmacd", + "interface-type": "CLIENT", + "interface-id": 1, + "name": "INTERFACE-1-{{SLOT_ID}}-C1", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C1", + "hardware-port": "PORT-1-{{SLOT_ID}}-C1" + }, + "INTERFACE-1-{{SLOT_ID}}-C2": { + "index": 2, + "type": "ethernetCsmacd", + "interface-type": "CLIENT", + "interface-id": 2, + "name": "INTERFACE-1-{{SLOT_ID}}-C2", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C2", + "hardware-port": "PORT-1-{{SLOT_ID}}-C2" + }, + "INTERFACE-1-{{SLOT_ID}}-C3": { + "index": 3, + "type": "ethernetCsmacd", + "interface-type": "CLIENT", + "interface-id": 3, + "name": "INTERFACE-1-{{SLOT_ID}}-C3", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C3", + "hardware-port": "PORT-1-{{SLOT_ID}}-C3" + }, + "INTERFACE-1-{{SLOT_ID}}-C4": { + "index": 4, + "type": "ethernetCsmacd", + "interface-type": "CLIENT", + "interface-id": 4, + "name": "INTERFACE-1-{{SLOT_ID}}-C4", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C4", + "hardware-port": "PORT-1-{{SLOT_ID}}-C4" + } + }, + "ASSIGNMENT": { + "CH{{SLOT_ID}}01|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}01, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}01 + }, + "CH{{SLOT_ID}}02|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}02, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}02 + }, + "CH{{SLOT_ID}}03|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}03, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}03 + }, + "CH{{SLOT_ID}}04|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}04, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}04 + }, + "CH{{SLOT_ID}}15|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}15, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}15 + }, + "CH{{SLOT_ID}}17|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}17, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}17 + }, + "CH{{SLOT_ID}}18|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}18, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}18 + }, + "CH{{SLOT_ID}}19|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}19, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}19 + }, + "CH{{SLOT_ID}}20|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}10, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}10 + } + } +} diff --git a/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/config_db.json.j2 b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/config_db.json.j2 new file mode 100644 index 000000000000..8ead313ed29a --- /dev/null +++ b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/config_db.json.j2 @@ -0,0 +1,436 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "asic_id": "{{ASIC_ID}}", + "hwsku": "p230c" + } + }, + "LOGICAL_CHANNEL": { + "CH{{SLOT_ID}}01": { + "index": "{{SLOT_ID}}01", + "channel-id": "{{SLOT_ID}}01", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C1", + "description": "GE-1-{{SLOT_ID}}-C1", + "alias": "CH{{SLOT_ID}}01" + }, + "CH{{SLOT_ID}}02": { + "index": "{{SLOT_ID}}02", + "channel-id": "{{SLOT_ID}}02", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C2", + "description": "GE-1-{{SLOT_ID}}-C2", + "alias": "CH{{SLOT_ID}}02" + }, + "CH{{SLOT_ID}}03": { + "index": "{{SLOT_ID}}03", + "channel-id": "{{SLOT_ID}}03", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C3", + "description": "GE-1-{{SLOT_ID}}-C3", + "alias": "CH{{SLOT_ID}}03" + }, + "CH{{SLOT_ID}}04": { + "index": "{{SLOT_ID}}04", + "channel-id": "{{SLOT_ID}}04", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C4", + "description": "GE-1-{{SLOT_ID}}-C4", + "alias": "CH{{SLOT_ID}}04" + }, + "CH{{SLOT_ID}}15": { + "index": "{{SLOT_ID}}15", + "channel-id": "{{SLOT_ID}}15", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-L1", + "description": "OTUCN-1-{{SLOT_ID}}-L1", + "alias": "CH{{SLOT_ID}}15" + }, + "CH{{SLOT_ID}}17": { + "index": "{{SLOT_ID}}17", + "channel-id": "{{SLOT_ID}}17", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C1", + "description": "ODUCN-1-{{SLOT_ID}}-C1", + "alias": "CH{{SLOT_ID}}17" + }, + "CH{{SLOT_ID}}18": { + "index": "{{SLOT_ID}}18", + "channel-id": "{{SLOT_ID}}18", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C2", + "description": "ODUCN-1-{{SLOT_ID}}-C2", + "alias": "CH{{SLOT_ID}}18" + }, + "CH{{SLOT_ID}}19": { + "index": "{{SLOT_ID}}19", + "channel-id": "{{SLOT_ID}}19", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C3", + "description": "ODUCN-1-{{SLOT_ID}}-C3", + "alias": "CH{{SLOT_ID}}19" + }, + "CH{{SLOT_ID}}20": { + "index": "{{SLOT_ID}}10", + "channel-id": "{{SLOT_ID}}10", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C4", + "description": "ODUCN-1-{{SLOT_ID}}-C4", + "alias": "CH{{SLOT_ID}}20" + } + }, + "PORT": { + "PORT-1-{{SLOT_ID}}-L1": { + "index": "1", + "port-type": "LINE", + "port-id": "1", + "subcomponents": "TRANSCEIVER-1-{{SLOT_ID}}-L1", + "alias": "PORT-1-{{SLOT_ID}}-L1" + }, + "PORT-1-{{SLOT_ID}}-C1": { + "index": "3", + "port-type": "CLIENT", + "port-id": "1", + "subcomponents": "TRANSCEIVER-1-{{SLOT_ID}}-C1", + "alias": "PORT-1-{{SLOT_ID}}-C1" + }, + "PORT-1-{{SLOT_ID}}-C2": { + "index": "4", + "port-type": "CLIENT", + "port-id": "2", + "subcomponents": "TRANSCEIVER-1-{{SLOT_ID}}-C2", + "alias": "PORT-1-{{SLOT_ID}}-C2" + }, + "PORT-1-{{SLOT_ID}}-C3": { + "index": "5", + "port-type": "CLIENT", + "port-id": "3", + "subcomponents": "TRANSCEIVER-1-{{SLOT_ID}}-C3", + "alias": "PORT-1-{{SLOT_ID}}-C3" + }, + "PORT-1-{{SLOT_ID}}-C4": { + "index": "6", + "port-type": "CLIENT", + "port-id": "4", + "subcomponents": "TRANSCEIVER-1-{{SLOT_ID}}-C4", + "alias": "PORT-1-{{SLOT_ID}}-C4" + } + }, + "LINECARD": { + "LINECARD-1-{{SLOT_ID}}": { + "linecard-type": "P230C" + } + }, + "TRANSCEIVER": { + "TRANSCEIVER-1-{{SLOT_ID}}-C1": { + "index": 1, + "port-type": "CLIENT", + "port-id": 1, + "parent": "PORT-1-{{SLOT_ID}}-C1", + "physical-channel": "TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-1,TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-2,TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-3,TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-4", + "logical-channel": "CH{{SLOT_ID}}01,CH{{SLOT_ID}}17", + "ethernet": "CH{{SLOT_ID}}01", + "otn": "CH{{SLOT_ID}}17", + "interface": "INTERFACE-1-{{SLOT_ID}}-C1" + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C2": { + "index": 2, + "port-type": "CLIENT", + "port-id": 2, + "parent": "PORT-1-{{SLOT_ID}}-C2", + "physical-channel": "TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-1,TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-2,TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-3,TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-4", + "logical-channel": "CH{{SLOT_ID}}02,CH{{SLOT_ID}}18", + "ethernet": "CH{{SLOT_ID}}02", + "otn": "CH{{SLOT_ID}}18", + "interface": "INTERFACE-1-{{SLOT_ID}}-C2" + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C3": { + "index": 3, + "port-type": "CLIENT", + "port-id": 3, + "parent": "PORT-1-{{SLOT_ID}}-C3", + "physical-channel": "TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-1,TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-2,TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-3,TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-4", + "logical-channel": "CH{{SLOT_ID}}03,CH{{SLOT_ID}}19", + "ethernet": "CH{{SLOT_ID}}03", + "otn": "CH{{SLOT_ID}}19", + "interface": "INTERFACE-1-{{SLOT_ID}}-C3" + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C4": { + "index": 4, + "port-type": "CLIENT", + "port-id": 4, + "parent": "PORT-1-{{SLOT_ID}}-C4", + "physical-channel": "TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-1,TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-2,TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-3,TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-4", + "logical-channel": "CH{{SLOT_ID}}04,CH{{SLOT_ID}}20", + "ethernet": "CH{{SLOT_ID}}04", + "otn": "CH{{SLOT_ID}}20", + "interface": "INTERFACE-1-{{SLOT_ID}}-C4" + }, + "TRANSCEIVER-1-{{SLOT_ID}}-L1": { + "index": 5, + "port-type": "LINE", + "port-id": 1, + "parent": "PORT-1-{{SLOT_ID}}-L1", + "logical-channel": "CH{{SLOT_ID}}15", + "otn": "CH{{SLOT_ID}}15", + "och": "OCH-1-{{SLOT_ID}}-L1" + } + }, + "PHYSICAL_CHANNEL": { + "TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-1": { + "index": 1, + "port-type": "CLIENT", + "port-id": 1, + "lane-id": 1 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-2": { + "index": 2, + "port-type": "CLIENT", + "port-id": 1, + "lane-id": 2 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-3": { + "index": 3, + "port-type": "CLIENT", + "port-id": 1, + "lane-id": 3 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C1|CH-4": { + "index": 4, + "port-type": "CLIENT", + "port-id": 1, + "lane-id": 4 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-1": { + "index": 5, + "port-type": "CLIENT", + "port-id": 2, + "lane-id": 1 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-2": { + "index": 6, + "port-type": "CLIENT", + "port-id": 2, + "lane-id": 2 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-3": { + "index": 7, + "port-type": "CLIENT", + "port-id": 2, + "lane-id": 3 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C2|CH-4": { + "index": 8, + "port-type": "CLIENT", + "port-id": 2, + "lane-id": 4 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-1": { + "index": 9, + "port-type": "CLIENT", + "port-id": 3, + "lane-id": 1 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-2": { + "index": 10, + "port-type": "CLIENT", + "port-id": 3, + "lane-id": 2 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-3": { + "index": 11, + "port-type": "CLIENT", + "port-id": 3, + "lane-id": 3 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C3|CH-4": { + "index": 12, + "port-type": "CLIENT", + "port-id": 3, + "lane-id": 4 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-1": { + "index": 13, + "port-type": "CLIENT", + "port-id": 4, + "lane-id": 1 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-2": { + "index": 14, + "port-type": "CLIENT", + "port-id": 4, + "lane-id": 2 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-3": { + "index": 15, + "port-type": "CLIENT", + "port-id": 4, + "lane-id": 3 + }, + "TRANSCEIVER-1-{{SLOT_ID}}-C4|CH-4": { + "index": 16, + "port-type": "CLIENT", + "port-id": 4, + "lane-id": 4 + } + }, + "OCH": { + "OCH-1-{{SLOT_ID}}-L1": { + "index": 1, + "port-type": "LINE", + "port-id": 1 + } + }, + "LLDP": { + "CH{{SLOT_ID}}01": { + "index": {{SLOT_ID}}01, + "channel-id": {{SLOT_ID}}01 + }, + "CH{{SLOT_ID}}02": { + "index": {{SLOT_ID}}02, + "channel-id": {{SLOT_ID}}02 + }, + "CH{{SLOT_ID}}03": { + "index": {{SLOT_ID}}03, + "channel-id": {{SLOT_ID}}03 + }, + "CH{{SLOT_ID}}04": { + "index": {{SLOT_ID}}04, + "channel-id": {{SLOT_ID}}04 + } + }, + "ETHERNET": { + "CH{{SLOT_ID}}01": { + "index": {{SLOT_ID}}01, + "channel-id": {{SLOT_ID}}01 + }, + "CH{{SLOT_ID}}02": { + "index": {{SLOT_ID}}02, + "channel-id": {{SLOT_ID}}02 + }, + "CH{{SLOT_ID}}03": { + "index": {{SLOT_ID}}03, + "channel-id": {{SLOT_ID}}03 + }, + "CH{{SLOT_ID}}04": { + "index": {{SLOT_ID}}04, + "channel-id": {{SLOT_ID}}04 + } + }, + "OTN": { + "CH{{SLOT_ID}}15": { + "index": {{SLOT_ID}}15, + "channel-id": {{SLOT_ID}}15 + }, + "CH{{SLOT_ID}}17": { + "index": {{SLOT_ID}}17, + "channel-id": {{SLOT_ID}}17 + }, + "CH{{SLOT_ID}}18": { + "index": {{SLOT_ID}}18, + "channel-id": {{SLOT_ID}}18 + }, + "CH{{SLOT_ID}}19": { + "index": {{SLOT_ID}}19, + "channel-id": {{SLOT_ID}}19 + }, + "CH{{SLOT_ID}}20": { + "index": {{SLOT_ID}}10, + "channel-id": {{SLOT_ID}}10 + } + }, + "INTERFACE": { + "INTERFACE-1-{{SLOT_ID}}-C1": { + "index": 1, + "type": "ethernetCsmacd", + "interface-type": "CLIENT", + "interface-id": 1, + "name": "INTERFACE-1-{{SLOT_ID}}-C1", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C1", + "hardware-port": "PORT-1-{{SLOT_ID}}-C1" + }, + "INTERFACE-1-{{SLOT_ID}}-C2": { + "index": 2, + "type": "ethernetCsmacd", + "interface-type": "CLIENT", + "interface-id": 2, + "name": "INTERFACE-1-{{SLOT_ID}}-C2", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C2", + "hardware-port": "PORT-1-{{SLOT_ID}}-C2" + }, + "INTERFACE-1-{{SLOT_ID}}-C3": { + "index": 3, + "type": "ethernetCsmacd", + "interface-type": "CLIENT", + "interface-id": 3, + "name": "INTERFACE-1-{{SLOT_ID}}-C3", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C3", + "hardware-port": "PORT-1-{{SLOT_ID}}-C3" + }, + "INTERFACE-1-{{SLOT_ID}}-C4": { + "index": 4, + "type": "ethernetCsmacd", + "interface-type": "CLIENT", + "interface-id": 4, + "name": "INTERFACE-1-{{SLOT_ID}}-C4", + "transceiver": "TRANSCEIVER-1-{{SLOT_ID}}-C4", + "hardware-port": "PORT-1-{{SLOT_ID}}-C4" + } + }, + "ASSIGNMENT": { + "CH{{SLOT_ID}}01|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}01, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}01 + }, + "CH{{SLOT_ID}}02|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}02, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}02 + }, + "CH{{SLOT_ID}}03|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}03, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}03 + }, + "CH{{SLOT_ID}}04|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}04, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}04 + }, + "CH{{SLOT_ID}}15|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}15, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}15 + }, + "CH{{SLOT_ID}}17|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}17, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}17 + }, + "CH{{SLOT_ID}}18|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}18, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}18 + }, + "CH{{SLOT_ID}}19|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}19, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}19 + }, + "CH{{SLOT_ID}}20|ASS1": { + "index": 1, + "channel-id": {{SLOT_ID}}10, + "id": 1, + "assignment-type": "LOGICAL_CHANNEL", + "logical-channel": {{SLOT_ID}}10 + } + } +} diff --git a/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/flexcounter.json b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/flexcounter.json new file mode 100644 index 000000000000..78ff681b0677 --- /dev/null +++ b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/linecards/p230c/flexcounter.json @@ -0,0 +1,1233 @@ + +[ + { + "PORT_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_PORT_ATTR_OPER_STATUS", + + + "attr2": "OTAI_PORT_ATTR_ADMIN_STATE", + + + "attr3": "OTAI_PORT_ATTR_RX_CD_RANGE", + + + "attr4": "OTAI_PORT_ATTR_ROLL_OFF", + + + "attr5": "OTAI_PORT_ATTR_LED_MODE", + + + "attr6": "OTAI_PORT_ATTR_LED_FLASH_INTERVAL", + + + "attr7": "OTAI_PORT_ATTR_LED_COLOR", + + + "attr8": "OTAI_PORT_ATTR_LOS_THRESHOLD", + + + "attr9": "OTAI_PORT_ATTR_OPTICAL_PORT_TYPE", + + + "attr10": "OTAI_PORT_ATTR_EMPTY", + + + "attr11": "OTAI_PORT_ATTR_REMOVABLE", + + + "attr12": "OTAI_PORT_ATTR_EQUIPMENT_FAILURE", + + + "attr13": "OTAI_PORT_ATTR_EQUIPMENT_MISMATCH", + + + "attr14": "OTAI_PORT_ATTR_LOW_THRESHOLD", + + + "attr15": "OTAI_PORT_ATTR_HIGH_THRESHOLD" + + + }, + "OP": "SET" + }, + { + "PORT_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_PORT_STAT_INPUT_POWER", + + + "attr2": "OTAI_PORT_STAT_OUTPUT_POWER" + + + }, + "OP": "SET" + }, + { + "TRANSCEIVER_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_TRANSCEIVER_ATTR_ENABLED", + + + "attr2": "OTAI_TRANSCEIVER_ATTR_OPER_STATUS", + + + "attr3": "OTAI_TRANSCEIVER_ATTR_FEC_MODE", + + + "attr4": "OTAI_TRANSCEIVER_ATTR_PRESENT", + + + "attr5": "OTAI_TRANSCEIVER_ATTR_FORM_FACTOR", + + + "attr6": "OTAI_TRANSCEIVER_ATTR_VENDOR_EXPECT", + + + "attr7": "OTAI_TRANSCEIVER_ATTR_VENDOR", + + + "attr8": "OTAI_TRANSCEIVER_ATTR_VENDOR_PART", + + + "attr9": "OTAI_TRANSCEIVER_ATTR_PART_NO", + + + "attr10": "OTAI_TRANSCEIVER_ATTR_VENDOR_REV", + + + "attr11": "OTAI_TRANSCEIVER_ATTR_DATE_CODE", + + + "attr12": "OTAI_TRANSCEIVER_ATTR_MFG_NAME", + + + "attr13": "OTAI_TRANSCEIVER_ATTR_MFG_DATE", + + + "attr14": "OTAI_TRANSCEIVER_ATTR_HARDWARE_VERSION", + + + "attr15": "OTAI_TRANSCEIVER_ATTR_FIRMWARE_VERSION", + + + "attr16": "OTAI_TRANSCEIVER_ATTR_ETHERNET_PMD", + + + "attr17": "OTAI_TRANSCEIVER_ATTR_ETHERNET_PMD_PRECONF", + + + "attr18": "OTAI_TRANSCEIVER_ATTR_FAULT_CONDITION", + + + "attr19": "OTAI_TRANSCEIVER_ATTR_REMOVABLE", + + + "attr20": "OTAI_TRANSCEIVER_ATTR_CONNECTOR_TYPE", + + + "attr21": "OTAI_TRANSCEIVER_ATTR_SERIAL_NO", + + + "attr22": "OTAI_TRANSCEIVER_ATTR_POWER_MODE", + + + "attr23": "OTAI_TRANSCEIVER_ATTR_RESET", + + + "attr24": "OTAI_TRANSCEIVER_ATTR_NUM_OF_LANE", + + + "attr25": "OTAI_TRANSCEIVER_ATTR_UPGRADE_DOWNLOAD", + + + "attr26": "OTAI_TRANSCEIVER_ATTR_SWITCH_FLASH_PARTITION", + + + "attr27": "OTAI_TRANSCEIVER_ATTR_BACKUP_FLASH_PARTITION", + + + "attr28": "OTAI_TRANSCEIVER_ATTR_UPGRADE_STATE", + + + "attr29": "OTAI_TRANSCEIVER_ATTR_LASER_AGE", + + + "attr30": "OTAI_TRANSCEIVER_ATTR_OPERATE_TIME", + + + "attr31": "OTAI_TRANSCEIVER_ATTR_LOT_CODE", + + + "attr32": "OTAI_TRANSCEIVER_ATTR_CLEI_CODE", + + + "attr33": "OTAI_TRANSCEIVER_ATTR_POWER_CLASS", + + + "attr34": "OTAI_TRANSCEIVER_ATTR_NEWWORK_BIT_RATE", + + + "attr35": "OTAI_TRANSCEIVER_ATTR_HOST_BIT_RATE", + + + "attr36": "OTAI_TRANSCEIVER_ATTR_SM_FIBER_LEN", + + + "attr37": "OTAI_TRANSCEIVER_ATTR_MM_FIBER_LEN", + + + "attr38": "OTAI_TRANSCEIVER_ATTR_COPPER_CABLE_LEN", + + + "attr39": "OTAI_TRANSCEIVER_ATTR_MAX_WAVELENGTH", + + + "attr40": "OTAI_TRANSCEIVER_ATTR_MIN_WAVELENGTH", + + + "attr41": "OTAI_TRANSCEIVER_ATTR_MAX_TX_POWER", + + + "attr42": "OTAI_TRANSCEIVER_ATTR_MAX_RX_POWER", + + + "attr43": "OTAI_TRANSCEIVER_ATTR_MAX_OPER_TEMP", + + + "attr44": "OTAI_TRANSCEIVER_ATTR_MIN_OPER_TEMP", + + + "attr45": "OTAI_TRANSCEIVER_ATTR_VCC_HIGH_ALARM_THRESHOLD", + + + "attr46": "OTAI_TRANSCEIVER_ATTR_VCC_HIGH_WARN_THRESHOLD", + + + "attr47": "OTAI_TRANSCEIVER_ATTR_VCC_LOW_ALARM_THRESHOLD", + + + "attr48": "OTAI_TRANSCEIVER_ATTR_VCC_LOW_WARN_THRESHOLD", + + + "attr49": "OTAI_TRANSCEIVER_ATTR_RX_TOTAL_POWER_HIGH_ALARM_THRESHOLD", + + + "attr50": "OTAI_TRANSCEIVER_ATTR_RX_TOTAL_POWER_HIGH_WARN_THRESHOLD", + + + "attr51": "OTAI_TRANSCEIVER_ATTR_RX_TOTAL_POWER_LOW_ALARM_THRESHOLD", + + + "attr52": "OTAI_TRANSCEIVER_ATTR_RX_TOTAL_POWER_LOW_WARN_THRESHOLD", + + + "attr53": "OTAI_TRANSCEIVER_ATTR_OA_PUMP_CURRENT_HIGH_ALARM_THRESHOLD", + + + "attr54": "OTAI_TRANSCEIVER_ATTR_OA_PUMP_CURRENT_HIGH_WARN_THRESHOLD", + + + "attr55": "OTAI_TRANSCEIVER_ATTR_OA_PUMP_CURRENT_LOW_ALARM_THRESHOLD", + + + "attr56": "OTAI_TRANSCEIVER_ATTR_OA_PUMP_CURRENT_LOW_WARN_THRESHOLD", + + + "attr57": "OTAI_TRANSCEIVER_ATTR_TX_BAIS_HIGH_ALARM_THRESHOLD", + + + "attr58": "OTAI_TRANSCEIVER_ATTR_TX_BAIS_HIGH_WARN_THRESHOLD", + + + "attr59": "OTAI_TRANSCEIVER_ATTR_TX_BAIS_LOW_ALARM_THRESHOLD", + + + "attr60": "OTAI_TRANSCEIVER_ATTR_TX_BAIS_LOW_WARN_THRESHOLD", + + + "attr61": "OTAI_TRANSCEIVER_ATTR_EXTEND_MODULE_CODE", + + + "attr62": "OTAI_TRANSCEIVER_ATTR_DATA_STATUS", + + + "attr63": "OTAI_TRANSCEIVER_ATTR_ENCODE", + + + "attr64": "OTAI_TRANSCEIVER_ATTR_BITRATE", + + + "attr65": "OTAI_TRANSCEIVER_ATTR_EXTEND_BIT_RATE", + + + "attr66": "OTAI_TRANSCEIVER_ATTR_WAVELENGTH", + + + "attr67": "OTAI_TRANSCEIVER_ATTR_WAVELENGTH_TOLERANCE", + + + "attr68": "OTAI_TRANSCEIVER_ATTR_OUI", + + + "attr69": "OTAI_TRANSCEIVER_ATTR_RN", + + + "attr70": "OTAI_TRANSCEIVER_ATTR_IDENTIFIER", + + + "attr71": "OTAI_TRANSCEIVER_ATTR_CMIS_REVISION", + + + "attr72": "OTAI_TRANSCEIVER_ATTR_TX_POWER_HIGH_ALARM_THRESHOLD", + + + "attr73": "OTAI_TRANSCEIVER_ATTR_TX_POWER_LOW_ALARM_THRESHOLD", + + + "attr74": "OTAI_TRANSCEIVER_ATTR_TX_POWER_HIGH_WARN_THRESHOLD", + + + "attr75": "OTAI_TRANSCEIVER_ATTR_TX_POWER_LOW_WARN_THRESHOLD", + + + "attr76": "OTAI_TRANSCEIVER_ATTR_FREQUENCY_RANGE", + + + "attr77": "OTAI_TRANSCEIVER_ATTR_TEMP_HIGH_ALARM_THRESHOLD", + + + "attr78": "OTAI_TRANSCEIVER_ATTR_TEMP_HIGH_WARN_THRESHOLD", + + + "attr79": "OTAI_TRANSCEIVER_ATTR_TEMP_LOW_ALARM_THRESHOLD", + + + "attr80": "OTAI_TRANSCEIVER_ATTR_TEMP_LOW_WARN_THRESHOLD" + + + }, + "OP": "SET" + }, + { + "TRANSCEIVER_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_TRANSCEIVER_STAT_INPUT_POWER", + + + "attr2": "OTAI_TRANSCEIVER_STAT_OUTPUT_POWER", + + + "attr3": "OTAI_TRANSCEIVER_STAT_LASER_BIAS_CURRENT", + + + "attr4": "OTAI_TRANSCEIVER_STAT_TEMPERATURE", + + + "attr5": "OTAI_TRANSCEIVER_STAT_PRE_FEC_BER", + + + "attr6": "OTAI_TRANSCEIVER_STAT_POST_FEC_BER", + + + "attr7": "OTAI_TRANSCEIVER_STAT_EDFA_BIAS_CURRENT", + + + "attr8": "OTAI_TRANSCEIVER_STAT_LASER_BIAS_VOLTAGE", + + + "attr9": "OTAI_TRANSCEIVER_STAT_CASE_TEMPERATURE", + + + "attr10": "OTAI_TRANSCEIVER_STAT_POWER_CONSUMPTION", + + + "attr11": "OTAI_TRANSCEIVER_STAT_TX_MOD_BIAS_XI", + + + "attr12": "OTAI_TRANSCEIVER_STAT_TX_MOD_BIAS_XQ", + + + "attr13": "OTAI_TRANSCEIVER_STAT_TX_MOD_BIAS_YI", + + + "attr14": "OTAI_TRANSCEIVER_STAT_TX_MOD_BIAS_YQ", + + + "attr15": "OTAI_TRANSCEIVER_STAT_TX_MOD_BIAS_XPH", + + + "attr16": "OTAI_TRANSCEIVER_STAT_TX_MOD_BIAS_YPH" + + + }, + "OP": "SET" + }, + { + "TRANSCEIVER_COUNTER_ID_LIST_COUNTER": { + + "attr1": "OTAI_TRANSCEIVER_STAT_FEC_UNCORRECTABLE_WORDS", + + + "attr2": "OTAI_TRANSCEIVER_STAT_LOSS_TIME" + + + }, + "OP": "SET" + }, + { + "PHYSICALCH_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_PHYSICALCHANNEL_ATTR_TX_LASER", + + + "attr2": "OTAI_PHYSICALCHANNEL_ATTR_OUTPUT_FREQUENCY" + + + }, + "OP": "SET" + }, + { + "PHYSICALCH_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_PHYSICALCHANNEL_STAT_OUTPUT_POWER", + + + "attr2": "OTAI_PHYSICALCHANNEL_STAT_INPUT_POWER", + + + "attr3": "OTAI_PHYSICALCHANNEL_STAT_LASER_BIAS_CURRENT" + + + }, + "OP": "SET" + }, + { + "OPTICALCH_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_OCH_ATTR_FREQUENCY", + + + "attr2": "OTAI_OCH_ATTR_TARGET_OUTPUT_POWER", + + + "attr3": "OTAI_OCH_ATTR_OPERATIONAL_MODE", + + + "attr4": "OTAI_OCH_ATTR_OPER_STATUS" + + + }, + "OP": "SET" + }, + { + "OPTICALCH_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_OCH_STAT_POLARIZATION_MODE_DISPERSION", + + + "attr2": "OTAI_OCH_STAT_GROUP_DELAY", + + + "attr3": "OTAI_OCH_STAT_INPUT_POWER", + + + "attr4": "OTAI_OCH_STAT_CHROMATIC_DISPERSION", + + + "attr5": "OTAI_OCH_STAT_OUTPUT_POWER", + + + "attr6": "OTAI_OCH_STAT_LASER_BIAS_CURRENT", + + + "attr7": "OTAI_OCH_STAT_SECOND_ORDER_POLARIZATION_MODE_DISPERSION", + + + "attr8": "OTAI_OCH_STAT_OSNR", + + + "attr9": "OTAI_OCH_STAT_SOP_VECTOR_S1", + + + "attr10": "OTAI_OCH_STAT_SOP_VECTOR_S2", + + + "attr11": "OTAI_OCH_STAT_SOP_VECTOR_S3", + + + "attr12": "OTAI_OCH_STAT_SOP_CHANGE_RATE", + + + "attr13": "OTAI_OCH_STAT_TX_LASER_AGE", + + + "attr14": "OTAI_OCH_STAT_POLARIZATION_DEPENDENT_LOSS", + + + "attr15": "OTAI_OCH_STAT_INPUT_SIGNAL_POWER", + + + "attr16": "OTAI_OCH_STAT_EDFA_BIAS_CURRENT", + + + "attr17": "OTAI_OCH_STAT_ACTUAL_FREQUENCY_OFFSET" + + + }, + "OP": "SET" + }, + { + "LOGICALCH_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_LOGICALCHANNEL_ATTR_LOGICAL_CHANNEL_TYPE", + + + "attr2": "OTAI_LOGICALCHANNEL_ATTR_LOOPBACK_MODE", + + + "attr3": "OTAI_LOGICALCHANNEL_ATTR_RATE_CLASS", + + + "attr4": "OTAI_LOGICALCHANNEL_ATTR_TRIB_PROTOCOL", + + + "attr5": "OTAI_LOGICALCHANNEL_ATTR_TEST_SIGNAL", + + + "attr6": "OTAI_LOGICALCHANNEL_ATTR_ADMIN_STATE", + + + "attr7": "OTAI_LOGICALCHANNEL_ATTR_LINK_STATE", + + + "attr8": "OTAI_LOGICALCHANNEL_ATTR_LINK_DOWN_DELAY_MODE", + + + "attr9": "OTAI_LOGICALCHANNEL_ATTR_LINK_DOWN_DELAY_HOLD_OFF", + + + "attr10": "OTAI_LOGICALCHANNEL_ATTR_LINK_UP_DELAY_MODE", + + + "attr11": "OTAI_LOGICALCHANNEL_ATTR_LINK_UP_DELAY_HOLD_OFF", + + + "attr12": "OTAI_LOGICALCHANNEL_ATTR_LINK_UP_DELAY_ACTIVE_THRESHOLD", + + + "attr13": "OTAI_LOGICALCHANNEL_ATTR_TEST_SIGNAL_PATTERN", + + + "attr14": "OTAI_LOGICALCHANNEL_ATTR_TX_TEST_SIGNAL_PATTERN", + + + "attr15": "OTAI_LOGICALCHANNEL_ATTR_RX_TEST_SIGNAL_PATTERN" + + + }, + "OP": "SET" + }, + { + "ETHERNET_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_ETHERNET_ATTR_CLIENT_ALS", + + + "attr2": "OTAI_ETHERNET_ATTR_ALS_DELAY", + + + "attr3": "OTAI_ETHERNET_ATTR_MAINTENANCE", + + + "attr4": "OTAI_ETHERNET_ATTR_CLIENT_RX_ALS", + + + "attr5": "OTAI_ETHERNET_ATTR_CLIENT_RX_ALS_DELAY" + + + }, + "OP": "SET" + }, + { + "ETHERNET_COUNTER_ID_LIST_COUNTER": { + + "attr1": "OTAI_ETHERNET_STAT_IN_MAC_CONTROL_FRAMES", + + + "attr2": "OTAI_ETHERNET_STAT_IN_MAC_PAUSE_FRAMES", + + + "attr3": "OTAI_ETHERNET_STAT_IN_OVERSIZE_FRAMES", + + + "attr4": "OTAI_ETHERNET_STAT_IN_UNDERSIZE_FRAMES", + + + "attr5": "OTAI_ETHERNET_STAT_IN_JABBER_FRAMES", + + + "attr6": "OTAI_ETHERNET_STAT_IN_FRAGMENT_FRAMES", + + + "attr7": "OTAI_ETHERNET_STAT_IN_8021Q_FRAMES", + + + "attr8": "OTAI_ETHERNET_STAT_IN_CRC_ERRORS", + + + "attr9": "OTAI_ETHERNET_STAT_IN_BLOCK_ERRORS", + + + "attr10": "OTAI_ETHERNET_STAT_OUT_MAC_CONTROL_FRAMES", + + + "attr11": "OTAI_ETHERNET_STAT_OUT_MAC_PAUSE_FRAMES", + + + "attr12": "OTAI_ETHERNET_STAT_OUT_8021Q_FRAMES", + + + "attr13": "OTAI_ETHERNET_STAT_IN_PCS_BIP_ERRORS", + + + "attr14": "OTAI_ETHERNET_STAT_IN_PCS_ERRORED_SECONDS", + + + "attr15": "OTAI_ETHERNET_STAT_IN_PCS_SEVERELY_ERRORED_SECONDS", + + + "attr16": "OTAI_ETHERNET_STAT_IN_PCS_UNAVAILABLE_SECONDS", + + + "attr17": "OTAI_ETHERNET_STAT_OUT_PCS_BIP_ERRORS", + + + "attr18": "OTAI_ETHERNET_STAT_OUT_CRC_ERRORS", + + + "attr19": "OTAI_ETHERNET_STAT_OUT_BLOCK_ERRORS", + + + "attr20": "OTAI_ETHERNET_STAT_TX_GOOD_FRAME", + + + "attr21": "OTAI_ETHERNET_STAT_TX_GOOD_OCTETS", + + + "attr22": "OTAI_ETHERNET_STAT_TX_GOOD_MULTICAST", + + + "attr23": "OTAI_ETHERNET_STAT_TX_GOOD_BROADCAST", + + + "attr24": "OTAI_ETHERNET_STAT_TX_GOOD_64B", + + + "attr25": "OTAI_ETHERNET_STAT_TX_GOOD_65B_127B", + + + "attr26": "OTAI_ETHERNET_STAT_TX_GOOD_128B_255B", + + + "attr27": "OTAI_ETHERNET_STAT_TX_GOOD_256B_511B", + + + "attr28": "OTAI_ETHERNET_STAT_TX_GOOD_512B_1023B", + + + "attr29": "OTAI_ETHERNET_STAT_TX_GOOD_1024B_1518B", + + + "attr30": "OTAI_ETHERNET_STAT_TX_GOOD_1519B_LTJ", + + + "attr31": "OTAI_ETHERNET_STAT_TX_GOOD_JUMBO", + + + "attr32": "OTAI_ETHERNET_STAT_TX_BAD_FRAME", + + + "attr33": "OTAI_ETHERNET_STAT_TX_BAD_OCTETS", + + + "attr34": "OTAI_ETHERNET_STAT_TX_BAD_MULTICAST", + + + "attr35": "OTAI_ETHERNET_STAT_TX_BAD_BROADCAST", + + + "attr36": "OTAI_ETHERNET_STAT_TX_BAD_LT_64B", + + + "attr37": "OTAI_ETHERNET_STAT_TX_BAD_64B", + + + "attr38": "OTAI_ETHERNET_STAT_TX_BAD_65B_127B", + + + "attr39": "OTAI_ETHERNET_STAT_TX_BAD_128B_255B", + + + "attr40": "OTAI_ETHERNET_STAT_TX_BAD_256B_511B", + + + "attr41": "OTAI_ETHERNET_STAT_TX_BAD_512B_1023B", + + + "attr42": "OTAI_ETHERNET_STAT_TX_BAD_1024B_1518B", + + + "attr43": "OTAI_ETHERNET_STAT_TX_BAD_1519B_LTJ", + + + "attr44": "OTAI_ETHERNET_STAT_TX_BAD_JUMBO", + + + "attr45": "OTAI_ETHERNET_STAT_TX_OCTETS", + + + "attr46": "OTAI_ETHERNET_STAT_TX_FRAME", + + + "attr47": "OTAI_ETHERNET_STAT_TX_BROADCAST", + + + "attr48": "OTAI_ETHERNET_STAT_TX_MULTICAST", + + + "attr49": "OTAI_ETHERNET_STAT_TX_CRC_ALIGN", + + + "attr50": "OTAI_ETHERNET_STAT_TX_UNDER_SIZE", + + + "attr51": "OTAI_ETHERNET_STAT_TX_OVER_SIZE", + + + "attr52": "OTAI_ETHERNET_STAT_TX_FRAGMENT", + + + "attr53": "OTAI_ETHERNET_STAT_TX_JABBER", + + + "attr54": "OTAI_ETHERNET_STAT_TX_64B", + + + "attr55": "OTAI_ETHERNET_STAT_TX_65B_127B", + + + "attr56": "OTAI_ETHERNET_STAT_TX_128B_255B", + + + "attr57": "OTAI_ETHERNET_STAT_TX_256B_511B", + + + "attr58": "OTAI_ETHERNET_STAT_TX_512B_1023B", + + + "attr59": "OTAI_ETHERNET_STAT_TX_1024B_1518B", + + + "attr60": "OTAI_ETHERNET_STAT_TX_1519B_MAX", + + + "attr61": "OTAI_ETHERNET_STAT_RX_GOOD_FRAME", + + + "attr62": "OTAI_ETHERNET_STAT_RX_GOOD_OCTETS", + + + "attr63": "OTAI_ETHERNET_STAT_RX_GOOD_FRAME", + + + "attr64": "OTAI_ETHERNET_STAT_RX_GOOD_MULTICAST", + + + "attr65": "OTAI_ETHERNET_STAT_RX_GOOD_BROADCAST", + + + "attr66": "OTAI_ETHERNET_STAT_RX_GOOD_64B", + + + "attr67": "OTAI_ETHERNET_STAT_RX_GOOD_65B_127B", + + + "attr68": "OTAI_ETHERNET_STAT_RX_GOOD_128B_255B", + + + "attr69": "OTAI_ETHERNET_STAT_RX_GOOD_256B_511B", + + + "attr70": "OTAI_ETHERNET_STAT_RX_GOOD_512B_1023B", + + + "attr71": "OTAI_ETHERNET_STAT_RX_GOOD_1024B_1518B", + + + "attr72": "OTAI_ETHERNET_STAT_RX_GOOD_1519B_LTJ", + + + "attr73": "OTAI_ETHERNET_STAT_RX_GOOD_JUMBO", + + + "attr74": "OTAI_ETHERNET_STAT_RX_BAD_FRAME", + + + "attr75": "OTAI_ETHERNET_STAT_RX_BAD_OCTETS", + + + "attr76": "OTAI_ETHERNET_STAT_RX_BAD_MULTICAST", + + + "attr77": "OTAI_ETHERNET_STAT_RX_BAD_BROADCAST", + + + "attr78": "OTAI_ETHERNET_STAT_RX_BAD_LT_64B", + + + "attr79": "OTAI_ETHERNET_STAT_RX_BAD_64B", + + + "attr80": "OTAI_ETHERNET_STAT_RX_BAD_65B_127B", + + + "attr81": "OTAI_ETHERNET_STAT_RX_BAD_128B_255B", + + + "attr82": "OTAI_ETHERNET_STAT_RX_BAD_256B_511B", + + + "attr83": "OTAI_ETHERNET_STAT_RX_BAD_512B_1023B", + + + "attr84": "OTAI_ETHERNET_STAT_RX_BAD_1024B_1518B", + + + "attr85": "OTAI_ETHERNET_STAT_RX_BAD_1519B_LTJ", + + + "attr86": "OTAI_ETHERNET_STAT_RX_BAD_JUMBO", + + + "attr87": "OTAI_ETHERNET_STAT_RX_OCTETS", + + + "attr88": "OTAI_ETHERNET_STAT_RX_FRAME", + + + "attr89": "OTAI_ETHERNET_STAT_RX_BROADCAST", + + + "attr90": "OTAI_ETHERNET_STAT_RX_MULTICAST", + + + "attr91": "OTAI_ETHERNET_STAT_RX_CRC_ALIGN", + + + "attr92": "OTAI_ETHERNET_STAT_RX_64B", + + + "attr93": "OTAI_ETHERNET_STAT_RX_65B_127B", + + + "attr94": "OTAI_ETHERNET_STAT_RX_128B_255B", + + + "attr95": "OTAI_ETHERNET_STAT_RX_256B_511B", + + + "attr96": "OTAI_ETHERNET_STAT_RX_512B_1023B", + + + "attr97": "OTAI_ETHERNET_STAT_RX_1024B_1518B", + + + "attr98": "OTAI_ETHERNET_STAT_RX_1519B_MAX", + + + "attr99": "OTAI_ETHERNET_STAT_LAST_CLEAN_UP" + + + }, + "OP": "SET" + }, + { + "LLDP_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_LLDP_ATTR_ENABLED", + + + "attr2": "OTAI_LLDP_ATTR_SNOOPING", + + + "attr3": "OTAI_LLDP_ATTR_NEIGHBOR_SYSTEM_NAME", + + + "attr4": "OTAI_LLDP_ATTR_NEIGHBOR_SYSTEM_DESCRIPTION", + + + "attr5": "OTAI_LLDP_ATTR_NEIGHBOR_CHASSIS_ID", + + + "attr6": "OTAI_LLDP_ATTR_NEIGHBOR_CHASSIS_ID_TYPE", + + + "attr7": "OTAI_LLDP_ATTR_NEIGHBOR_ID", + + + "attr8": "OTAI_LLDP_ATTR_NEIGHBOR_LAST_UPDATE", + + + "attr9": "OTAI_LLDP_ATTR_NEIGHBOR_PORT_ID", + + + "attr10": "OTAI_LLDP_ATTR_NEIGHBOR_PORT_ID_TYPE", + + + "attr11": "OTAI_LLDP_ATTR_NEIGHBOR_PORT_DESCRIPTION", + + + "attr12": "OTAI_LLDP_ATTR_NEIGHBOR_MANAGEMENT_ADDRESS", + + + "attr13": "OTAI_LLDP_ATTR_NEIGHBOR_MANAGEMENT_ADDRESS_TYPE" + + + }, + "OP": "SET" + }, + { + "OTN_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_OTN_ATTR_TTI_MSG_TRANSMIT", + + + "attr2": "OTAI_OTN_ATTR_TTI_MSG_EXPECTED", + + + "attr3": "OTAI_OTN_ATTR_TTI_MSG_RECV", + + + "attr4": "OTAI_OTN_ATTR_RDI_MSG", + + + "attr5": "OTAI_OTN_ATTR_TTI_MSG_AUTO", + + + "attr6": "OTAI_OTN_ATTR_DELAY_MEASUREMENT_ENABLED", + + + "attr7": "OTAI_OTN_ATTR_DELAY_MEASUREMENT_MODE", + + + "attr8": "OTAI_OTN_ATTR_MAINTENANCE" + + + }, + "OP": "SET" + }, + { + "OTN_COUNTER_ID_LIST_COUNTER": { + + "attr1": "OTAI_OTN_STAT_ERRORED_SECONDS", + + + "attr2": "OTAI_OTN_STAT_SEVERELY_ERRORED_SECONDS", + + + "attr3": "OTAI_OTN_STAT_UNAVAILABLE_SECONDS", + + + "attr4": "OTAI_OTN_STAT_ERRORED_BLOCKS", + + + "attr5": "OTAI_OTN_STAT_FEC_UNCORRECTABLE_BLOCKS", + + + "attr6": "OTAI_OTN_STAT_FEC_CORRECTED_BITS", + + + "attr7": "OTAI_OTN_STAT_BACKGROUND_BLOCK_ERRORS", + + + "attr8": "OTAI_OTN_STAT_SM_BEI", + + + "attr9": "OTAI_OTN_STAT_CODE_VIOLATIONS" + + + }, + "OP": "SET" + }, + { + "OTN_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_OTN_STAT_ESNR", + + + "attr2": "OTAI_OTN_STAT_PRE_FEC_BER", + + + "attr3": "OTAI_OTN_STAT_Q_VALUE", + + + "attr4": "OTAI_OTN_STAT_POST_FEC_BER", + + + "attr5": "OTAI_OTN_STAT_DELAY", + + + "attr6": "OTAI_OTN_STAT_Q_MARGIN" + + + }, + "OP": "SET" + }, + { + "LINECARD_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_LINECARD_ATTR_ADMIN_STATE", + + + "attr2": "OTAI_LINECARD_ATTR_BOARD_MODE", + + + "attr3": "OTAI_LINECARD_ATTR_OPER_STATUS", + + + "attr4": "OTAI_LINECARD_ATTR_RELAY", + + + "attr5": "OTAI_LINECARD_ATTR_HOSTNAME", + + + "attr6": "OTAI_LINECARD_ATTR_CPLD_VERSION", + + + "attr7": "OTAI_LINECARD_ATTR_SCRIPT_VERSION", + + + "attr8": "OTAI_LINECARD_ATTR_MFG_NAME", + + + "attr9": "OTAI_LINECARD_ATTR_BAUD_RATE", + + + "attr10": "OTAI_LINECARD_ATTR_SOFTWARE_VERSION", + + + "attr11": "OTAI_LINECARD_ATTR_FPGA_VERSION", + + + "attr12": "OTAI_LINECARD_ATTR_UCD_VERSION", + + + "attr13": "OTAI_LINECARD_ATTR_TEMP_HIGH_ALARM_THRESHOLD", + + + "attr14": "OTAI_LINECARD_ATTR_TEMP_HIGH_WARN_THRESHOLD", + + + "attr15": "OTAI_LINECARD_ATTR_TEMP_LOW_ALARM_THRESHOLD", + + + "attr16": "OTAI_LINECARD_ATTR_TEMP_LOW_WARN_THRESHOLD", + + + "attr17": "OTAI_LINECARD_ATTR_SLOT_ID", + + + "attr18": "OTAI_LINECARD_ATTR_LED_MODE", + + + "attr19": "OTAI_LINECARD_ATTR_LED_FLASH_INTERVAL", + + + "attr20": "OTAI_LINECARD_ATTR_LED_COLOR", + + + "attr21": "OTAI_LINECARD_ATTR_EQUIPMENT_FAILURE", + + + "attr22": "OTAI_LINECARD_ATTR_EQUIPMENT_MISMATCH" + + + }, + "OP": "SET" + }, + { + "LINECARD_COUNTER_ID_LIST_GAUGE": { + + "attr1": "OTAI_LINECARD_STAT_MEMORY_AVAILABLE", + + + "attr2": "OTAI_LINECARD_STAT_MEMORY_UTILIZED", + + + "attr3": "OTAI_LINECARD_STAT_CPU_UTILIZATION", + + + "attr4": "OTAI_LINECARD_STAT_TEMPERATURE" + + + }, + "OP": "SET" + }, + { + "ASSIGNMENT_COUNTER_ID_LIST_STATUS": { + + "attr1": "OTAI_ASSIGNMENT_ATTR_DESCRIPTION", + + + "attr2": "OTAI_ASSIGNMENT_ATTR_ALLOCATION", + + + "attr3": "OTAI_ASSIGNMENT_ATTR_TRIBUTARY_SLOT_INDEX", + + + "attr4": "OTAI_ASSIGNMENT_ATTR_MAPPING" + + + }, + "OP": "SET" + }, + { + "INTERFACE_COUNTER_ID_LIST_COUNTER": { + + "attr1": "OTAI_INTERFACE_STAT_OUT_MULTICAST_PKTS", + + + "attr2": "OTAI_INTERFACE_STAT_IN_OCTETS", + + + "attr3": "OTAI_INTERFACE_STAT_OUT_PKTS", + + + "attr4": "OTAI_INTERFACE_STAT_OUT_BROADCAST_PKTS", + + + "attr5": "OTAI_INTERFACE_STAT_OUT_OCTETS", + + + "attr6": "OTAI_INTERFACE_STAT_LAST_CLEAR", + + + "attr7": "OTAI_INTERFACE_STAT_IN_PKTS", + + + "attr8": "OTAI_INTERFACE_STAT_IN_MULTICAST_PKTS", + + + "attr9": "OTAI_INTERFACE_STAT_IN_ERRORS", + + + "attr10": "OTAI_INTERFACE_STAT_IN_BROADCAST_PKTS", + + + "attr11": "OTAI_INTERFACE_STAT_OUT_ERRORS", + + + "attr12": "OTAI_INTERFACE_STAT_IN_CRC_ERRORS", + + + "attr13": "OTAI_INTERFACE_STAT_IN_UNDERSIZE_FRAMES", + + + "attr14": "OTAI_INTERFACE_STAT_IN_FRAMES_1024_1518_OCTETS", + + + "attr15": "OTAI_INTERFACE_STAT_IN_FRAMES_256_511_OCTETS", + + + "attr16": "OTAI_INTERFACE_STAT_IN_FRAMES_65_127_OCTETS", + + + "attr17": "OTAI_INTERFACE_STAT_IN_FRAMES_128_255_OCTETS", + + + "attr18": "OTAI_INTERFACE_STAT_IN_FRAMES_512_1023_OCTETS", + + + "attr19": "OTAI_INTERFACE_STAT_IN_FRAMES_64_OCTETS", + + + "attr20": "OTAI_INTERFACE_STAT_IN_OVERSIZE_FRAMES", + + + "attr21": "OTAI_INTERFACE_STAT_IN_JABBER_FRAMES", + + + "attr22": "OTAI_INTERFACE_STAT_CARRIER_TRANSITIONS", + + + "attr23": "OTAI_INTERFACE_STAT_IN_8021Q_FRAMES", + + + "attr24": "OTAI_INTERFACE_STAT_IN_BLOCK_ERRORS", + + + "attr25": "OTAI_INTERFACE_STAT_IN_CARRIER_ERRORS", + + + "attr26": "OTAI_INTERFACE_STAT_IN_DISCARDS", + + + "attr27": "OTAI_INTERFACE_STAT_IN_FCS_ERRORS", + + + "attr28": "OTAI_INTERFACE_STAT_IN_FRAGMENT_FRAMES", + + + "attr29": "OTAI_INTERFACE_STAT_IN_INTERRUPTED_TX", + + + "attr30": "OTAI_INTERFACE_STAT_IN_LATE_COLLISION", + + + "attr31": "OTAI_INTERFACE_STAT_IN_MAC_CONTROL_FRAMES", + + + "attr32": "OTAI_INTERFACE_STAT_IN_MAC_ERRORS_RX", + + + "attr33": "OTAI_INTERFACE_STAT_IN_MAC_PAUSE_FRAMES", + + + "attr34": "OTAI_INTERFACE_STAT_IN_MAXSIZE_EXCEEDED", + + + "attr35": "OTAI_INTERFACE_STAT_IN_SINGLE_COLLISION", + + + "attr36": "OTAI_INTERFACE_STAT_IN_SYMBOL_ERROR", + + + "attr37": "OTAI_INTERFACE_STAT_IN_UNICAST_PKTS", + + + "attr38": "OTAI_INTERFACE_STAT_IN_UNKNOWN_PROTOS", + + + "attr39": "OTAI_INTERFACE_STAT_OUT_8021Q_FRAMES", + + + "attr40": "OTAI_INTERFACE_STAT_OUT_DISCARDS", + + + "attr41": "OTAI_INTERFACE_STAT_OUT_MAC_CONTROL_FRAMES", + + + "attr42": "OTAI_INTERFACE_STAT_OUT_MAC_ERRORS_TX", + + + "attr43": "OTAI_INTERFACE_STAT_OUT_MAC_PAUSE_FRAMES", + + + "attr44": "OTAI_INTERFACE_STAT_OUT_UNICAST_PKTS" + + + }, + "OP": "SET" + } +] diff --git a/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/platform_asic b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/platform_asic new file mode 100644 index 000000000000..bb250a279547 --- /dev/null +++ b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/platform_asic @@ -0,0 +1 @@ +ot-vs diff --git a/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/plugins/eeprom.py b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/plugins/eeprom.py new file mode 100644 index 000000000000..163c31ba20fc --- /dev/null +++ b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/plugins/eeprom.py @@ -0,0 +1,40 @@ +############################################################################# +# SONiC Virtual switch platform +# +############################################################################# + +class board(): + + def __init__(self, name, path, cpld_root, ro): + return + + def check_status(self): + return "ok" + + def is_checksum_valid(self, e): + return (True, 0) + + def read_eeprom(self): + return \ + """ +TLV Name Code Len Value +-------------------- ---- --- ----- +Product Name 0x21 5 SONiC +Part Number 0x22 6 000000 +Serial Number 0x23 20 0000000000000000000 +Base MAC Address 0x24 6 00:00:00:00:00:01 +Manufacture Date 0x25 19 10/19/2019 00:00:03 +Device Version 0x26 1 1 +Label Revision 0x27 3 A01 +Platform Name 0x28 20 x86_64-kvm_x86_64-r0 +ONIE Version 0x29 19 master-201811170418 +MAC Addresses 0x2A 2 16 +Vendor Name 0x2D 5 SONiC +""" + + def decode_eeprom(self, e): + print(e) + + def serial_number_str(self, e): + """Return service tag instead of serial number""" + return "000000" diff --git a/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/pmon_daemon_control.json b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..101db0ffea1a --- /dev/null +++ b/device/virtual-ot/x86_64-ot_kvm_x86_64_4_asic-r0/pmon_daemon_control.json @@ -0,0 +1,8 @@ +{ + "skip_ledd": true, + "skip_xcvrd": true, + "skip_pcied": true, + "skip_psud": true, + "skip_syseepromd": true, + "skip_thermalctld": true +} diff --git a/dockers/docker-orchagent-ot/Dockerfile.j2 b/dockers/docker-orchagent-ot/Dockerfile.j2 new file mode 100755 index 000000000000..01acf74f4da6 --- /dev/null +++ b/dockers/docker-orchagent-ot/Dockerfile.j2 @@ -0,0 +1,71 @@ +{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} +FROM docker-config-engine-bullseye + +ARG docker_container_name + +# Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install -f -y \ + # Needed for installing netifaces Python package + build-essential \ + python3-dev + +{% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %} +# Fix for gcc/python/iputils-ping not found in arm docker +RUN apt-get install -y \ + gcc +{% endif %} + +{% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %} +# Remove installed gcc +RUN apt-get remove -y gcc +{% endif %} + +{% if docker_orchagent_ot_debs.strip() -%} +# Copy locally-built Debian package dependencies +{{ copy_files("debs/", docker_orchagent_ot_debs.split(' '), "/debs/") }} + +# Install locally-built Debian packages and implicitly install their dependencies +{{ install_debian_packages(docker_orchagent_ot_debs.split(' ')) }} +{%- endif %} + +{% if docker_orchagent_ot_whls.strip() -%} +# Copy locally-built Python wheel dependencies +{{ copy_files("python-wheels/", docker_orchagent_ot_whls.split(' '), "/python-wheels/") }} + +# Install locally-built Python wheel dependencies +{{ install_python_wheels(docker_orchagent_ot_whls.split(' ')) }} +{% endif %} + +# Clean up +RUN apt-get purge -y \ + build-essential \ + python3-dev && \ + apt-get clean -y && \ + apt-get autoclean -y && \ + apt-get autoremove -y && \ + rm -rf /debs ~/.cache + +COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] +COPY ["orchagent.sh", "/usr/bin/"] + +# Copy all Jinja2 template files into the templates folder +COPY ["*.j2", "/usr/share/sonic/templates/"] +COPY ["files/otss_vars.j2", "/usr/share/sonic/templates/"] + +# Copy all regex json files and rsyslog_plugin.conf to rsyslog.d +COPY ["*.json", "/etc/rsyslog.d/"] +COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] + +RUN sonic-cfggen -t /usr/share/sonic/templates/docker-init.j2 > /usr/bin/docker-init.sh +RUN rm -f /usr/share/sonic/templates/docker-init.j2 +RUN chmod 755 /usr/bin/docker-init.sh + +# Create swss rsyslog_plugin conf file +RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/swss_events.conf +RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2 +RUN rm -f /etc/rsyslog.d/events_info.json + +ENTRYPOINT ["/usr/bin/docker-init.sh"] diff --git a/dockers/docker-orchagent-ot/base_image_files/otssloglevel b/dockers/docker-orchagent-ot/base_image_files/otssloglevel new file mode 100755 index 000000000000..d92ae81cc576 --- /dev/null +++ b/dockers/docker-orchagent-ot/base_image_files/otssloglevel @@ -0,0 +1,44 @@ +#!/bin/bash + +# read SONiC immutable variables +[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment + +function help() +{ + echo -e "Usage: $0 -n [0 to $(($NUM_ASIC-1))] [OPTION]... " 1>&2; exit 1; +} + +DOCKER_EXEC_FLAGS="i" + +# Determine whether stdout is on a terminal +if [ -t 1 ] ; then + DOCKER_EXEC_FLAGS+="t" +fi + +DEV="" +PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} + +# Parse the device specific asic conf file, if it exists +ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf +[ -f $ASIC_CONF ] && . $ASIC_CONF + +if [[ ($NUM_ASIC -gt 1) ]]; then + while getopts ":n:h:" opt; do + case "${opt}" in + h) help + ;; + n) DEV=${OPTARG} + [ $DEV -lt $NUM_ASIC -a $DEV -ge 0 ] || help + ;; + esac + done + + if [ -z "${DEV}" ]; then + help + fi + + # Skip the arguments -n while passing to docker command + shift 2 +fi + +docker exec -$DOCKER_EXEC_FLAGS otss$DEV swssloglevel "$@" diff --git a/dockers/docker-orchagent-ot/buffermgrd.sh b/dockers/docker-orchagent-ot/buffermgrd.sh new file mode 100755 index 000000000000..b5ddaab7df0e --- /dev/null +++ b/dockers/docker-orchagent-ot/buffermgrd.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +BUFFER_CALCULATION_MODE=$(redis-cli -n 4 hget "DEVICE_METADATA|localhost" buffer_model) + +if [ "$BUFFER_CALCULATION_MODE" == "dynamic" ]; then + BUFFERMGRD_ARGS="-a /etc/sonic/asic_table.json" + if [ -f /etc/sonic/peripheral_table.json ]; then + BUFFERMGRD_PERIPHERIAL_ARGS=" -p /etc/sonic/peripheral_table.json" + fi + if [ -f /etc/sonic/zero_profiles.json ]; then + BUFFERMGRD_ZERO_PROFILE_ARGS=" -z /etc/sonic/zero_profiles.json" + fi +else + # Should we use the fallback MAC in case it is not found in Device.Metadata + BUFFERMGRD_ARGS="-l /usr/share/sonic/hwsku/pg_profile_lookup.ini" +fi + +exec /usr/bin/buffermgrd ${BUFFERMGRD_ARGS} ${BUFFERMGRD_PERIPHERIAL_ARGS} ${BUFFERMGRD_ZERO_PROFILE_ARGS} diff --git a/dockers/docker-orchagent-ot/critical_processes.j2 b/dockers/docker-orchagent-ot/critical_processes.j2 new file mode 100644 index 000000000000..bcfef7162f91 --- /dev/null +++ b/dockers/docker-orchagent-ot/critical_processes.j2 @@ -0,0 +1,3 @@ +program:orchagent +program:linecardmgrd +program:configsyncd diff --git a/dockers/docker-orchagent-ot/docker-init.j2 b/dockers/docker-orchagent-ot/docker-init.j2 new file mode 100755 index 000000000000..82c64c75c876 --- /dev/null +++ b/dockers/docker-orchagent-ot/docker-init.j2 @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +mkdir -p /etc/swss/config.d/ +mkdir -p /etc/supervisor/ +mkdir -p /etc/supervisor/conf.d/ + + +CFGGEN_PARAMS=" \ + -d \ + -y /etc/sonic/constants.yml \ + -t /usr/share/sonic/templates/critical_processes.j2,/etc/supervisor/critical_processes \ + -t /usr/share/sonic/templates/watchdog_processes.j2,/etc/supervisor/watchdog_processes \ + -t /usr/share/sonic/templates/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf +" + +sonic-cfggen $CFGGEN_PARAMS + +# Executed platform specific initialization tasks. +if [ -x /usr/share/sonic/platform/platform-init ]; then + /usr/share/sonic/platform/platform-init +fi + +# Executed HWSKU specific initialization tasks. +if [ -x /usr/share/sonic/hwsku/hwsku-init ]; then + /usr/share/sonic/hwsku/hwsku-init +fi + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + +exec /usr/local/bin/supervisord diff --git a/dockers/docker-orchagent-ot/events_info.json b/dockers/docker-orchagent-ot/events_info.json new file mode 100644 index 000000000000..cfcf680fa219 --- /dev/null +++ b/dockers/docker-orchagent-ot/events_info.json @@ -0,0 +1,9 @@ +{ + "yang_module": "sonic-events-swss", + "proclist": [ + { + "name": "swss", + "parse_json": "swss_regex.json" + } + ] +} diff --git a/dockers/docker-orchagent-ot/orchagent.sh b/dockers/docker-orchagent-ot/orchagent.sh new file mode 100755 index 000000000000..472bd4c86a69 --- /dev/null +++ b/dockers/docker-orchagent-ot/orchagent.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +OTSS_VARS_FILE=/usr/share/sonic/templates/otss_vars.j2 + +# Retrieve OTSS vars from sonic-cfggen +OTSS_VARS=$(sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t $OTSS_VARS_FILE) || exit 1 +export platform=$(echo $OTSS_VARS | jq -r '.asic_type') + +# Create a folder for OTSS record files +mkdir -p /var/log/otss +ORCHAGENT_ARGS="-d /var/log/otss " + +# Set orchagent pop batch size to 8192 +ORCHAGENT_ARGS+="-b 8192 " + +# Set synchronous mode if it is enabled in CONFIG_DB +SYNC_MODE=$(echo $OTSS_VARS | jq -r '.synchronous_mode') +if [ "$SYNC_MODE" == "enable" ]; then + ORCHAGENT_ARGS+="-s " +fi + +# Check if there is an "asic_id field" in the DEVICE_METADATA in configDB. +#"DEVICE_METADATA": { +# "localhost": { +# .... +# "asic_id": "0", +# } +#}, +# ID field could be integers just to denote the asic instance like 0,1,2... +# OR could be PCI device ID's which will be strings like "03:00.0" +# depending on what the SAI/SDK expects. +asic_id=$(echo $OTSS_VARS | jq -r '.asic_id') +if [ -n "$asic_id" ] +then + ORCHAGENT_ARGS+="-i $asic_id " +fi + +# for multi asic platforms add the asic name to the record file names +if [[ "$NAMESPACE_ID" ]]; then + ORCHAGENT_ARGS+="-f otss.asic$NAMESPACE_ID.rec -j otairedis.asic$NAMESPACE_ID.rec " +fi + +hwsku=`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['hwsku']"` +if [ -n "$hwsku" ] +then + ORCHAGENT_ARGS+="-c /etc/sonic/linecards/$hwsku/flexcounter.json " +fi + +exec /usr/bin/orchagent ${ORCHAGENT_ARGS} diff --git a/dockers/docker-orchagent-ot/supervisord.conf.j2 b/dockers/docker-orchagent-ot/supervisord.conf.j2 new file mode 100644 index 000000000000..1e78b517f870 --- /dev/null +++ b/dockers/docker-orchagent-ot/supervisord.conf.j2 @@ -0,0 +1,63 @@ +[supervisord] +logfile_maxbytes=1MB +logfile_backups=2 +nodaemon=true + +[eventlistener:dependent-startup] +command=python3 -m supervisord_dependent_startup +autostart=true +autorestart=unexpected +startretries=0 +exitcodes=0,3 +events=PROCESS_STATE +buffer_size=1024 + +[eventlistener:supervisor-proc-exit-listener] +command=/usr/bin/supervisor-proc-exit-listener --container-name swss +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING,PROCESS_COMMUNICATION_STDOUT +autostart=true +autorestart=unexpected +buffer_size=1024 + +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n -iNONE +priority=1 +autostart=false +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true + +[program:orchagent] +command=/usr/bin/orchagent.sh +priority=4 +autostart=false +autorestart=false +stdout_capture_maxbytes=1MB +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for={{ orchagent_dependent_startup_wait_for }} + +[program:linecardmgrd] +command=/usr/bin/linecardmgrd +priority=4 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=orchagent:running + +[program:configsyncd] +command=/usr/bin/configsyncd +priority=5 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=orchagent:running + + + diff --git a/dockers/docker-orchagent-ot/swss_regex.json b/dockers/docker-orchagent-ot/swss_regex.json new file mode 100644 index 000000000000..eb294c7d8d13 --- /dev/null +++ b/dockers/docker-orchagent-ot/swss_regex.json @@ -0,0 +1,7 @@ +[ + { + "tag": "select-operation-failure", + "regex": "SELECT operation result: ([a-zA-Z]*) on ([a-zA-Z]*)", + "params": [ "operation_result", "command" ] + } +] diff --git a/dockers/docker-orchagent-ot/watchdog_processes.j2 b/dockers/docker-orchagent-ot/watchdog_processes.j2 new file mode 100644 index 000000000000..bbe7c3a734b3 --- /dev/null +++ b/dockers/docker-orchagent-ot/watchdog_processes.j2 @@ -0,0 +1 @@ +program:orchagent \ No newline at end of file diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 9c02de602076..e85189e28277 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -21,6 +21,7 @@ {% endfor %} } }, +{%- if not sonic_asic_platform.startswith('ot-') %} "FLEX_COUNTER_TABLE": { "ACL": { "FLEX_COUNTER_STATUS": "enable", @@ -28,21 +29,35 @@ "POLL_INTERVAL": "10000" } }, +{% endif %} "BGP_DEVICE_GLOBAL": { "STATE": { "tsa_enabled": "false" } }, -{%- 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"), +{%- set features = [("database", "always_enabled", false, "always_enabled"), ("lldp", "enabled", true, "enabled"), ("pmon", "enabled", true, "enabled"), - ("snmp", "enabled", true, "enabled"), - ("swss", "enabled", false, "enabled"), - ("syncd", "enabled", false, "enabled")] %} + ("eventd", "enabled", false, "enabled")] %} +{%- if sonic_asic_platform.startswith('ot-') %} + {% do features.append(("otss", "enabled", false, "enabled")) %} + {% do features.append(("syncd-ot", "enabled", false, "enabled")) %} + {% do features.append(("swss", "disabled", false, "enabled")) %} + {% do features.append(("syncd", "disabled", false, "enabled")) %} + {% do features.append(("snmp", "disabled", true, "enabled")) %} + {% do features.append(("bgp", "enabled", false, "enabled")) %} + {% do features.append(("dhcp_relay", "disabled", false, "enabled")) %} +{%- else %} + {% do features.append(("otss", "disabled", false, "enabled")) %} + {% do features.append(("syncd-ot", "disabled", false, "enabled")) %} + {% do features.append(("swss", "enabled", false, "enabled")) %} + {% do features.append(("syncd", "enabled", false, "enabled")) %} + {% do features.append(("snmp", "enabled", true, "enabled")) %} + {% do features.append(("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")) %} + {% 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")) %} +{% endif %} {%- if include_router_advertiser == "y" %}{% do features.append(("radv", "enabled", false, "enabled")) %}{% endif %} {%- if include_teamd == "y" %}{% do features.append(("teamd", "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] %}disabled{% else %}enabled{% endif %}", false, "enabled")) %}{% endif %} -{% 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 include_dhcp_server == "y" %}{% do features.append(("dhcp_server", "disabled", false, "enabled")) %}{% endif %} {%- 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 %} @@ -70,11 +85,23 @@ "{{feature}}": { "state": "{{state}}", "delayed" : {{delayed | lower()}}, + {%- if feature in ["bgp"] and sonic_asic_platform.startswith('ot-') %} + "has_global_scope": true, + {%- else %} "has_global_scope": {% if feature + '.service' in installer_services.split(' ') %}true{% else %}false{% endif %}, + {%- endif %} {%- if feature in ["lldp"] %} + {%- if sonic_asic_platform.startswith('ot-') %} + "has_per_asic_scope": "False", + {%- else %} "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 %}, + {%- endif %} {%- else %} + {%- if feature in ["bgp"] and sonic_asic_platform.startswith('ot-') %} + "has_per_asic_scope": "False", + {%- else %} "has_per_asic_scope": {% if feature + '@.service' in installer_services.split(' ') %}"True"{% else %}"False"{% endif %}, + {%- endif %} {%- endif %} "auto_restart": "{{autorestart}}", "support_syslog_rate_limit" : "true", diff --git a/files/build_templates/otss_vars.j2 b/files/build_templates/otss_vars.j2 new file mode 100644 index 000000000000..01248ec3e263 --- /dev/null +++ b/files/build_templates/otss_vars.j2 @@ -0,0 +1,5 @@ +{ + "asic_type": "{{ asic_type }}", + "asic_id": "{{ DEVICE_METADATA.localhost.asic_id }}", + "synchronous_mode": {% if DEVICE_METADATA.localhost.synchronous_mode == "disable" %}"disable"{% else %}"enable"{% endif %}, +} diff --git a/files/build_templates/per_namespace/bgp.service.j2 b/files/build_templates/per_namespace/bgp.service.j2 index e9c1a923109b..ab5dee6c5be9 100644 --- a/files/build_templates/per_namespace/bgp.service.j2 +++ b/files/build_templates/per_namespace/bgp.service.j2 @@ -7,7 +7,11 @@ After=updategraph.service BindsTo=sonic.target After=sonic.target Before=ntp-config.service +{% if sonic_asic_platform.startswith('ot-') %} +After=otss{% if multi_instance == 'true' %}@%i{% endif %}.service +{%- else %} After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service +{% endif %} After=interfaces-config.service StartLimitIntervalSec=1200 StartLimitBurst=3 diff --git a/files/build_templates/per_namespace/otss.service.j2 b/files/build_templates/per_namespace/otss.service.j2 new file mode 100644 index 000000000000..b8a36f4ab0de --- /dev/null +++ b/files/build_templates/per_namespace/otss.service.j2 @@ -0,0 +1,22 @@ +[Unit] +Description=optical transport state service +Requires=database{% if multi_instance == 'true' %}@%i{% endif %}.service +After=database{% if multi_instance == 'true' %}@%i{% endif %}.service +Requires=updategraph.service +After=updategraph.service +BindsTo=sonic.target +After=sonic.target +Before=ntp-config.service +StartLimitIntervalSec=1200 +StartLimitBurst=3 + +[Service] +User=root +Environment=sonic_asic_platform={{ sonic_asic_platform }} +ExecStartPre=/usr/local/bin/otss.sh start{% if multi_instance == 'true' %} %i{% endif %} +ExecStart=/usr/local/bin/otss.sh wait{% if multi_instance == 'true' %} %i{% endif %} +ExecStop=/usr/local/bin/otss.sh stop{% if multi_instance == 'true' %} %i{% endif %} +RestartSec=30 + +[Install] +WantedBy=sonic.target diff --git a/files/build_templates/per_namespace/syncd-ot.service.j2 b/files/build_templates/per_namespace/syncd-ot.service.j2 new file mode 100644 index 000000000000..310145118399 --- /dev/null +++ b/files/build_templates/per_namespace/syncd-ot.service.j2 @@ -0,0 +1,25 @@ +[Unit] +Description=syncd-ot service +Requires=database{% if multi_instance == 'true' %}@%i{% endif %}.service +After=database{% if multi_instance == 'true' %}@%i{% endif %}.service +After=otss{% if multi_instance == 'true' %}@%i{% endif %}.service +Requires=updategraph.service +After=updategraph.service +After=interfaces-config.service +BindsTo=sonic.target +After=sonic.target +Before=ntp-config.service +StartLimitIntervalSec=1200 +StartLimitBurst=3 + +[Service] +User=root +Environment=sonic_asic_platform={{ sonic_asic_platform }} +ExecStartPre=/usr/local/bin/syncd-ot.sh start{% if multi_instance == 'true' %} %i{% endif %} +ExecStart=/usr/local/bin/syncd-ot.sh wait{% if multi_instance == 'true' %} %i{% endif %} +ExecStop=/usr/local/bin/syncd-ot.sh stop{% if multi_instance == 'true' %} %i{% endif %} +Restart=always +RestartSec=30 + +[Install] +WantedBy=sonic.target diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 167bdaaa4dc4..b35a911508fb 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -937,6 +937,8 @@ sudo LANG=C cp $SCRIPTS_DIR/gnmi.sh $FILESYSTEM_ROOT/usr/local/bin/gnmi.sh sudo LANG=C cp $SCRIPTS_DIR/mgmt-framework.sh $FILESYSTEM_ROOT/usr/local/bin/mgmt-framework.sh sudo LANG=C cp $SCRIPTS_DIR/asic_status.sh $FILESYSTEM_ROOT/usr/local/bin/asic_status.sh sudo LANG=C cp $SCRIPTS_DIR/asic_status.py $FILESYSTEM_ROOT/usr/local/bin/asic_status.py +sudo LANG=C cp $SCRIPTS_DIR/otss.sh $FILESYSTEM_ROOT/usr/local/bin/otss.sh +sudo LANG=C cp $SCRIPTS_DIR/syncd-ot.sh $FILESYSTEM_ROOT/usr/local/bin/syncd-ot.sh # Copy sonic-netns-exec script sudo LANG=C cp $SCRIPTS_DIR/sonic-netns-exec $FILESYSTEM_ROOT/usr/bin/sonic-netns-exec diff --git a/files/image_config/config-setup/config-setup b/files/image_config/config-setup/config-setup index 3369b0ec86e7..0f5db16380f8 100755 --- a/files/image_config/config-setup/config-setup +++ b/files/image_config/config-setup/config-setup @@ -298,6 +298,37 @@ do_config_initialization() sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" } +# Create OTN device SONiC configuration for first time bootup, it will generate global configration from init_cfg, +# and empty configruations for other asic namespaces +do_otn_config_initialization() +{ + echo "init otn configuration" + need_reload_config=false + + cfg_file_json_list='' + for cfg_file in $(get_config_db_file_list); do + cfg_file_json=${CONFIG_DB_PATH}${cfg_file} + if [ ! -e $cfg_file_json ]; then + need_reload_config=true + + if [ ${cfg_file_json} = ${CONFIG_DB_JSON} ]; then + generate_config factory ${CONFIG_DB_JSON} + else + # For otn device, usr can plugin any linecard, system will generate linecard configuration + # when user start to provisioning a linecard. Generate an empty configuration file by default. + echo "{}" > ${cfg_file_json} + fi + fi + cfg_file_json_list+=','$cfg_file_json + done + + if [ x"$need_reload_config" == x"true" ]; then + config reload -y -n $(cfg_file_json_list) + fi + + sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" +} + # Restore config-setup post migration hooks from a backup copy copy_post_migration_hooks() { @@ -429,6 +460,11 @@ boot_config() # file system to trigger. pending_config_initialization will remain set # for multi-npu platforms if we reach this case. if [[ ($NUM_ASIC -gt 1) ]]; then + # For otn platform, do config initialization here + if [[ $PALTFROM_ASIC = ot-* ]]; then + do_otn_config_initialization + fi + return 0 fi @@ -466,6 +502,7 @@ ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf if [[ -f "$ASIC_CONF" ]]; then source $ASIC_CONF fi +PALTFROM_ASIC=`cat /usr/share/sonic/device/$PLATFORM/platform_asic` CMD=$1 diff --git a/files/scripts/otss.sh b/files/scripts/otss.sh new file mode 100755 index 000000000000..657493f89811 --- /dev/null +++ b/files/scripts/otss.sh @@ -0,0 +1,115 @@ +#!/bin/bash + +function debug() +{ + /usr/bin/logger $1 + /bin/echo `date` "- $1" >> ${DEBUGLOG} +} + +function lock_service_state_change() +{ + debug "Locking ${LOCKFILE} from ${SERVICE}$DEV service" + + exec {LOCKFD}>${LOCKFILE} + /usr/bin/flock -x ${LOCKFD} + trap "/usr/bin/flock -u ${LOCKFD}" 0 2 3 15 + + debug "Locked ${LOCKFILE} (${LOCKFD}) from ${SERVICE}$DEV service" +} + +function unlock_service_state_change() +{ + debug "Unlocking ${LOCKFILE} (${LOCKFD}) from ${SERVICE}$DEV service" + /usr/bin/flock -u ${LOCKFD} +} + +function wait_for_database_service() +{ + # Wait for redis server start before database clean + until [[ $($SONIC_DB_CLI PING | grep -c PONG) -gt 0 ]]; do + sleep 1; + done + + # Wait for configDB initialization + until [[ $($SONIC_DB_CLI CONFIG_DB GET "CONFIG_DB_INITIALIZED") ]]; + do sleep 1; + done +} + +# This function cleans up the tables with specific prefixes from the database +# $1 the index of the database +# $2 the string of a list of table prefixes +function clean_up_tables() +{ + $SONIC_DB_CLI $1 EVAL " + local tables = {$2} + for i = 1, table.getn(tables) do + local matches = redis.call('KEYS', tables[i]) + for j,name in ipairs(matches) do + redis.call('DEL', name) + end + end" 0 +} + +start() { + debug "Starting ${SERVICE}$DEV service..." + + lock_service_state_change + + wait_for_database_service + + $SONIC_DB_CLI APPL_DB FLUSHDB + + # start service docker + /usr/bin/${SERVICE}.sh start $DEV + debug "Started ${SERVICE}$DEV service..." + + # Unlock has to happen before reaching out to peer service + unlock_service_state_change +} + +wait() { + if [[ ! -z $DEV ]]; then + /usr/bin/docker-wait-any -s ${SERVICE}$DEV + else + /usr/bin/docker-wait-any -s ${SERVICE} + fi +} + +stop() { + debug "Stopping ${SERVICE}$DEV service..." + + [[ -f ${LOCKFILE} ]] || /usr/bin/touch ${LOCKFILE} + + lock_service_state_change + + /usr/bin/${SERVICE}.sh stop $DEV + debug "Stopped ${SERVICE}$DEV service..." + + # Unlock has to happen before reaching out to peer service + unlock_service_state_change +} + +DEV=$2 + +SERVICE="otss" +DEBUGLOG="/tmp/otss-syncd-debug$DEV.log" +LOCKFILE="/tmp/otss-syncd-lock$DEV" +NAMESPACE_PREFIX="asic" +if [ "$DEV" ]; then + NET_NS="$NAMESPACE_PREFIX$DEV" + SONIC_DB_CLI="sonic-db-cli -n $NET_NS" +else + NET_NS="" + SONIC_DB_CLI="sonic-db-cli" +fi + +case "$1" in + start|wait|stop) + $1 + ;; + *) + echo "Usage: $0 {start|wait|stop}" + exit 1 + ;; +esac diff --git a/files/scripts/syncd-ot.sh b/files/scripts/syncd-ot.sh new file mode 100755 index 000000000000..0e643308da0b --- /dev/null +++ b/files/scripts/syncd-ot.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +. /usr/local/bin/syncd_common.sh + +function stopplatform1() +{ + debug "shutdown syncd-ot process ..." + /usr/bin/docker exec -i syncd-ot$DEV /usr/bin/syncd_request_shutdown --cold + + # wait until syncd-ot quits gracefully or force syncd-ot to exit after + # waiting for 20 seconds + start_in_secs=${SECONDS} + end_in_secs=${SECONDS} + timer_threshold=20 + while docker top syncd-ot$DEV | grep -q /usr/bin/syncd-ot \ + && [[ $((end_in_secs - start_in_secs)) -le $timer_threshold ]]; do + sleep 0.1 + end_in_secs=${SECONDS} + done + + if [[ $((end_in_secs - start_in_secs)) -gt $timer_threshold ]]; then + debug "syncd-ot process in container syncd-ot$DEV did not exit gracefully" + fi + + /usr/bin/docker exec -i syncd-ot$DEV /bin/sync + debug "Finished shutdown syncd-ot process ..." +} + +OP=$1 +DEV=$2 + +SERVICE="syncd-ot" +DEBUGLOG="/tmp/swss-syncd-ot-debug$DEV.log" +LOCKFILE="/tmp/swss-syncd-ot-lock$DEV" +NAMESPACE_PREFIX="asic" +if [ "$DEV" ]; then + NET_NS="$NAMESPACE_PREFIX$DEV" + SONIC_DB_CLI="sonic-db-cli -n $NET_NS" +else + NET_NS="" + SONIC_DB_CLI="sonic-db-cli" +fi + +case "$1" in + start|wait|stop) + $1 + ;; + *) + echo "Usage: $0 {start|wait|stop}" + exit 1 + ;; +esac diff --git a/platform/ot-vs/docker-syncd-ot-vs.dep b/platform/ot-vs/docker-syncd-ot-vs.dep new file mode 100644 index 000000000000..cf185ef93d86 --- /dev/null +++ b/platform/ot-vs/docker-syncd-ot-vs.dep @@ -0,0 +1,11 @@ +#DPKG FRK +DPATH := $($(DOCKER_SYNCD_BASE)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) ot-platform/ot-vs/docker-syncd-ot-vs.mk ot-platform/ot-vs/docker-syncd-ot-vs.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_SYNCD_BASE)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_SYNCD_BASE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_SYNCD_BASE)_DEP_FILES := $(DEP_FILES) + +$(eval $(call add_dbg_docker,$(DOCKER_SYNCD_BASE),$(DOCKER_SYNCD_BASE_DBG))) diff --git a/platform/ot-vs/docker-syncd-ot-vs.mk b/platform/ot-vs/docker-syncd-ot-vs.mk new file mode 100644 index 000000000000..7caf32394396 --- /dev/null +++ b/platform/ot-vs/docker-syncd-ot-vs.mk @@ -0,0 +1,18 @@ +# docker image for vs syncd + +DOCKER_SYNCD_PLATFORM_CODE = ot-vs +include $(PLATFORM_PATH)/../template/docker-syncd-base.mk + +$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD_OT_VS) + +$(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_OT_VS_DBG) \ + $(LIBSWSSCOMMON_DBG) \ + $(LIBOTAIMETADATA_DBG) \ + $(LIBOTAIREDIS_DBG) \ + $(LIBOTAIVS_DBG) + +$(DOCKER_SYNCD_BASE)_VERSION = 1.0.0 +$(DOCKER_SYNCD_BASE)_PACKAGE_NAME = syncd-ot +$(DOCKER_SYNCD_BASE)_CONTAINER_NAME = syncd-ot + +$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot diff --git a/platform/ot-vs/docker-syncd-ot-vs/Dockerfile.j2 b/platform/ot-vs/docker-syncd-ot-vs/Dockerfile.j2 new file mode 100644 index 000000000000..902787b747d8 --- /dev/null +++ b/platform/ot-vs/docker-syncd-ot-vs/Dockerfile.j2 @@ -0,0 +1,32 @@ +FROM docker-config-engine-buster + +ARG docker_container_name +RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update + +RUN apt-get install -f -y libcap2-bin + +COPY \ +{% for deb in docker_syncd_ot_vs_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor -%} +debs/ + +RUN dpkg -i \ +{% for deb in docker_syncd_ot_vs_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor %} + +COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] +COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] +COPY ["critical_processes", "/etc/supervisor/"] + +## Clean up +RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y +RUN rm -rf /debs + +ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/platform/ot-vs/docker-syncd-ot-vs/critical_processes b/platform/ot-vs/docker-syncd-ot-vs/critical_processes new file mode 100644 index 000000000000..bdd6903c5690 --- /dev/null +++ b/platform/ot-vs/docker-syncd-ot-vs/critical_processes @@ -0,0 +1 @@ +program:syncd diff --git a/platform/ot-vs/docker-syncd-ot-vs/supervisord.conf b/platform/ot-vs/docker-syncd-ot-vs/supervisord.conf new file mode 100644 index 000000000000..cb0fc1c27623 --- /dev/null +++ b/platform/ot-vs/docker-syncd-ot-vs/supervisord.conf @@ -0,0 +1,39 @@ +[supervisord] +logfile_maxbytes=1MB +logfile_backups=2 +nodaemon=true + +[eventlistener:dependent-startup] +command=python3 -m supervisord_dependent_startup +autostart=true +autorestart=unexpected +startretries=0 +exitcodes=0,3 +events=PROCESS_STATE +buffer_size=1024 + +[eventlistener:supervisor-proc-exit-listener] +command=/usr/bin/supervisor-proc-exit-listener --container-name syncd +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING +autostart=true +autorestart=unexpected +buffer_size=1024 + +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n -iNONE +priority=1 +autostart=false +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true + +[program:syncd] +command=/usr/bin/syncd_start.sh +priority=2 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited diff --git a/platform/ot-vs/kvm-image.dep b/platform/ot-vs/kvm-image.dep new file mode 100644 index 000000000000..05c083a51597 --- /dev/null +++ b/platform/ot-vs/kvm-image.dep @@ -0,0 +1,2 @@ +#DPKG FRK +$(SONIC_KVM_IMAGE)_CACHE_MODE := none diff --git a/platform/ot-vs/kvm-image.mk b/platform/ot-vs/kvm-image.mk new file mode 100644 index 000000000000..63dff39b245c --- /dev/null +++ b/platform/ot-vs/kvm-image.mk @@ -0,0 +1,14 @@ +# sonic kvm image + +SONIC_KVM_IMAGE = sonic-ot-vs.img.gz +$(SONIC_KVM_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR) +$(SONIC_KVM_IMAGE)_MACHINE = ot-vs +$(SONIC_KVM_IMAGE)_IMAGE_TYPE = kvm +ifeq ($(INSTALL_DEBUG_TOOLS),y) +$(SONIC_KVM_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES) +$(SONIC_KVM_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES)) +else +$(SONIC_KVM_IMAGE)_DOCKERS = $(SONIC_INSTALL_DOCKER_IMAGES) +endif +$(SONIC_KVM_IMAGE)_FILES = $(ONIE_RECOVERY_IMAGE) +SONIC_INSTALLERS += $(SONIC_KVM_IMAGE) diff --git a/platform/ot-vs/one-image.dep b/platform/ot-vs/one-image.dep new file mode 100644 index 000000000000..c5399d808172 --- /dev/null +++ b/platform/ot-vs/one-image.dep @@ -0,0 +1,2 @@ +#DPKG FRK +$(SONIC_ONE_IMAGE)_CACHE_MODE := none diff --git a/platform/ot-vs/one-image.mk b/platform/ot-vs/one-image.mk new file mode 100644 index 000000000000..82c3141bb516 --- /dev/null +++ b/platform/ot-vs/one-image.mk @@ -0,0 +1,13 @@ +# sonic vs one image installer + +SONIC_ONE_IMAGE = sonic-ot-vs.bin +$(SONIC_ONE_IMAGE)_MACHINE = vs +$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie +$(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR) +ifeq ($(INSTALL_DEBUG_TOOLS),y) +$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES) +$(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES)) +else +$(SONIC_ONE_IMAGE)_DOCKERS = $(SONIC_INSTALL_DOCKER_IMAGES) +endif +SONIC_INSTALLERS += $(SONIC_ONE_IMAGE) diff --git a/platform/ot-vs/onie.dep b/platform/ot-vs/onie.dep new file mode 100644 index 000000000000..36de83ce8ea3 --- /dev/null +++ b/platform/ot-vs/onie.dep @@ -0,0 +1,2 @@ +#DPKG FRK +$(ONIE_RECOVERY_IMAGE)_CACHE_MODE := none diff --git a/platform/ot-vs/onie.mk b/platform/ot-vs/onie.mk new file mode 100644 index 000000000000..7cace12654fb --- /dev/null +++ b/platform/ot-vs/onie.mk @@ -0,0 +1,10 @@ +ONIE_RECOVERY_IMAGE = onie-recovery-x86_64-ot_kvm_x86_64-r0.iso +$(ONIE_RECOVERY_IMAGE)_URL = "https://github.com/sonic-otn/ot_kvm_onie/releases/download/v1.0/onie-recovery-x86_64-ot_kvm_x86_64-r0.iso" + +ONIE_RECOVERY_KVM_4ASIC_IMAGE = onie-recovery-x86_64-ot_kvm_x86_64_4_asic-r0.iso +$(ONIE_RECOVERY_KVM_4ASIC_IMAGE)_URL = "https://github.com/sonic-otn/ot_kvm_onie/releases/download/v1.0/onie-recovery-x86_64-ot_kvm_x86_64_4_asic-r0.iso" + +ONIE_RECOVERY_KVM_6ASIC_IMAGE = onie-recovery-x86_64-ot_kvm_x86_64_6_asic-r0.iso +$(ONIE_RECOVERY_KVM_6ASIC_IMAGE)_URL = "https://github.com/sonic-otn/ot_kvm_onie/releases/download/v1.0/onie-recovery-x86_64-ot_kvm_x86_64_6_asic-r0.iso" + +SONIC_ONLINE_FILES += $(ONIE_RECOVERY_IMAGE) $(ONIE_RECOVERY_KVM_4ASIC_IMAGE) $(ONIE_RECOVERY_KVM_6ASIC_IMAGE) diff --git a/platform/ot-vs/platform.conf b/platform/ot-vs/platform.conf new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/ot-vs/rules.dep b/platform/ot-vs/rules.dep new file mode 100644 index 000000000000..6d54a02c8fa5 --- /dev/null +++ b/platform/ot-vs/rules.dep @@ -0,0 +1,6 @@ +include $(PLATFORM_PATH)/syncd-ot-vs.dep +include $(PLATFORM_PATH)/sonic-version.dep +include $(PLATFORM_PATH)/docker-syncd-ot-vs.dep +include $(PLATFORM_PATH)/one-image.dep +include $(PLATFORM_PATH)/onie.dep +include $(PLATFORM_PATH)/kvm-image.dep \ No newline at end of file diff --git a/platform/ot-vs/rules.mk b/platform/ot-vs/rules.mk new file mode 100644 index 000000000000..36553fc340f1 --- /dev/null +++ b/platform/ot-vs/rules.mk @@ -0,0 +1,8 @@ +include $(PLATFORM_PATH)/syncd-ot-vs.mk +include $(PLATFORM_PATH)/sonic-version.mk +include $(PLATFORM_PATH)/docker-syncd-ot-vs.mk +include $(PLATFORM_PATH)/one-image.mk +include $(PLATFORM_PATH)/onie.mk +include $(PLATFORM_PATH)/kvm-image.mk + +SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_KVM_IMAGE) diff --git a/platform/ot-vs/sonic-version.dep b/platform/ot-vs/sonic-version.dep new file mode 100644 index 000000000000..1398415bdad5 --- /dev/null +++ b/platform/ot-vs/sonic-version.dep @@ -0,0 +1,2 @@ +#DPKG FRK +$(SONIC_VERSION)_CACHE_MODE := none diff --git a/platform/ot-vs/sonic-version.mk b/platform/ot-vs/sonic-version.mk new file mode 100644 index 000000000000..82409abd1ec1 --- /dev/null +++ b/platform/ot-vs/sonic-version.mk @@ -0,0 +1,15 @@ +# sonic version yml file + +sonic_version=$(SONIC_GET_VERSION) +sonic_asic_platform=$(CONFIGURED_PLATFORM) +sonic_os_version=$(SONIC_OS_VERSION) + +export sonic_version +export sonic_asic_platform +export sonic_os_version + +SONIC_VERSION = sonic_version.yml +$(SONIC_VERSION)_SRC_PATH = $(PLATFORM_PATH)/sonic-version +SONIC_MAKE_FILES += $(SONIC_VERSION) + +SONIC_PHONY_TARGETS += $(addprefix $(FILES_PATH)/, $(SONIC_VERSION)) diff --git a/platform/ot-vs/syncd-ot-vs.dep b/platform/ot-vs/syncd-ot-vs.dep new file mode 100644 index 000000000000..211b4289c79f --- /dev/null +++ b/platform/ot-vs/syncd-ot-vs.dep @@ -0,0 +1,11 @@ +#DPKG FRK +DPATH := $($(SYNCD_OT_VS)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/ot-vs/syncd-ot-vs.mk platform/ot-vs/syncd-ot-vs.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(SYNCD_OT_VS)_CACHE_MODE := GIT_CONTENT_SHA +$(SYNCD_OT_VS)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SYNCD_OT_VS)_DEP_FILES := $(DEP_FILES) + +$(eval $(call add_dbg_docker,$(SYNCD_OT_VS),$(SYNCD_OT_VS_DBG))) diff --git a/platform/ot-vs/syncd-ot-vs.mk b/platform/ot-vs/syncd-ot-vs.mk new file mode 100644 index 000000000000..5d82a4f4e3f6 --- /dev/null +++ b/platform/ot-vs/syncd-ot-vs.mk @@ -0,0 +1,10 @@ +$(LIBOTAIREDIS)_DPKG_TARGET = binary-syncd-ot-vs + +SYNCD_OT_VS = syncd-ot-vs_1.0.0_$(CONFIGURED_ARCH).deb +$(SYNCD_OT_VS)_RDEPENDS += $(LIBOTAIREDIS) $(LIBOTAIMETADATA) $(LIBOTAIVS) +$(eval $(call add_derived_package,$(LIBOTAIREDIS),$(SYNCD_OT_VS))) + +SYNCD_OT_VS_DBG = syncd-ot-vs-dbg_1.0.0_$(CONFIGURED_ARCH).deb +$(SYNCD_OT_VS_DBG)_DEPENDS += $(SYNCD_OT_VS) +$(SYNCD_OT_VS_DBG)_RDEPENDS += $(SYNCD_OT_VS) +$(eval $(call add_derived_package,$(LIBOTAIREDIS),$(SYNCD_OT_VS_DBG))) diff --git a/rules/docker-orchagent-ot.dep b/rules/docker-orchagent-ot.dep new file mode 100644 index 000000000000..14b943ace8a9 --- /dev/null +++ b/rules/docker-orchagent-ot.dep @@ -0,0 +1,11 @@ + +DPATH := $($(DOCKER_ORCHAGENT)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-orchagent-ot.mk rules/docker-orchagent-ot.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_ORCHAGENT)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_ORCHAGENT)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(ENABLE_ASAN) +$(DOCKER_ORCHAGENT)_DEP_FILES := $(DEP_FILES) + +$(eval $(call add_dbg_docker,$(DOCKER_ORCHAGENT),$(DOCKER_ORCHAGENT_DBG))) diff --git a/rules/docker-orchagent-ot.mk b/rules/docker-orchagent-ot.mk new file mode 100644 index 000000000000..f0a2e9fee785 --- /dev/null +++ b/rules/docker-orchagent-ot.mk @@ -0,0 +1,40 @@ +# docker image for orchagent-ot + +DOCKER_ORCHAGENT_OT_STEM = docker-orchagent-ot +DOCKER_ORCHAGENT_OT = $(DOCKER_ORCHAGENT_OT_STEM).gz +DOCKER_ORCHAGENT_OT_DBG = $(DOCKER_ORCHAGENT_OT_STEM)-$(DBG_IMAGE_MARK).gz + +$(DOCKER_ORCHAGENT_OT)_DEPENDS += $(OTSS) $(SONIC_RSYSLOG_PLUGIN) + +$(DOCKER_ORCHAGENT_OT)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS) +$(DOCKER_ORCHAGENT_OT)_DBG_DEPENDS += $(OTSS_DBG) \ + $(LIBSWSSCOMMON_DBG) \ + $(LIBOTAIREDIS_DBG) \ + $(SONIC_RSYSLOG_PLUGIN) + +$(DOCKER_ORCHAGENT_OT)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES) + +$(DOCKER_ORCHAGENT_OT)_PATH = $(DOCKERS_PATH)/$(DOCKER_ORCHAGENT_OT_STEM) + +$(DOCKER_ORCHAGENT_OT)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE) + +$(DOCKER_ORCHAGENT_OT)_VERSION = 1.0.0 +$(DOCKER_ORCHAGENT_OT)_PACKAGE_NAME = otss + +SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_OT) +SONIC_BULLSEYE_DOCKERS += $(DOCKER_ORCHAGENT_OT) +SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_OT) + +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_OT_DBG) +SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_ORCHAGENT_OT_DBG) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_OT_DBG) + +$(DOCKER_ORCHAGENT_OT)_CONTAINER_NAME = otss +$(DOCKER_ORCHAGENT_OT)_RUN_OPT += --privileged -t +$(DOCKER_ORCHAGENT_OT)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro +$(DOCKER_ORCHAGENT_OT)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro +$(DOCKER_ORCHAGENT_OT)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_ORCHAGENT_OT)_RUN_OPT += -v /var/log/otss:/var/log/otss:rw + +$(DOCKER_ORCHAGENT_OT)_BASE_IMAGE_FILES += otssloglevel:/usr/bin/otssloglevel +$(DOCKER_ORCHAGENT_OT)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) $(OTSS_VARS_TEMPLATE) diff --git a/rules/otairedis.dep b/rules/otairedis.dep new file mode 100644 index 000000000000..dd53b06312ce --- /dev/null +++ b/rules/otairedis.dep @@ -0,0 +1,17 @@ + +#DPKG FRK +SPATH := $($(LIBOTAIREDIS)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/otairedis.mk rules/otairedis.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) + +SMDEP_PATHS := $(SPATH) $(SPATH)/OTAI +$(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, \ + $(shell cd $(path) && git ls-files | grep -v " "))))) + + +$(LIBOTAIREDIS)_CACHE_MODE := GIT_CONTENT_SHA +$(LIBOTAIREDIS)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(LIBOTAIREDIS)_DEP_FILES := $(DEP_FILES) +$(LIBOTAIREDIS)_SMDEP_FILES := $(foreach path, $(SMDEP_PATHS), $($(path))) +$(LIBOTAIREDIS)_SMDEP_PATHS := $(SMDEP_PATHS) + diff --git a/rules/otairedis.mk b/rules/otairedis.mk new file mode 100644 index 000000000000..97a5494d5baa --- /dev/null +++ b/rules/otairedis.mk @@ -0,0 +1,50 @@ +# otairedis package + +LIBOTAIREDIS_VERSION = 1.0.0 +LIBOTAIREDIS_NAME = libotairedis + +LIBOTAIREDIS = $(LIBOTAIREDIS_NAME)_$(LIBOTAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(LIBOTAIREDIS)_DPKG_TARGET = binary-otairedis +$(LIBOTAIREDIS)_SRC_PATH = $(SRC_PATH)/sonic-otairedis +$(LIBOTAIREDIS)_NAME = $(LIBOTAIREDIS_NAME) +$(LIBOTAIREDIS)_DEPENDS += $(LIBSWSSCOMMON_DEV) +$(LIBOTAIREDIS)_RDEPENDS += $(LIBSWSSCOMMON) +$(LIBOTAIREDIS)_DEB_BUILD_OPTIONS = nocheck +SONIC_DPKG_DEBS += $(LIBOTAIREDIS) + +LIBOTAIREDIS_DEV = $(LIBOTAIREDIS_NAME)-dev_$(LIBOTAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBOTAIREDIS),$(LIBOTAIREDIS_DEV))) + +LIBOTAIVS = libotaivs_$(LIBOTAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBOTAIREDIS),$(LIBOTAIVS))) + +LIBOTAIVS_DEV = libotaivs-dev_$(LIBOTAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBOTAIREDIS),$(LIBOTAIVS_DEV))) +$(LIBOTAIVS_DEV)_DEPENDS += $(LIBOTAIVS) + +LIBOTAIMETADATA = libotaimetadata_$(LIBOTAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBOTAIREDIS),$(LIBOTAIMETADATA))) + +LIBOTAIMETADATA_DEV = libotaimetadata-dev_$(LIBOTAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(LIBOTAIMETADATA_DEV)_DEPENDS += $(LIBOTAIMETADATA) +$(eval $(call add_derived_package,$(LIBOTAIREDIS),$(LIBOTAIMETADATA_DEV))) + +LIBOTAIREDIS_DBG = $(LIBOTAIREDIS_NAME)-dbg_$(LIBOTAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(LIBOTAIREDIS_DBG)_DEPENDS += $(LIBOTAIREDIS) +$(LIBOTAIREDIS_DBG)_RDEPENDS += $(LIBOTAIREDIS) +$(eval $(call add_derived_package,$(LIBOTAIREDIS),$(LIBOTAIREDIS_DBG))) + +LIBOTAIVS_DBG = libotaivs-dbg_$(LIBOTAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(LIBOTAIVS_DBG)_DEPENDS += $(LIBOTAIVS) +$(LIBOTAIVS_DBG)_RDEPENDS += $(LIBOTAIVS) +$(eval $(call add_derived_package,$(LIBOTAIREDIS),$(LIBOTAIVS_DBG))) + +LIBOTAIMETADATA_DBG = libotaimetadata-dbg_$(LIBOTAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(LIBOTAIMETADATA_DBG)_DEPENDS += $(LIBOTAIMETADATA) +$(LIBOTAIMETADATA_DBG)_RDEPENDS += $(LIBOTAIMETADATA) +$(eval $(call add_derived_package,$(LIBOTAIREDIS),$(LIBOTAIMETADATA_DBG))) + +# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list} +# are archived into debug one image to facilitate debugging. +# +DBG_SRC_ARCHIVE += sonic-otairedis diff --git a/rules/otss.dep b/rules/otss.dep new file mode 100644 index 000000000000..fe70b23f9c20 --- /dev/null +++ b/rules/otss.dep @@ -0,0 +1,12 @@ + +SPATH := $($(OTSS)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/otss.mk rules/otss.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) + +$(OTSS)_CACHE_MODE := GIT_CONTENT_SHA +$(OTSS)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(ENABLE_ASAN) +$(OTSS)_DEP_FILES := $(DEP_FILES) +$(OTSS)_SMDEP_FILES := $(SMDEP_FILES) +$(OTSS)_SMDEP_PATHS := $(SPATH) + diff --git a/rules/otss.mk b/rules/otss.mk new file mode 100644 index 000000000000..f0a1df135c14 --- /dev/null +++ b/rules/otss.mk @@ -0,0 +1,22 @@ +# otss package + +OTSS = otss_1.0.0_$(CONFIGURED_ARCH).deb +$(OTSS)_SRC_PATH = $(SRC_PATH)/sonic-otss +$(OTSS)_DEPENDS += $(LIBOTAIREDIS_DEV) $(LIBOTAIMETADATA_DEV) \ + $(LIBSWSSCOMMON_DEV) $(LIBOTAIVS) $(LIBOTAIVS_DEV) +$(OTSS)_UNINSTALLS = $(LIBOTAIVS_DEV) + +$(OTSS)_RDEPENDS += $(LIBOTAIREDIS) $(LIBOTAIMETADATA) \ + $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) +SONIC_DPKG_DEBS += $(OTSS) + +OTSS_DBG = otss-dbg_1.0.0_$(CONFIGURED_ARCH).deb +$(OTSS_DBG)_DEPENDS += $(OTSS) +$(OTSS_DBG)_RDEPENDS += $(OTSS) +$(eval $(call add_derived_package,$(OTSS),$(OTSS_DBG))) + +# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list} +# are archived into debug one image to facilitate debugging. +# +DBG_SRC_ARCHIVE += sonic-otss + diff --git a/rules/scripts.mk b/rules/scripts.mk index 12919d520b09..0f363cb2cad8 100644 --- a/rules/scripts.mk +++ b/rules/scripts.mk @@ -29,6 +29,9 @@ $(UPDATE_CHASSISDB_CONFIG_SCRIPT)_PATH = files/scripts SWSS_VARS_TEMPLATE = swss_vars.j2 $(SWSS_VARS_TEMPLATE)_PATH = files/build_templates +OTSS_VARS_TEMPLATE = otss_vars.j2 +$(OTSS_VARS_TEMPLATE)_PATH = files/build_templates + COPP_CONFIG_TEMPLATE = copp_cfg.j2 $(COPP_CONFIG_TEMPLATE)_PATH = files/image_config/copp @@ -45,5 +48,6 @@ SONIC_COPY_FILES += $(CONFIGDB_LOAD_SCRIPT) \ $(SYSCTL_NET_CONFIG) \ $(UPDATE_CHASSISDB_CONFIG_SCRIPT) \ $(SWSS_VARS_TEMPLATE) \ + $(OTSS_VARS_TEMPLATE) \ $(RSYSLOG_PLUGIN_CONF_J2) \ $(COPP_CONFIG_TEMPLATE) diff --git a/slave.mk b/slave.mk index 32e88c2b67d6..aadf0898d68f 100644 --- a/slave.mk +++ b/slave.mk @@ -314,7 +314,7 @@ endif MAKEFLAGS += -j $(SONIC_BUILD_JOBS) export SONIC_CONFIG_MAKE_JOBS -ifeq ($(CONFIGURED_PLATFORM),vs) +ifeq ($(CONFIGURED_PLATFORM),$(filter $(CONFIGURED_PLATFORM),vs ot-vs)) export BUILD_MULTIASIC_KVM endif @@ -453,7 +453,7 @@ $(info "MULTIARCH_QEMU_ENVIRON" : "$(MULTIARCH_QEMU_ENVIRON)") $(info "SONIC_VERSION_CONTROL_COMPONENTS": "$(SONIC_VERSION_CONTROL_COMPONENTS)") $(info "ENABLE_ASAN" : "$(ENABLE_ASAN)") $(info "DEFAULT_CONTAINER_REGISTRY" : "$(SONIC_DEFAULT_CONTAINER_REGISTRY)") -ifeq ($(CONFIGURED_PLATFORM),vs) +ifeq ($(CONFIGURED_PLATFORM),$(filter $(CONFIGURED_PLATFORM),vs ot-vs)) $(info "BUILD_MULTIASIC_KVM" : "$(BUILD_MULTIASIC_KVM)") endif $(info "CROSS_BUILD_ENVIRON" : "$(CROSS_BUILD_ENVIRON)") diff --git a/src/sonic-otairedis b/src/sonic-otairedis new file mode 160000 index 000000000000..7e0375e7b42f --- /dev/null +++ b/src/sonic-otairedis @@ -0,0 +1 @@ +Subproject commit 7e0375e7b42f57b839f6a8d9866d1262e848fac6 diff --git a/src/sonic-otss b/src/sonic-otss new file mode 160000 index 000000000000..44ab93671e0f --- /dev/null +++ b/src/sonic-otss @@ -0,0 +1 @@ +Subproject commit 44ab93671e0f02c12045d038291cf1e56d6c62df diff --git a/src/sonic-swss-common b/src/sonic-swss-common deleted file mode 160000 index 93300864273d..000000000000 --- a/src/sonic-swss-common +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 93300864273d571886eb1eb4c60b13245c68442f