Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into syslog_telemetry_…
Browse files Browse the repository at this point in the history
…shared
  • Loading branch information
renukamanavalan committed Jul 29, 2022
2 parents 8d8103e + ae0d8a2 commit 3e9a073
Show file tree
Hide file tree
Showing 138 changed files with 2,611 additions and 415 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/official-build-cisco-8000.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ stages:
fi
cd $(dirname $filename)
echo "PWD=$(pwd)"
ls -l *.deb
ls -l cisco-*.deb
while read -r package; do
# Cisco version format: <VERSION>-sai-<sai-ver>-<distribution>-<COMMIT HASH>
# The <sai-ver> may contain several values in one build, the part is skipped when publishing to storage
Expand All @@ -93,7 +93,7 @@ stages:
package_url="$PACKAGE_URL/sai/ciscosai/master/$version/$package"
echo "Override package $package from $package_url"
wget "$package_url$StorageSASKey" -O "$package"
done < <(ls *.deb)
done < <(ls cisco-*.deb)
env:
StorageSASKey: $(StorageSASKey)
condition: ne(variables['Build.Reason'], 'PullRequest')
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/official-build-multi-asic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ stages:

jobs:
- job:
pool: sonictest
pool: sonictest-ma
displayName: "kvmtest-multi-asic-t1-lag"
timeoutInMinutes: 240

