Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsapronov committed Nov 23, 2021
2 parents 3946fd6 + 240596e commit 4865468
Show file tree
Hide file tree
Showing 29 changed files with 418 additions and 52 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ stages:
- job:
pool: sonictest
displayName: "kvmtest-t0"
timeoutInMinutes: 300
timeoutInMinutes: 360

steps:
- template: .azure-pipelines/run-test-template.yml
Expand Down
1 change: 0 additions & 1 deletion files/build_templates/gbsyncd-cisco.service.j2

This file was deleted.

1 change: 0 additions & 1 deletion files/build_templates/gbsyncd-credo.service.j2

This file was deleted.

8 changes: 4 additions & 4 deletions files/scripts/gbsyncd-platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
DEVPATH="/usr/share/sonic/device"
CONFIGFILE="${DEVPATH}/${PLATFORM}/gbsyncd.ini"

# Skip checking the service for vs
[ "$sonic_asic_platform" = vs ] && exit 0

if [ ! -f "$CONFIGFILE" ]; then
if [ gbsyncd = "$SERVICE" ]; then
exit 0
fi
exit 1
fi

while IFS="=" read -r key value; do
case "$key" in
platform)
if [ "$value" = "$SERVICE" ]; then
if [[ "$value" = "$SERVICE"* ]]; then
exit 0
fi
;;
Expand Down
2 changes: 1 addition & 1 deletion platform/centec-arm64/sai.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Centec SAI

export CENTEC_SAI_VERSION = 1.7.1-1
export CENTEC_SAI_VERSION = 1.9.1-0
export CENTEC_SAI = libsai_$(CENTEC_SAI_VERSION)_$(PLATFORM_ARCH).deb

$(CENTEC_SAI)_URL = https://github.com/CentecNetworks/sonic-binaries/raw/master/$(PLATFORM_ARCH)/sai/$(CENTEC_SAI)
Expand Down
1 change: 0 additions & 1 deletion platform/components/docker-gbsyncd-credo.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ifneq ($($(LIBSAI_CREDO)_URL),)
include $(PLATFORM_PATH)/../template/docker-gbsyncd-base.mk
$(DOCKER_GBSYNCD_BASE)_VERSION = 1.0.0
$(DOCKER_GBSYNCD_BASE)_PACKAGE_NAME = gbsyncd
$(DOCKER_GBSYNCD_BASE)_CONTAINER_NAME = gbsyncd-$(DOCKER_GBSYNCD_PLATFORM_CODE)
$(DOCKER_GBSYNCD_BASE)_PATH = $(PLATFORM_PATH)/../components/docker-gbsyncd-$(DOCKER_GBSYNCD_PLATFORM_CODE)
SONIC_ONLINE_DEBS += $(LIBSAI_CREDO) $(LIBSAI_CREDO_OWL)
$(DOCKER_GBSYNCD_BASE)_DEPENDS += $(SYNCD) $(LIBSAI_CREDO) $(LIBSAI_CREDO_OWL)
Expand Down
70 changes: 64 additions & 6 deletions platform/mellanox/mlnx-platform-api/sonic_platform/psu.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,24 +192,28 @@ def get_temperature_high_threshold(self):
class Psu(FixedPsu):
"""Platform-specific Psu class"""
PSU_CURRENT = "power/psu{}_curr"
PSU_VOLTAGE = "power/psu{}_volt"
PSU_VOLTAGE1 = "power/psu{}_volt_out2"
PSU_POWER = "power/psu{}_power"
PSU_VPD = "eeprom/psu{}_vpd"

shared_led = None

def __init__(self, psu_index):
super(Psu, self).__init__(psu_index)

