Skip to content

Commit 02fd3ae

Browse files
Merge branch 'master' into modular-chassis
2 parents b163ae0 + 48ba459 commit 02fd3ae

File tree

328 files changed

+16326
-1150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

328 files changed

+16326
-1150
lines changed

.azure-pipelines/docker-sonic-slave.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ parameters:
4646
default: sonicdev
4747

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

5353
stages:
5454
- stage: Build

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,6 @@
9191
path = platform/broadcom/saibcm-modules-dnx
9292
url = https://github.com/Azure/saibcm-modules.git
9393
branch = sdk-6.5.22-gpl-dnx
94+
[submodule "platform/broadcom/sonic-platform-modules-nokia"]
95+
path = platform/broadcom/sonic-platform-modules-nokia
96+
url = https://github.com/nokia/sonic-platform.git

Makefile.work

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@ SHELL = /bin/bash
4747
USER := $(shell id -un)
4848
PWD := $(shell pwd)
4949
USER_LC := $(shell echo $(USER) | tr A-Z a-z)
50+
DOCKER_MACHINE := $(shell docker run --rm debian:buster uname -m)
5051

5152
comma := ,
5253

53-
ifeq ($(shell uname -m), aarch64)
54+
ifeq ($(DOCKER_MACHINE), aarch64)
5455
COMPILE_HOST_ARCH := arm64
55-
else ifeq ($(shell uname -m), armv7l)
56+
else ifeq ($(shell echo $(DOCKER_MACHINE) | grep -qE "armv7l|armv8l" && echo y),y)
5657
COMPILE_HOST_ARCH := armhf
5758
else
5859
COMPILE_HOST_ARCH := amd64
@@ -286,7 +287,7 @@ SONIC_BUILD_INSTRUCTION := make \
286287
.DEFAULT_GOAL := all
287288

288289
%::
289-
ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64))
290+
ifeq ($(MULTIARCH_QEMU_ENVIRON), y)
290291
@$(DOCKER_MULTIARCH_CHECK)
291292
ifneq ($(BLDENV), )
292293
@$(DOCKER_SERVICE_MULTIARCH_CHECK)
@@ -361,7 +362,7 @@ reset :
361362
if [ $$ans == y ]; then
362363
echo "Resetting local repository. Please wait...";
363364
$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) sudo rm -rf fsroot;
364-
if [[ "$(CONFIGURED_ARCH)" == "armhf" || "$(CONFIGURED_ARCH)" == "arm64" ]]; then
365+
if [ "$(MULTIARCH_QEMU_ENVIRON)" == y ] && [[ "$(CONFIGURED_ARCH)" == "armhf" || "$(CONFIGURED_ARCH)" == "arm64" ]]; then
365366
echo "Stopping march $(CONFIGURED_ARCH) docker"
366367
sudo kill -9 `sudo cat /var/run/march/docker.pid` || true
367368
sudo rm -f /var/run/march/docker.pid || true

README.md

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,27 @@
6767
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)
6868

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

72-
## Prerequisites
71+
Any server can be a build image server as long as it has:
7372

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

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

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

