Skip to content

Commit

Permalink
Merge branch 'master' into modular-chassis
Browse files Browse the repository at this point in the history
  • Loading branch information
Junchao-Mellanox authored Aug 27, 2021
2 parents b163ae0 + 48ba459 commit 02fd3ae
Show file tree
Hide file tree
Showing 328 changed files with 16,326 additions and 1,150 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/docker-sonic-slave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ parameters:
default: sonicdev

variables:
- ${{ if and(startsWith(variables['Build.SourceBranchName'], '202'), eq(length(variables['Build.SourceBranchName']), 6)) }}:
- ${{ if eq(variables['Build.SourceBranchName'], '202012' }}:
- name: BUILD_OPTIONS
value: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web'
value: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'

stages:
- stage: Build
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,6 @@
path = platform/broadcom/saibcm-modules-dnx
url = https://github.com/Azure/saibcm-modules.git
branch = sdk-6.5.22-gpl-dnx
[submodule "platform/broadcom/sonic-platform-modules-nokia"]
path = platform/broadcom/sonic-platform-modules-nokia
url = https://github.com/nokia/sonic-platform.git
9 changes: 5 additions & 4 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ SHELL = /bin/bash
USER := $(shell id -un)
PWD := $(shell pwd)
USER_LC := $(shell echo $(USER) | tr A-Z a-z)
DOCKER_MACHINE := $(shell docker run --rm debian:buster uname -m)

comma := ,

ifeq ($(shell uname -m), aarch64)
ifeq ($(DOCKER_MACHINE), aarch64)
COMPILE_HOST_ARCH := arm64
else ifeq ($(shell uname -m), armv7l)
else ifeq ($(shell echo $(DOCKER_MACHINE) | grep -qE "armv7l|armv8l" && echo y),y)
COMPILE_HOST_ARCH := armhf
else
COMPILE_HOST_ARCH := amd64
Expand Down Expand Up @@ -286,7 +287,7 @@ SONIC_BUILD_INSTRUCTION := make \
.DEFAULT_GOAL := all

%::
ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64))
ifeq ($(MULTIARCH_QEMU_ENVIRON), y)
@$(DOCKER_MULTIARCH_CHECK)
ifneq ($(BLDENV), )
@$(DOCKER_SERVICE_MULTIARCH_CHECK)
Expand Down Expand Up @@ -361,7 +362,7 @@ reset :
if [ $$ans == y ]; then
echo "Resetting local repository. Please wait...";
$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) sudo rm -rf fsroot;
if [[ "$(CONFIGURED_ARCH)" == "armhf" || "$(CONFIGURED_ARCH)" == "arm64" ]]; then
if [ "$(MULTIARCH_QEMU_ENVIRON)" == y ] && [[ "$(CONFIGURED_ARCH)" == "armhf" || "$(CONFIGURED_ARCH)" == "arm64" ]]; then
echo "Stopping march $(CONFIGURED_ARCH) docker"
sudo kill -9 `sudo cat /var/run/march/docker.pid` || true
sudo rm -f /var/run/march/docker.pid || true
Expand Down
64 changes: 37 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,27 @@
Following is the instruction on how to build an [(ONIE)](https://github.com/opencomputeproject/onie) compatible network operating system (NOS) installer image for network switches, and also how to build docker images running inside the NOS. Note that SONiC image are build per ASIC platform. Switches using the same ASIC platform share a common image. For a list of supported switches and ASIC, please refer to this [list](https://github.com/Azure/SONiC/wiki/Supported-Devices-and-Platforms)

# Hardware
Any server can be a build image server. We are using a server with 1T hard disk. The OS is Ubuntu 16.04.

## Prerequisites
Any server can be a build image server as long as it has:

Install pip and jinja in host build machine, execute below commands if j2/j2cli is not available:
* Multiple cores to increase build speed
* Plenty of RAM (less than 8 GiB is likely to cause issues)
* 300G of free disk space

sudo apt-get install -y python-pip
sudo python2 -m pip install -U pip==9.0.3
sudo pip install --force-reinstall --upgrade jinja2>=2.10
sudo pip install j2cli
A good choice of OS for building SONiC is currently Ubuntu 20.04.

Configure your system to allow running the 'docker' command without 'sudo':
Add current user to the docker group
`sudo gpasswd -a ${USER} docker`
Log out and log back in so that your group membership is re-evaluated
## Prerequisites

## SAI Version
Please refer to [SONiC roadmap](https://github.com/Azure/SONiC/wiki/Sonic-Roadmap-Planning) on the SAI version for each SONiC release.
* Install pip and jinja in host build machine, execute below commands if j2/j2cli is not available:

```
sudo apt install -y python3-pip
sudo pip3 install j2cli
```

* Install [Docker](https://docs.docker.com/engine/install/) and configure your system to allow running the 'docker' command without 'sudo':
* Add current user to the docker group: `sudo gpasswd -a ${USER} docker`
* Log out and log back in so that your group membership is re-evaluated

## Clone or fetch the code repository with all git submodules
To clone the code repository recursively, assuming git version 1.9 or newer:
Expand All @@ -110,8 +113,22 @@ To build SONiC installer image and docker images, run the following commands:
# Execute make configure once to configure ASIC
make configure PLATFORM=[ASIC_VENDOR]

# Build SONiC image
make all
# Build SONiC image with 4 jobs in parallel.
# Note: You can set this higher, but 4 is a good number for most cases
# and is well-tested.
make SONIC_BUILD_JOBS=4 all

The supported ASIC vendors are:

- PLATFORM=broadcom
- PLATFORM=marvell
- PLATFORM=mellanox
- PLATFORM=cavium
- PLATFORM=centec
- PLATFORM=nephos
- PLATFORM=innovium
- PLATFORM=p4
- PLATFORM=vs

## Usage for ARM Architecture
To build Arm32 bit for (ARMHF) platform
Expand Down Expand Up @@ -147,7 +164,7 @@ To build Arm64 bit for platform

**NOTE**:

- Recommend reserving 50G free space to build one platform.
- Recommend reserving at least 100G free space to build one platform with a single job. The build process will use more disk if you are setting `SONIC_BUILD_JOBS` to more than 1.
- If Docker's workspace folder, `/var/lib/docker`, resides on a partition without sufficient free space, you may encounter an error like the following during a Docker container build job:

`/usr/bin/tar: /path/to/sonic-buildimage/<some_file>: Cannot write: No space left on device`
Expand All @@ -156,17 +173,7 @@ To build Arm64 bit for platform
- Use `http_proxy=[your_proxy] https_proxy=[your_proxy] no_proxy=[your_no_proxy] make` to enable http(s) proxy in the build process.
- Add your user account to `docker` group and use your user account to make. `root` or `sudo` are not supported.

The SONiC installer contains all docker images needed. SONiC uses one image for all devices of a same ASIC vendor. The supported ASIC vendors are:

- PLATFORM=broadcom
- PLATFORM=marvell
- PLATFORM=mellanox
- PLATFORM=cavium
- PLATFORM=centec
- PLATFORM=nephos
- PLATFORM=innovium
- PLATFORM=p4
- PLATFORM=vs
The SONiC installer contains all docker images needed. SONiC uses one image for all devices of a same ASIC vendor.

For Broadcom ASIC, we build ONIE and EOS image. EOS image is used for Arista devices, ONIE image is used for all other Broadcom ASIC based devices.

Expand Down Expand Up @@ -198,6 +205,9 @@ It is recommended to use clean targets to clean all packages that are built toge
## Build debug dockers and debug SONiC installer image:
SONiC build system supports building dockers and ONIE-image with debug tools and debug symbols, to help with live & core debugging. For details refer to [(SONiC Buildimage Guide)](https://github.com/Azure/sonic-buildimage/blob/master/README.buildsystem.md).

## SAI Version
Please refer to [SONiC roadmap](https://github.com/Azure/SONiC/wiki/Sonic-Roadmap-Planning) on the SAI version for each SONiC release.

## Notes:
- If you are running make for the first time, a sonic-slave-${USER} docker image will be built automatically.
This may take a while, but it is a one-time action, so please be patient.
Expand Down
9 changes: 5 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pr:
include:
- master
- 202012
- bullseye
paths:
exclude:
- .github
Expand All @@ -36,7 +37,7 @@ stages:
variables:
CACHE_MODE: rcache
${{ if eq(variables['Build.SourceBranchName'], '202012') }}:
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web'
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'
jobs:
- template: .azure-pipelines/azure-pipelines-build.yml
parameters:
Expand Down Expand Up @@ -71,7 +72,7 @@ stages:
source: specific
project: build
pipeline: 9
artifacts: sonic-swss-common.amd64.ubuntu20_04
artifact: sonic-swss-common.amd64.ubuntu20_04
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic swss common deb packages"
Expand All @@ -83,8 +84,8 @@ stages:

- script: |
set -x
sudo dpkg -i --force-confask,confnew ../sonic-swss-common.amd64.ubuntu20_04/libswsscommon_1.0.0_amd64.deb
sudo dpkg -i ../sonic-swss-common.amd64.ubuntu20_04/python3-swsscommon_1.0.0_amd64.deb
sudo dpkg -i --force-confask,confnew ../libswsscommon_1.0.0_amd64.deb
sudo dpkg -i ../python3-swsscommon_1.0.0_amd64.deb
sudo docker load -i ../target/docker-sonic-vs.gz
docker tag docker-sonic-vs:latest docker-sonic-vs:$(Build.BuildNumber)
username=$(id -un)
Expand Down
22 changes: 20 additions & 2 deletions device/accton/x86_64-accton_as4630_54pe-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def port_end(self):

@property
def qsfp_ports(self):
return list(range(self.PORT_START, self.PORTS_IN_BLOCK + 1))
return list(range(self.QSFP_START, self.PORTS_IN_BLOCK + 1))

@property
def port_to_eeprom_mapping(self):
Expand Down Expand Up @@ -147,7 +147,25 @@ def set_low_power_mode(self, port_num, lpmode):
time.sleep(0.01)

def reset(self, port_num):
raise NotImplementedError
if not port_num in self.qsfp_ports:
return False

path = self.BASE_CPLD_PATH + "module_reset_" + str(port_num)
self.__port_to_mod_rst = path
try:
reg_file = open(self.__port_to_mod_rst, 'r+', buffering=0)
except IOError as e:
print( "Error: unable to open file: %s" % str(e))
return False

#toggle reset
reg_file.seek(0)
reg_file.write('1')
time.sleep(1)
reg_file.seek(0)
reg_file.write('0')
reg_file.close()
return True

@property
def _get_presence_bitmap(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ ipv6_lpm_128b_enable=1
l2_mem_entries=32768
l3_mem_entries=16384

# Disable Counting ACL Drop towards interface RX_DRP counter
sai_adjust_acl_drop_in_rx_drop=1

# From old config file
os=unix
higig2_hdr_mode=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ ipv6_lpm_128b_enable=1
l2_mem_entries=32768
l3_mem_entries=16384

# Disable Counting ACL Drop towards interface RX_DRP counter
sai_adjust_acl_drop_in_rx_drop=1

# From old config file
os=unix
higig2_hdr_mode=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ ipv6_lpm_128b_enable=1
l2_mem_entries=32768
l3_mem_entries=16384

# Disable Counting ACL Drop towards interface RX_DRP counter
sai_adjust_acl_drop_in_rx_drop=1

# From old config file
os=unix
higig2_hdr_mode=1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

echo 1 > /sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/mux
100 changes: 100 additions & 0 deletions device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S/hwsku.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"interfaces": {
"Ethernet0": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet4": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet8": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet12": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet16": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet20": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet24": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet28": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet32": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet36": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet40": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet44": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet48": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet52": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet56": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet60": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet64": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet68": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet72": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet76": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet80": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet84": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet88": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet92": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet96": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet100": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet104": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet108": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet112": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet116": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet120": {
"default_brkout_mode": "1x40G[10G]"
},
"Ethernet124": {
"default_brkout_mode": "1x40G[10G]"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# name lanes alias index speed
Ethernet0 9,10,11,12 Ethernet5/1 5 40000
Ethernet4 13,14,15,16 Ethernet6/1 6 40000
Ethernet8 17,18,19,20 Ethernet7/1 7 40000
Ethernet12 21,22,23,24 Ethernet8/1 8 40000
Ethernet16 29,30,31,32 Ethernet9/1 9 40000
Ethernet20 25,26,27,28 Ethernet10/1 10 40000
Ethernet24 33,34,35,36 Ethernet11/1 11 40000
Ethernet28 37,38,39,40 Ethernet12/1 12 40000
Ethernet32 45,46,47,48 Ethernet13/1 13 40000
Ethernet36 41,42,43,44 Ethernet14/1 14 40000
Ethernet40 49,50,51,52 Ethernet15/1 15 40000
Ethernet44 53,54,55,56 Ethernet16/1 16 40000
Ethernet48 69,70,71,72 Ethernet17/1 17 40000
Ethernet52 65,66,67,68 Ethernet18/1 18 40000
Ethernet56 73,74,75,76 Ethernet19/1 19 40000
Ethernet60 77,78,79,80 Ethernet20/1 20 40000
Ethernet64 93,94,95,96 Ethernet21/1 21 40000
Ethernet68 89,90,91,92 Ethernet22/1 22 40000
Ethernet72 97,98,99,100 Ethernet23/1 23 40000
Ethernet76 101,102,103,104 Ethernet24/1 24 40000
Ethernet80 109,110,111,112 Ethernet25/1 25 40000
Ethernet84 105,106,107,108 Ethernet26/1 26 40000
Ethernet88 121,122,123,124 Ethernet27/1 27 40000
Ethernet92 125,126,127,128 Ethernet28/1 28 40000
Ethernet96 61,62,63,64 Ethernet29 29 40000
Ethernet100 57,58,59,60 Ethernet30 30 40000
Ethernet104 81,82,83,84 Ethernet31 31 40000
Ethernet108 85,86,87,88 Ethernet32 32 40000
Ethernet112 117,118,119,120 Ethernet33 33 40000
Ethernet116 113,114,115,116 Ethernet34 34 40000
Ethernet120 1,2,3,4 Ethernet35 35 40000
Ethernet124 5,6,7,8 Ethernet36 36 40000
Loading

0 comments on commit 02fd3ae

Please sign in to comment.