psu_voltage = os.path.join(PSU_PATH, self.PSU_VOLTAGE1.format(self.index))
psu_voltage_out2 = os.path.join(PSU_PATH, "power/psu{}_volt_out2".format(self.index))
psu_voltage = os.path.join(PSU_PATH, "power/psu{}_volt".format(self.index))
# Workaround for psu voltage sysfs file as the file name differs among platforms
if os.path.exists(psu_voltage):
self.psu_voltage = os.path.join(PSU_PATH, self.PSU_VOLTAGE1.format(self.index))
if os.path.exists(psu_voltage_out2):
self.psu_voltage = psu_voltage_out2
else:
self.psu_voltage = os.path.join(PSU_PATH, self.PSU_VOLTAGE.format(self.index))
self.psu_voltage = psu_voltage
self.psu_voltage_min = self.psu_voltage + "_min"
self.psu_voltage_max = self.psu_voltage + "_max"
self.psu_voltage_capability = self.psu_voltage + "_capability"

self.psu_current = os.path.join(PSU_PATH, self.PSU_CURRENT.format(self.index))
self.psu_power = os.path.join(PSU_PATH, self.PSU_POWER.format(self.index))
self.psu_power_max = self.psu_power + "_max"
self.psu_presence = os.path.join(PSU_PATH, "thermal/psu{}_status".format(self.index))

self.psu_temp = os.path.join(PSU_PATH, 'thermal/psu{}_temp'.format(self.index))
Expand Down Expand Up @@ -355,3 +359,57 @@ def get_temperature_high_threshold(self):
return float(temp_threshold) / 1000

return None

def get_voltage_high_threshold(self):
"""
Retrieves the high threshold PSU voltage output
Returns:
A float number, the high threshold output voltage in volts,
e.g. 12.1
Notes:
The thresholds of voltage are not supported on all platforms.
So we have to check capability first.
"""
if self.psu_voltage_capability and self.psu_voltage_max and self.get_powergood_status():
capability = utils.read_str_from_file(self.psu_voltage_capability)
if 'max' in capability:
max_voltage = utils.read_int_from_file(self.psu_voltage_max, log_func=logger.log_info)
return float(max_voltage) / 1000

return None

def get_voltage_low_threshold(self):
"""
Retrieves the low threshold PSU voltage output
Returns:
A float number, the low threshold output voltage in volts,
e.g. 12.1
Notes:
The thresholds of voltage are not supported on all platforms.
So we have to check capability first.
"""
if self.psu_voltage_capability and self.psu_voltage_min and self.get_powergood_status():
capability = utils.read_str_from_file(self.psu_voltage_capability)
if 'min' in capability:
min_voltage = utils.read_int_from_file(self.psu_voltage_min, log_func=logger.log_info)
return float(min_voltage) / 1000

return None

