Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

sync from Azure to Project-arlo #4

Merged
merged 37 commits into from
Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
95452b7
[docker-pmon] install dmidecode tool to pmon (#2990)
stephenxs Jun 12, 2019
ab5afad
[FRR]: enable bgp graceful-restart preserve-fw-state for FRR warm reb…
jipanyang Jun 13, 2019
f5f7fb3
[gitignore] Ignore .DS_Store files (#2997)
jleveque Jun 13, 2019
383fc0f
[FRR] fix pfx_filter to fix bgpd.conf.j2 rendering when no vlan inter…
stepanblyschak Jun 14, 2019
8f6ae90
[docker]: get hostname from config db instead of minigraph (#3004)
lguohan Jun 14, 2019
f8a4efc
[swss]: Update swss submodules change (#2995)
Jun 14, 2019
a5aa3bb
[Broadcom]: Update SAI version to 3.5.2.3 (#3014)
Jun 14, 2019
466334a
[libteam]: Reimplement Warm-Reboot procedure (#3016)
pavel-shirshov Jun 15, 2019
c927517
[Mellanox] Inject SDK libs dependency to pmon on Mellanox platform (#…
keboliu Jun 15, 2019
d67c6d4
Set the default mac ageing time to 600 seconds (#2365)
zhenggen-xu Jun 15, 2019
e7b1988
[submodule] update sonic-linux-kernel (#2985)
qiluo-msft Jun 18, 2019
8a08595
[Pmon] Add new daemon "syseepromd" to pmon docker (#2866)
keboliu Jun 18, 2019
4bfc9ef
[sonic-slave]: install openjdk-8 for jenkins slave (#3037)
lguohan Jun 19, 2019
319d854
[baseimage]: Increase TMOUT for serial port connections to 15 minutes…
jleveque Jun 19, 2019
2e121f3
[submodule]: Update submodule sonic-quagga (#3030)
neethajohn Jun 19, 2019
c67c29f
[build]: Add missing 'rm -rf' to component Makefiles for clean rebuil…
gpaussabrcm Jun 19, 2019
1854453
[FRR] Enable SNMP support (#2981)
MichelMoriniaux Jun 19, 2019
6370d64
[broadcom]: Check for broadcom platform sdk init ready during syncd s…
ramachandrareddygaddam Jun 19, 2019
69b8ad7
[submodule] update sonic-linux-kernel to 4.9.168-1+deb9u3 (#3034)
qiluo-msft Jun 19, 2019
1bcd54d
[build]: Upgrade docker to 18.09 in stretch slave (#3049)
stepanblyschak Jun 20, 2019
e680892
[build] Improve overlay check in Makefile (#3050)
Staphylo Jun 20, 2019
f4d07dc
fixed BFN target build (#3061)
msosyak Jun 21, 2019
817c637
[frr.conf] Advertise /64 prefix for ipv6 lo addresses in case 'unifie…
Jun 22, 2019
81cf332
[build]: Improve dockerfile instructions (#3048)
stepanblyschak Jun 22, 2019
40330bc
[build]: wait up to 60 seconds for docker engine to start (#3067)
lguohan Jun 22, 2019
9cf34ec
Revert "[Dell] [Z9100] Supporting PreEmphasis Settings for Optics (#2…
sridhar-ravindran Jun 22, 2019
4f35cce
[bfn] added TNA config for all devices (#3029)
akokhan Jun 22, 2019
622c426
[devices]: DellEMC Z9264f remove 115200 baud-ratesupport (#3046)
Jun 23, 2019
34e790b
[swss] update swss pointer (#3055)
stepanblyschak Jun 23, 2019
93582c7
[devices]: Add lpmode in sfputil.py for Accton AS7726-32X (#3040)
brandonchuang Jun 23, 2019
dd0f005
[FRR]: Port some patches from sonic-quagga repo (#3017)
pavel-shirshov Jun 23, 2019
2e40fa5
[devices]: Poller to detect Intel Rangely LPC failure for dell z9100/…
Jun 24, 2019
3f54b58
[nephos]: update to support linux-kernel-4.9.0-9-2 (#3058)
simonJi2018 Jun 24, 2019
9a1bebe
[telemetry]: change the service dependency from swss to database (#3072)
jipanyang Jun 24, 2019
331866d
[sonic-cfggen] Add Mellanox platform specific code to read base mac f…
keboliu Jun 25, 2019
94b3c36
[device/celestica] Implement PSU APIs based on the new platform API (…
Jun 25, 2019
b92d980
Remapping S6000 platform files under Vendor (DellEmc) specific direct…
gengankarthik Jun 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# OS-generated files
.DS_Store

# Build system related
.platform
.screen
Expand Down
7 changes: 6 additions & 1 deletion Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ SLAVE_IMAGE = sonic-slave-$(USER)
SLAVE_DIR = sonic-slave
endif

OVERLAY_MODULE_CHECK := lsmod | grep "^overlay " > /dev/null 2>&1 || (echo "ERROR: Module 'overlay' not loaded. Try running 'sudo modprobe overlay'."; exit 1)
OVERLAY_MODULE_CHECK := \
lsmod | grep -q "^overlay " &>/dev/null || \
zgrep -q 'CONFIG_OVERLAY_FS=y' /proc/config.gz &>/dev/null || \
grep -q 'CONFIG_OVERLAY_FS=y' /boot/config-$(shell uname -r) &>/dev/null || \
(echo "ERROR: Module 'overlay' not loaded. Try running 'sudo modprobe overlay'."; exit 1)

BUILD_TIMESTAMP := $(shell date +%Y%m%d\.%H%M%S)

Expand Down Expand Up @@ -117,6 +121,7 @@ SONIC_BUILD_INSTRUCTION := make \
PASSWORD=$(PASSWORD) \
USERNAME=$(USERNAME) \
SONIC_BUILD_JOBS=$(SONIC_BUILD_JOBS) \
SONIC_USE_DOCKER_BUILDKIT=$(SONIC_USE_DOCKER_BUILDKIT) \
VS_PREPARE_MEM=$(VS_PREPARE_MEM) \
KERNEL_PROCURE_METHOD=$(KERNEL_PROCURE_METHOD) \
HTTP_PROXY=$(http_proxy) \
Expand Down
6 changes: 3 additions & 3 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set -x -e

## docker engine version (with platform)
DOCKER_VERSION=5:18.09.2~3-0~debian-stretch
LINUX_KERNEL_VERSION=4.9.0-8-2
LINUX_KERNEL_VERSION=4.9.0-9-2

## Working directory to prepare the file system
FILESYSTEM_ROOT=./fsroot
Expand Down Expand Up @@ -121,7 +121,7 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/initramfs-tools_*.deb || \
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/linux-image-${LINUX_KERNEL_VERSION}-amd64_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install acl
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install dmidecode
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install dmidecode

## Update initramfs for booting with squashfs+overlay
cat files/initramfs-tools/modules | sudo tee -a $FILESYSTEM_ROOT/etc/initramfs-tools/modules > /dev/null
Expand Down Expand Up @@ -409,7 +409,7 @@ fi
## Organization specific extensions such as Configuration & Scripts for features like AAA, ZTP...
if [ "${enable_organization_extensions}" = "y" ]; then
if [ -f files/build_templates/organization_extensions.sh ]; then
sudo chmod 755 files/build_templates/organization_extensions.sh
sudo chmod 755 files/build_templates/organization_extensions.sh
./files/build_templates/organization_extensions.sh -f $FILESYSTEM_ROOT -h $HOSTNAME
fi
fi
Expand Down
64 changes: 59 additions & 5 deletions device/accton/x86_64-accton_as7726_32x-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

try:
import time
import string
from ctypes import create_string_buffer
from sonic_sfp.sfputilbase import SfpUtilBase
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))
Expand Down Expand Up @@ -110,11 +112,63 @@ def get_presence(self, port_num):

return False

def get_low_power_mode(self, port_num):
raise NotImplementedError

def set_low_power_mode(self, port_num, lpmode):
raise NotImplementedError
def get_low_power_mode(self, port_num):
# Check for invalid port_num
if port_num < self.port_start or port_num > self.port_end:
return False

try:
eeprom = None

if not self.get_presence(port_num):
return False

eeprom = open(self.port_to_eeprom_mapping[port_num], "rb")
eeprom.seek(93)
lpmode = ord(eeprom.read(1))

if ((lpmode & 0x3) == 0x3):
return True # Low Power Mode if "Power override" bit is 1 and "Power set" bit is 1
else:
return False # High Power Mode if one of the following conditions is matched:
# 1. "Power override" bit is 0
# 2. "Power override" bit is 1 and "Power set" bit is 0
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
finally:
if eeprom is not None:
eeprom.close()
time.sleep(0.01)

def set_low_power_mode(self, port_num, lpmode):
# Check for invalid port_num
if port_num < self.port_start or port_num > self.port_end:
return False

try:
eeprom = None

if not self.get_presence(port_num):
return False # Port is not present, unable to set the eeprom

# Fill in write buffer
regval = 0x3 if lpmode else 0x1 # 0x3:Low Power Mode, 0x1:High Power Mode
buffer = create_string_buffer(1)
buffer[0] = chr(regval)

# Write to eeprom
eeprom = open(self.port_to_eeprom_mapping[port_num], "r+b")
eeprom.seek(93)
eeprom.write(buffer[0])
return True
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
finally:
if eeprom is not None:
eeprom.close()
time.sleep(0.01)

def reset(self, port_num):
if port_num < self.port_start or port_num > self.port_end:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"instance": 0,
"chip_list": [
{
"id": "asic-0",
"chip_family": "Tofino",
"instance": 0,
"pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0",
"pcie_domain": 0,
"pcie_bus": 5,
"pcie_fn": 0,
"pcie_dev": 0,
"pcie_int_mode": 1,
"sds_fw_path": "share/tofino_sds_fw/avago/firmware"
}
],
"p4_devices": [
{
"device-id": 0,
"p4_programs": [
{
"p4_pipelines": [
{
"p4_pipeline_name": "pipe",
"config": "share/tofinopd/switch/pipe/tofino.bin",
"context": "share/tofinopd/switch/pipe/context.json"
}
],
"program-name": "switch",
"switchsai": "lib/libswitchsai.so",
"bfrt-config": "share/tofinopd/switch/bf-rt.json",
"model_json_path" : "share/switch/aug_model.json",
"switchapi_port_add": false,
"non_default_port_ppgs": 5
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"instance": 0,
"chip_list": [
{
"id": "asic-0",
"chip_family": "Tofino",
"instance": 0,
"pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0",
"pcie_domain": 0,
"pcie_bus": 5,
"pcie_fn": 0,
"pcie_dev": 0,
"pcie_int_mode": 1,
"sds_fw_path": "share/tofino_sds_fw/avago/firmware"
}
],
"p4_devices": [
{
"device-id": 0,
"p4_programs": [
{
"p4_pipelines": [
{
"p4_pipeline_name": "pipe",
"config": "share/tofinopd/switch/pipe/tofino.bin",
"context": "share/tofinopd/switch/pipe/context.json"
}
],
"program-name": "switch",
"switchsai": "lib/libswitchsai.so",
"bfrt-config": "share/tofinopd/switch/bf-rt.json",
"model_json_path" : "share/switch/aug_model.json",
"switchapi_port_add": false,
"non_default_port_ppgs": 5
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
try:
from sonic_platform_base.chassis_base import ChassisBase
from sonic_platform.fan import Fan
from sonic_platform.psu import Psu
except ImportError as e:
raise ImportError(str(e) + "- required module not found")

Expand All @@ -26,6 +27,7 @@
SMC_CPLD_PATH = "/sys/devices/platform/e1031.smc/version"
MMC_CPLD_PATH = "/sys/devices/platform/e1031.smc/getreg"
NUM_FAN = 3
NUM_PSU = 2


class Chassis(ChassisBase):
Expand All @@ -36,6 +38,9 @@ def __init__(self):
for index in range(0, NUM_FAN):
fan = Fan(index)
self._fan_list.append(fan)
for index in range(0, NUM_PSU):
psu = Psu(index)
self._psu_list.append(psu)
ChassisBase.__init__(self)

def __get_register_value(self, path, register):
Expand Down
61 changes: 61 additions & 0 deletions device/celestica/x86_64-cel_e1031-r0/sonic_platform/psu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env python

#############################################################################
# Celestica
#
# Module contains an implementation of SONiC Platform Base API and
# provides the PSUs status which are available in the platform
#
#############################################################################

import os.path
import sonic_platform

try:
from sonic_platform_base.psu_base import PsuBase
from sonic_platform.fan import Fan
except ImportError as e:
raise ImportError(str(e) + "- required module not found")

FAN_E1031_SPEED_PATH = "/sys/class/hwmon/hwmon{}/fan1_input"
FAN_MAX_RPM = 11000


class Psu(PsuBase):
"""Platform-specific Psu class"""

def __init__(self, psu_index):
PsuBase.__init__(self)
self.index = psu_index

def get_fan(self):
"""
Retrieves object representing the fan module contained in this PSU
Returns:
An object dervied from FanBase representing the fan module
contained in this PSU
"""
fan_speed_path = FAN_E1031_SPEED_PATH.format(
str(self.index+3))
try:
with open(fan_speed_path) as fan_speed_file:
fan_speed_rpm = int(fan_speed_file.read())
except IOError:
fan_speed = 0

fan_speed = float(fan_speed_rpm)/FAN_MAX_RPM * 100
fan = Fan(0)
fan.fan_speed = int(fan_speed) if int(fan_speed) <= 100 else 100
return fan

def set_status_led(self, color):
"""
Sets the state of the PSU status LED
Args:
color: A string representing the color with which to set the PSU status LED
Note: Only support green and off
Returns:
bool: True if status LED state is set successfully, False if not
"""
# Hardware not supported
return False
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
try:
from sonic_platform_base.chassis_base import ChassisBase
from sonic_platform.fan import Fan
from sonic_platform.psu import Psu
except ImportError as e:
raise ImportError(str(e) + "- required module not found")

BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version"
GETREG_PATH = "/sys/devices/platform/dx010_cpld/getreg"
CONFIG_DB_PATH = "/etc/sonic/config_db.json"
NUM_FAN = 5
NUM_PSU = 2
CPLD_ADDR_MAPPING = {
"CPLD1": "0x100",
"CPLD2": "0x200",
Expand All @@ -41,6 +43,9 @@ def __init__(self):
for index in range(0, NUM_FAN):
fan = Fan(index)
self._fan_list.append(fan)
for index in range(0, NUM_PSU):
psu = Psu(index)
self._psu_list.append(psu)
ChassisBase.__init__(self)

def __get_register_value(self, path, register):
Expand Down
Loading