86-
## SAI Version
87-
Please refer to [SONiC roadmap](https://github.com/Azure/SONiC/wiki/Sonic-Roadmap-Planning) on the SAI version for each SONiC release.
81+
* Install pip and jinja in host build machine, execute below commands if j2/j2cli is not available:
82+
83+
```
84+
sudo apt install -y python3-pip
85+
sudo pip3 install j2cli
86+
```
87+
88+
* Install [Docker](https://docs.docker.com/engine/install/) and configure your system to allow running the 'docker' command without 'sudo':
89+
* Add current user to the docker group: `sudo gpasswd -a ${USER} docker`
90+
* Log out and log back in so that your group membership is re-evaluated
8891

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

113-
# Build SONiC image
114-
make all
116+
# Build SONiC image with 4 jobs in parallel.
117+
# Note: You can set this higher, but 4 is a good number for most cases
118+
# and is well-tested.
119+
make SONIC_BUILD_JOBS=4 all
120+
121+
The supported ASIC vendors are:
122+
123+
- PLATFORM=broadcom
124+
- PLATFORM=marvell
125+
- PLATFORM=mellanox
126+
- PLATFORM=cavium
127+
- PLATFORM=centec
128+
- PLATFORM=nephos
129+
- PLATFORM=innovium
130+
- PLATFORM=p4
131+
- PLATFORM=vs
115132

116133
## Usage for ARM Architecture
117134
To build Arm32 bit for (ARMHF) platform
@@ -147,7 +164,7 @@ To build Arm64 bit for platform
147164

148165
**NOTE**:
149166

150-
- Recommend reserving 50G free space to build one platform.
167+
- 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.
151168
- 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:
152169

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

159-
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:
160-
161-
- PLATFORM=broadcom
162-
- PLATFORM=marvell
163-
- PLATFORM=mellanox
164-
- PLATFORM=cavium
165-
- PLATFORM=centec
166-
- PLATFORM=nephos
167-
- PLATFORM=innovium
168-
- PLATFORM=p4
169-
- PLATFORM=vs
176+
The SONiC installer contains all docker images needed. SONiC uses one image for all devices of a same ASIC vendor.
170177

171178
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.
172179

@@ -198,6 +205,9 @@ It is recommended to use clean targets to clean all packages that are built toge
198205
## Build debug dockers and debug SONiC installer image:
199206
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).
200207

208+
## SAI Version
209+
Please refer to [SONiC roadmap](https://github.com/Azure/SONiC/wiki/Sonic-Roadmap-Planning) on the SAI version for each SONiC release.
210+
201211
## Notes:
202212
- If you are running make for the first time, a sonic-slave-${USER} docker image will be built automatically.
203213
This may take a while, but it is a one-time action, so please be patient.

azure-pipelines.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pr:
1717
include:
1818
- master
1919
- 202012
20+
- bullseye
2021
paths:
2122
exclude:
2223
- .github
@@ -36,7 +37,7 @@ stages:
3637
variables:
3738
CACHE_MODE: rcache
3839
${{ if eq(variables['Build.SourceBranchName'], '202012') }}:
39-
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web'
40+
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'
4041
jobs:
4142
- template: .azure-pipelines/azure-pipelines-build.yml
4243
parameters:
@@ -71,7 +72,7 @@ stages:
7172
source: specific
7273
project: build
7374
pipeline: 9
74-
artifacts: sonic-swss-common.amd64.ubuntu20_04
75+
artifact: sonic-swss-common.amd64.ubuntu20_04
7576
runVersion: 'latestFromBranch'
7677
runBranch: 'refs/heads/master'
7778
displayName: "Download sonic swss common deb packages"
@@ -83,8 +84,8 @@ stages:
8384

8485
- script: |
8586
set -x
86-
sudo dpkg -i --force-confask,confnew ../sonic-swss-common.amd64.ubuntu20_04/libswsscommon_1.0.0_amd64.deb
87-
sudo dpkg -i ../sonic-swss-common.amd64.ubuntu20_04/python3-swsscommon_1.0.0_amd64.deb
87+
sudo dpkg -i --force-confask,confnew ../libswsscommon_1.0.0_amd64.deb
88+
sudo dpkg -i ../python3-swsscommon_1.0.0_amd64.deb
8889
sudo docker load -i ../target/docker-sonic-vs.gz
8990
docker tag docker-sonic-vs:latest docker-sonic-vs:$(Build.BuildNumber)
9091
username=$(id -un)

device/accton/x86_64-accton_as4630_54pe-r0/plugins/sfputil.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def port_end(self):
5050

5151
@property
5252
def qsfp_ports(self):
53-
return list(range(self.PORT_START, self.PORTS_IN_BLOCK + 1))
53+
return list(range(self.QSFP_START, self.PORTS_IN_BLOCK + 1))
5454

5555
@property
5656
def port_to_eeprom_mapping(self):
@@ -147,7 +147,25 @@ def set_low_power_mode(self, port_num, lpmode):
147147
time.sleep(0.01)
148148

149149
def reset(self, port_num):
150-
raise NotImplementedError
150+
if not port_num in self.qsfp_ports:
151+
return False
152+
153+
path = self.BASE_CPLD_PATH + "module_reset_" + str(port_num)
154+
self.__port_to_mod_rst = path
155+
try:
156+
reg_file = open(self.__port_to_mod_rst, 'r+', buffering=0)
157+
except IOError as e:
158+
print( "Error: unable to open file: %s" % str(e))
159+
return False
160+
161+
#toggle reset
162+
reg_file.seek(0)
163+
reg_file.write('1')
164+
time.sleep(1)
165+
reg_file.seek(0)
166+
reg_file.write('0')
167+
reg_file.close()
168+
return True
151169

152170
@property
153171
def _get_presence_bitmap(self):

device/arista/x86_64-arista_7050_qx32/Arista-7050-Q16S64/td2-a7050-qx32-16x40G+32x10G+8x40G.config.bcm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ ipv6_lpm_128b_enable=1
2424
l2_mem_entries=32768
2525
l3_mem_entries=16384
2626

27+
# Disable Counting ACL Drop towards interface RX_DRP counter
28+
sai_adjust_acl_drop_in_rx_drop=1
29+
2730
# From old config file
2831
os=unix
2932
higig2_hdr_mode=1

device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/td2-a7050-qx32-32x40G.config.bcm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ ipv6_lpm_128b_enable=1
2424
l2_mem_entries=32768
2525
l3_mem_entries=16384
2626

27+
# Disable Counting ACL Drop towards interface RX_DRP counter
28+
sai_adjust_acl_drop_in_rx_drop=1
29+
2730
# From old config file
2831
os=unix
2932
higig2_hdr_mode=1

device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/td2-a7050-q31s4-31x40G-4x10G.config.bcm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ ipv6_lpm_128b_enable=1
44
l2_mem_entries=32768
55
l3_mem_entries=16384
66

7+
# Disable Counting ACL Drop towards interface RX_DRP counter
8+
sai_adjust_acl_drop_in_rx_drop=1
9+
710
# From old config file
811
os=unix
912
higig2_hdr_mode=1
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
echo 1 > /sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/mux

0 commit comments

Comments
 (0)