def get_maximum_supplied_power(self):
"""
Retrieves the maximum supplied power by PSU
Returns:
A float number, the maximum power output in Watts.
e.g. 1200.1
"""
if self.psu_power_max and self.get_powergood_status():
power_max = utils.read_int_from_file(self.psu_power_max, log_func=logger.log_info)
return float(power_max) / 1000000
else:
return None
1 change: 0 additions & 1 deletion rules/functions
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ define generate_manifest
$(eval export config_cli_plugin=$($(1).gz_CLI_CONFIG_PLUGIN))
$(eval export show_cli_plugin=$($(1).gz_CLI_SHOW_PLUGIN))
$(eval export clear_cli_plugin=$($(1).gz_CLI_CLEAR_PLUGIN))
j2 $($*.gz_PATH)/Dockerfile$(2).j2 > $($(1).gz_PATH)/Dockerfile$(2)
j2 --customize scripts/j2cli/json_filter.py files/build_templates/manifest.json.j2 > $($(1).gz_PATH)/manifest.common.json
if [ -f $($*.gz_PATH)/manifest.part.json.j2 ]; then
j2 --customize scripts/j2cli/json_filter.py $($(1).gz_PATH)/manifest.part.json.j2 > $($(1).gz_PATH)/manifest.part.json
Expand Down
4 changes: 2 additions & 2 deletions src/sonic-build-hooks/scripts/buildinfo_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ download_packages()
local filename=$(echo $url | awk -F"/" '{print $NF}' | cut -d? -f1 | cut -d# -f1)
[ -f $WEB_VERSION_FILE ] && version=$(grep "^${url}=" $WEB_VERSION_FILE | awk -F"==" '{print $NF}')
if [ -z "$version" ]; then
echo "Failed to verify the package: $url, the version is not specified" 2>&1
exit 1
echo "Warning: Failed to verify the package: $url, the version is not specified" 1>&2
continue
fi

local version_filename="${filename}-${version}"
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-platform-common
2 changes: 1 addition & 1 deletion src/sonic-swss-common
2 changes: 1 addition & 1 deletion src/sonic-utilities
20 changes: 20 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/acl.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,25 @@
"key": "sonic-acl:services",
"value": ["SNMP"]
}
},
"ACL_TABLE_CUSTOM_TABLE_TYPE": {
"desc": "ACL_TABLE LOAD TABLE TYPE SUCCESSFULLY."
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_MATCHES": {
"desc": "ACL_TABLE LOAD TABLE TYPE WITH NO MATCHES.",
"eStrKey": "MinElements"
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_BIND_POINT_TYPES": {
"desc": "ACL_TABLE LOAD TABLE TYPE WITH NO BIND POINT TYPES.",
"eStrKey": "MinElements"
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_ACTIONS": {
"desc": "ACL_TABLE LOAD TABLE TYPE SUCCESSFULLY WITH NO ACTIONS.",
"eStrKey" : "Verify",
"verify": {
"xpath": "/sonic-acl:sonic-acl/ACL_TABLE_TYPE/ACL_TABLE_TYPE_LIST[ACL_TABLE_TYPE_NAME='CUSTOM_L3']/ACL_TABLE_TYPE_NAME",
"key": "sonic-acl:actions",
"value": [""]
}
}
}
186 changes: 186 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json
Original file line number Diff line number Diff line change
Expand Up @@ -471,5 +471,191 @@
]
}
}
},
"ACL_TABLE_CUSTOM_TABLE_TYPE": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V6",
"policy_desc": "Filter IPv6",
"ports": [
"Ethernet0"
],
"stage": "EGRESS",
"type": "CUSTOM_L3"
}
]
},
"sonic-acl:ACL_TABLE_TYPE": {
"ACL_TABLE_TYPE_LIST": [
{
"ACL_TABLE_TYPE_NAME": "CUSTOM_L3",
"matches": [
"SRC_IP",
"IN_PORTS"
],
"actions": [
"PACKET_ACTION"
],
"bind_points": [
"PORT"
]
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "0,1,2,3",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
}
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_MATCHES": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V6",
"policy_desc": "Filter IPv6",
"ports": [
"Ethernet0"
],
"stage": "EGRESS",
"type": "CUSTOM_L3"
}
]
},
"sonic-acl:ACL_TABLE_TYPE": {
"ACL_TABLE_TYPE_LIST": [
{
"ACL_TABLE_TYPE_NAME": "CUSTOM_L3",
"actions": [
"PACKET_ACTION"
],
"bind_points": [
"PORT"
]
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "0,1,2,3",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
}
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_BIND_POINT_TYPES": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V6",
"policy_desc": "Filter IPv6",
"ports": [
"Ethernet0"
],
"stage": "EGRESS",
"type": "CUSTOM_L3"
}
]
},
"sonic-acl:ACL_TABLE_TYPE": {
"ACL_TABLE_TYPE_LIST": [
{
"ACL_TABLE_TYPE_NAME": "CUSTOM_L3",
"matches": [
"SRC_IP",
"IN_PORTS"
],
"actions": [
"PACKET_ACTION"
]
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "0,1,2,3",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
}
},
"ACL_TABLE_CUSTOM_TABLE_TYPE_NO_ACTIONS": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V6",
"policy_desc": "Filter IPv6",
"ports": [
"Ethernet0"
],
"stage": "EGRESS",
"type": "CUSTOM_L3"
}
]
},
"sonic-acl:ACL_TABLE_TYPE": {
"ACL_TABLE_TYPE_LIST": [
{
"ACL_TABLE_TYPE_NAME": "CUSTOM_L3",
"matches": [
"SRC_IP",
"IN_PORTS"
],
"bind_points": [
"PORT"
]
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "0,1,2,3",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
}
}
}
Loading

0 comments on commit 4865468

Please sign in to comment.