Expand Down
2 changes: 2 additions & 0 deletions .azure-pipelines/run-test-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ steps:
rm -rf $(Build.ArtifactStagingDirectory)/*
docker exec sonic-mgmt bash -c "/data/sonic-mgmt/tests/kvmtest.sh -en -T ${{ parameters.tbtype }} ${{ parameters.tbname }} ${{ parameters.dut }} ${{ parameters.section }}"
displayName: "Run tests"
${{ if eq(parameters.tbtype, 'multi-asic-t1-lag-pr') }}:
continueOnError: true

- script: |
# save dut state if test fails
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@
[submodule "src/sonic-mgmt-framework"]
path = src/sonic-mgmt-framework
url = https://github.com/Azure/sonic-mgmt-framework
[submodule "src/sonic-telemetry"]
path = src/sonic-telemetry
url = https://github.com/Azure/sonic-telemetry
[submodule "Switch-SDK-drivers"]
path = platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers
url = https://github.com/Mellanox/Switch-SDK-drivers
Expand Down Expand Up @@ -112,3 +109,6 @@
[submodule "src/sonic-host-services"]
path = src/sonic-host-services
url = https://github.com/sonic-net/sonic-host-services
[submodule "src/sonic-gnmi"]
path = src/sonic-gnmi
url = https://github.com/sonic-net/sonic-gnmi.git
20 changes: 15 additions & 5 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,21 @@ endif
ifeq ($(CONFIGURED_ARCH),amd64)
SLAVE_BASE_IMAGE = $(SLAVE_DIR)
MULTIARCH_QEMU_ENVIRON = n
CROSS_BUILD_ENVIRON = n
else
ifeq ($(CONFIGURED_ARCH), $(COMPILE_HOST_ARCH))
SLAVE_BASE_IMAGE = $(SLAVE_DIR)
MULTIARCH_QEMU_ENVIRON = n
CROSS_BUILD_ENVIRON = n
else ifneq ($(CONFIGURED_ARCH),)
SLAVE_BASE_IMAGE = $(SLAVE_DIR)-march-$(CONFIGURED_ARCH)
ifneq ($(CROSS_BLDENV),)
MULTIARCH_QEMU_ENVIRON = n
CROSS_BUILD_ENVIRON = y
else
MULTIARCH_QEMU_ENVIRON = y
CROSS_BUILD_ENVIRON = n
endif
endif
endif
SLAVE_IMAGE = $(SLAVE_BASE_IMAGE)-$(USER_LC)
Expand All @@ -169,8 +177,8 @@ $(shell SONIC_VERSION_CONTROL_COMPONENTS=$(SONIC_VERSION_CONTROL_COMPONENTS) \
scripts/generate_buildinfo_config.sh)

# Generate the slave Dockerfile, and prepare build info for it
$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) ENABLE_FIPS_FEATURE=$(ENABLE_FIPS_FEATURE) DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile)
$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) j2 $(SLAVE_DIR)/Dockerfile.user.j2 > $(SLAVE_DIR)/Dockerfile.user)
$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) CROSS_BUILD_ENVIRON=$(CROSS_BUILD_ENVIRON) ENABLE_FIPS_FEATURE=$(ENABLE_FIPS_FEATURE) DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile)
$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) CROSS_BUILD_ENVIRON=$(CROSS_BUILD_ENVIRON) j2 $(SLAVE_DIR)/Dockerfile.user.j2 > $(SLAVE_DIR)/Dockerfile.user)
$(shell BUILD_SLAVE=y DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) scripts/prepare_docker_buildinfo.sh $(SLAVE_BASE_IMAGE) $(SLAVE_DIR)/Dockerfile $(CONFIGURED_ARCH) "" $(BLDENV))

# Add the versions in the tag, if the version change, need to rebuild the slave
Expand All @@ -194,7 +202,8 @@ endif
DOCKER_LOCKFILE_SAVE := $(DOCKER_LOCKDIR)/docker_save.lock
$(shell mkdir -m 0777 -p $(DOCKER_LOCKDIR))
$(shell [ -f $(DOCKER_LOCKFILE_SAVE) ] || (touch $(DOCKER_LOCKFILE_SAVE) && chmod 0777 $(DOCKER_LOCKFILE_SAVE)))
$(shell sudo rm -rf $(DOCKER_ROOT) && mkdir -p $(DOCKER_ROOT))
$(docker run --rm -v $(DOCKER_ROOT)\:/mount alpine sh -c 'rm -rf /mount/')
$(mkdir -p $(DOCKER_ROOT))

ifeq ($(DOCKER_BUILDER_MOUNT),)
override DOCKER_BUILDER_MOUNT := "$(PWD):/sonic"
Expand Down Expand Up @@ -272,7 +281,7 @@ ifneq ($(MULTIARCH_QEMU_ENVIRON), y)
endif
endif

ifeq ($(MULTIARCH_QEMU_ENVIRON), y)
ifneq ($(filter y, $(MULTIARCH_QEMU_ENVIRON) $(CROSS_BUILD_ENVIRON)),)
ifeq ($(DOCKER_DATA_ROOT_FOR_MULTIARCH),)
DOCKER_DATA_ROOT_FOR_MULTIARCH := /var/lib/march/docker
endif
Expand Down Expand Up @@ -344,6 +353,7 @@ SONIC_BUILD_INSTRUCTION := make \
PLATFORM=$(PLATFORM) \
PLATFORM_ARCH=$(PLATFORM_ARCH) \
MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) \
CROSS_BUILD_ENVIRON=$(CROSS_BUILD_ENVIRON) \
BUILD_NUMBER=$(BUILD_NUMBER) \
BUILD_TIMESTAMP=$(BUILD_TIMESTAMP) \
SONIC_IMAGE_VERSION=$(SONIC_IMAGE_VERSION) \
Expand Down Expand Up @@ -405,7 +415,7 @@ SONIC_BUILD_INSTRUCTION := make \
.DEFAULT_GOAL := all

%::
ifeq ($(MULTIARCH_QEMU_ENVIRON), y)
ifneq ($(filter y, $(MULTIARCH_QEMU_ENVIRON) $(CROSS_BUILD_ENVIRON)),)
@$(DOCKER_MULTIARCH_CHECK)
ifneq ($(BLDENV), )
@$(DOCKER_SERVICE_MULTIARCH_CHECK)
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ To build Arm32 bit for (ARMHF) platform

make target/sonic-marvell-armhf.bin

To build Arm32 bit for (ARMHF) Marvell platform on amd64 host for debian buster using cross-compilation run the following commands:

# Execute make configure once to configure ASIC and ARCH for cross-compilation build

NOJESSIE=1 NOSTRETCH=1 BLDENV=buster CROSS_BLDENV=1 make configure PLATFORM=marvell-armhf PLATFORM_ARCH=armhf

# Execute Arm32 build using cross-compilation environment

NOJESSIE=1 NOSTRETCH=1 BLDENV=buster CROSS_BLDENV=1 make target/sonic-marvell-armhf.bin

Running the above Arm32 build using cross-compilation instead of qemu emulator drastically reduces the build time.


To build Arm64 bit for platform
Expand Down
18 changes: 16 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ resources:
repositories:
- repository: sonic-mgmt
type: github
name: Azure/sonic-mgmt
endpoint: build
name: sonic-net/sonic-mgmt
endpoint: sonic-net
- repository: buildimage
type: github
name: Azure/sonic-buildimage
Expand Down Expand Up @@ -208,3 +208,17 @@ stages:
ptf_name: ptf_vms6-1
tbtype: t0-sonic
vmtype: vsonic

- job:
pool: sonictest-ma
displayName: "kvmtest-multi-asic-t1-lag"
timeoutInMinutes: 240

steps:
- template: .azure-pipelines/run-test-template.yml
parameters:
dut: vlab-08
tbname: vms-kvm-four-asic-t1-lag
ptf_name: ptf_vms6-4
tbtype: multi-asic-t1-lag-pr
image: sonic-4asic-vs.img.gz
6 changes: 5 additions & 1 deletion build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ echo 'Dir::Bin::dpkg "/usr/local/bin/dpkg";' | sudo tee $FILESYSTEM_ROOT/etc/apt
echo '[INFO] Install packages for building image'
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install makedev psmisc

if [[ $CROSS_BUILD_ENVIRON == y ]]; then
sudo LANG=C chroot $FILESYSTEM_ROOT dpkg --add-architecture $CONFIGURED_ARCH
fi

## Create device files
echo '[INFO] MAKEDEV'
if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then
Expand Down Expand Up @@ -643,7 +647,7 @@ fi
# ALERT: This bit of logic tears down the qemu based build environment used to
# perform builds for the ARM architecture. This must be the last step in this
# script before creating the Sonic installer payload zip file.
if [ $MULTIARCH_QEMU_ENVIRON == y ]; then
if [[ $MULTIARCH_QEMU_ENVIRON == y || $CROSS_BUILD_ENVIRON == y ]]; then
# Remove qemu arm bin executable used for cross-building
sudo rm -f $FILESYSTEM_ROOT/usr/bin/qemu*static || true
DOCKERFS_PATH=../dockerfs/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,4 @@ sram_scan_enable.0=0
stable_size=0x5500000
tdma_timeout_usec.0=15000000
tslam_timeout_usec.0=15000000
sai_mdio_access_clause22=1
67 changes: 36 additions & 31 deletions device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

try:
import time
from ctypes import create_string_buffer
from ctypes import c_char
from sonic_platform_base.sfp_base import SfpBase
from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId
from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom
Expand Down Expand Up @@ -121,8 +121,8 @@
SFP_VOLT_WIDTH = 2
SFP_CHANNL_MON_OFFSET = 100
SFP_CHANNL_MON_WIDTH = 6
SFP_CHANNL_STATUS_OFFSET = 110
SFP_CHANNL_STATUS_WIDTH = 1
SFP_STATUS_CONTROL_OFFSET = 110
SFP_STATUS_CONTROL_WIDTH = 1
SFP_TX_DISABLE_HARD_BIT = 7
SFP_TX_DISABLE_SOFT_BIT = 6

Expand Down Expand Up @@ -869,7 +869,7 @@ def get_rx_los(self):
elif self.sfp_type == SFP_TYPE:
offset = 256
dom_channel_monitor_raw = self._read_eeprom_specific_bytes(
(offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH)
(offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH)
if dom_channel_monitor_raw is not None:
rx_los_data = int(dom_channel_monitor_raw[0], 16)
rx_los_list.append(rx_los_data & 0x02 != 0)
Expand Down Expand Up @@ -901,7 +901,7 @@ def get_tx_fault(self):
elif self.sfp_type == SFP_TYPE:
offset = 256
dom_channel_monitor_raw = self._read_eeprom_specific_bytes(
(offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH)
(offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH)
if dom_channel_monitor_raw is not None:
tx_fault_data = int(dom_channel_monitor_raw[0], 16)
tx_fault_list.append(tx_fault_data & 0x04 != 0)
Expand Down Expand Up @@ -936,7 +936,7 @@ def get_tx_disable(self):
elif self.sfp_type == SFP_TYPE:
offset = 256
dom_channel_monitor_raw = self._read_eeprom_specific_bytes(
(offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH)
(offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH)
if dom_channel_monitor_raw is not None:
tx_disable_data = int(dom_channel_monitor_raw[0], 16)
tx_disable_list.append(tx_disable_data & 0xC0 != 0)
Expand Down Expand Up @@ -1170,31 +1170,36 @@ def tx_disable(self, tx_disable):
Returns:
A boolean, True if tx_disable is set successfully, False if not
"""
sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num]
status_control_raw = self._read_eeprom_specific_bytes(
SFP_CHANNL_STATUS_OFFSET, SFP_CHANNL_STATUS_WIDTH)
if status_control_raw is not None:
# Set bit 6 for Soft TX Disable Select
# 01000000 = 64 and 10111111 = 191
tx_disable_bit = 64 if tx_disable else 191
status_control = int(status_control_raw[0], 16)
tx_disable_ctl = (status_control | tx_disable_bit) if tx_disable else (
status_control & tx_disable_bit)
try:
sysfsfile_eeprom = open(
sysfs_sfp_i2c_client_eeprom_path, mode="r+b", buffering=0)
buffer = create_string_buffer(1)
buffer[0] = chr(tx_disable_ctl)
# Write to eeprom
sysfsfile_eeprom.seek(SFP_CHANNL_STATUS_OFFSET)
sysfsfile_eeprom.write(buffer[0])
except Exception:
return False
finally:
if sysfsfile_eeprom:
sysfsfile_eeprom.close()
time.sleep(0.01)
return True
if not self.get_presence():
return False

if self.dom_tx_disable_supported:
# SFP status/control register at address A2h, byte 110
offset = 256
sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num]
status_control_raw = self._read_eeprom_specific_bytes(
(offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH)
if status_control_raw is not None:
# Set bit 6 for Soft TX Disable Select
# 01000000 = 64 and 10111111 = 191
tx_disable_bit = 64 if tx_disable else 191
status_control = int(status_control_raw[0], 16)
tx_disable_ctl = (status_control | tx_disable_bit) if tx_disable else (
status_control & tx_disable_bit)
try:
sysfsfile_eeprom = open(
sysfs_sfp_i2c_client_eeprom_path, mode="r+b", buffering=0)
tx_disable_data = c_char(tx_disable_ctl)
# Write to eeprom
sysfsfile_eeprom.seek(offset + SFP_STATUS_CONTROL_OFFSET)
sysfsfile_eeprom.write(tx_disable_data)
except Exception:
return False
finally:
if sysfsfile_eeprom:
sysfsfile_eeprom.close()
time.sleep(0.01)
return True
return False

def tx_disable_channel(self, channel, disable):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def get_position_in_parent(self):
Returns:
integer: The 1-based relative physical position in parent device or -1 if cannot determine the position
"""
return -1
return self.index + 1

def is_replaceable(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ def get_position_in_parent(self):
"""
Retrieves the thermal position information
Returns:
A int value, 0 represent ASIC thermal, 1 represent CPU thermal info
A int value, index of thermal
"""
if self.postion == "cpu":
return 1
return 0
return self.index + 1
Original file line number Diff line number Diff line change
Expand Up @@ -1496,15 +1496,15 @@ tm_port_header_type_in_202.BCM8885X=INJECTED_2_PP
tm_port_header_type_in_203.BCM8885X=INJECTED_2_PP
tm_port_header_type_in_232.BCM8885X=INJECTED_2
tm_port_header_type_in_19.BCM8885X=ETH
tm_port_header_type_in_20.BCM8885X=INJECTED_2
tm_port_header_type_in_20.BCM8885X=ETH
tm_port_header_type_out_0.BCM8885X=CPU
tm_port_header_type_out_200.BCM8885X=ETH
tm_port_header_type_out_201.BCM8885X=ETH
tm_port_header_type_out_202.BCM8885X=ETH
tm_port_header_type_out_203.BCM8885X=ETH
tm_port_header_type_out_232.BCM8885X=CPU
tm_port_header_type_out_19.BCM8885X=ETH
tm_port_header_type_out_20.BCM8885X=RAW
tm_port_header_type_out_20.BCM8885X=ETH
tslam_intr_enable.BCM8885X=0
tslam_timeout_usec.BCM8885X=1000000
ucode_port_0.BCM8885X=CPU.0:core_0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1515,15 +1515,15 @@ tm_port_header_type_in_202.BCM8885X=INJECTED_2_PP
tm_port_header_type_in_203.BCM8885X=INJECTED_2_PP
tm_port_header_type_in_232.BCM8885X=INJECTED_2
tm_port_header_type_in_19.BCM8885X=ETH
tm_port_header_type_in_20.BCM8885X=INJECTED_2
tm_port_header_type_in_20.BCM8885X=ETH
tm_port_header_type_out_0.BCM8885X=CPU
tm_port_header_type_out_200.BCM8885X=ETH
tm_port_header_type_out_201.BCM8885X=ETH
tm_port_header_type_out_202.BCM8885X=ETH
tm_port_header_type_out_203.BCM8885X=ETH
tm_port_header_type_out_232.BCM8885X=CPU
tm_port_header_type_out_19.BCM8885X=ETH
tm_port_header_type_out_20.BCM8885X=RAW
tm_port_header_type_out_20.BCM8885X=ETH
tslam_intr_enable.BCM8885X=0
tslam_timeout_usec.BCM8885X=1000000
ucode_port_0.BCM8885X=CPU.0:core_0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1515,15 +1515,15 @@ tm_port_header_type_in_202.BCM8885X=INJECTED_2_PP
tm_port_header_type_in_203.BCM8885X=INJECTED_2_PP
tm_port_header_type_in_232.BCM8885X=INJECTED_2
tm_port_header_type_in_19.BCM8885X=ETH
tm_port_header_type_in_20.BCM8885X=INJECTED_2
tm_port_header_type_in_20.BCM8885X=ETH
tm_port_header_type_out_0.BCM8885X=CPU
tm_port_header_type_out_200.BCM8885X=ETH
tm_port_header_type_out_201.BCM8885X=ETH
tm_port_header_type_out_202.BCM8885X=ETH
tm_port_header_type_out_203.BCM8885X=ETH
tm_port_header_type_out_232.BCM8885X=CPU
tm_port_header_type_out_19.BCM8885X=ETH
tm_port_header_type_out_20.BCM8885X=RAW
tm_port_header_type_out_20.BCM8885X=ETH
tslam_intr_enable.BCM8885X=0
tslam_timeout_usec.BCM8885X=1000000
ucode_port_0.BCM8885X=CPU.0:core_0.0
Expand Down Expand Up @@ -2055,3 +2055,4 @@ modreg IPS_FORCE_LOCAL_OR_FABRIC FORCE_FABRIC=1

xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2
xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4
cmic_dma_abort_in_cold_boot=0
Loading

0 comments on commit 3e9a073

Please sign in to comment.