Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
abdosi committed Aug 19, 2022
2 parents d49e1f0 + 9753f28 commit dad01cb
Show file tree
Hide file tree
Showing 43 changed files with 420 additions and 982 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

# Description

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)
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/sonic-net/SONiC/wiki/Supported-Devices-and-Platforms)

# Hardware

Expand All @@ -97,6 +97,8 @@ Any server can be a build image server as long as it has:
* Multiple cores to increase build speed
* Plenty of RAM (less than 8 GiB is likely to cause issues)
* 300G of free disk space
* KVM Virtualization Support.
> Note: If you are in a VM, make sure you have support for nested virtualization.
A good choice of OS for building SONiC is currently Ubuntu 20.04.

Expand All @@ -116,7 +118,7 @@ sudo pip3 install j2cli
## Clone or fetch the code repository with all git submodules
To clone the code repository recursively, assuming git version 1.9 or newer:

git clone https://github.com/Azure/sonic-buildimage.git
git clone https://github.com/sonic-net/sonic-buildimage.git

## Usage

Expand Down Expand Up @@ -151,7 +153,6 @@ To build SONiC installer image and docker images, run the following commands:
- PLATFORM=centec
- PLATFORM=nephos
- PLATFORM=innovium
- PLATFORM=p4
- PLATFORM=vs

## Usage for ARM Architecture
Expand Down Expand Up @@ -238,10 +239,10 @@ Every target has a clean target, so in order to clean swss, execute:
It is recommended to use clean targets to clean all packages that are built together, like dev packages for instance. In order to be more familiar with build process and make some changes to it, it is recommended to read this short [Documentation](README.buildsystem.md).

## 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).
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/sonic-net/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.
Please refer to [SONiC roadmap](https://github.com/sonic-net/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.
Expand All @@ -263,11 +264,11 @@ This may take a while, but it is a one-time action, so please be patient.
- docker-syncd-invm.gz: docker image for the daemon to sync database and Innovium switch ASIC (gzip tar archive)
- docker-sonic-p4.gz: docker image for all-in-one for p4 software switch (gzip tar archive)
- docker-sonic-vs.gz: docker image for all-in-one for software virtual switch (gzip tar archive)
- docker-sonic-mgmt.gz: docker image for [managing, configuring and monitoring SONiC](https://github.com/Azure/sonic-mgmt) (gzip tar archive)
- docker-sonic-mgmt.gz: docker image for [managing, configuring and monitoring SONiC](https://github.com/sonic-net/sonic-mgmt) (gzip tar archive)

## Contribution Guide

All contributors must sign a contribution license agreement before contributions can be accepted. Contact [[email protected]](mailto:[email protected]).
All contributors must sign a contribution license agreement before contributions can be accepted. Visit [EasyCLA - Linux Foundation](https://easycla.lfx.linuxfoundation.org).

## GitHub Workflow

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"ports": [
{
"index": 22,
"index": 23,
"mdio_addr": "",
"system_speed": 1000,
"system_fec": "none",
Expand Down
2 changes: 1 addition & 1 deletion device/celestica/x86_64-cel_belgite-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONSOLE_PORT=0x3f8
CONSOLE_DEV=0
CONSOLE_SPEED=9600
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="intel_iommu=off module_blacklist=gpio_ich crashkernel=0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M acpi_no_watchdog"
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="intel_iommu=off modprobe.blacklist=gpio_ich,i2c-ismt,i2c_ismt,i2c-i801,i2c_i801 crashkernel=0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M acpi_no_watchdog"
2 changes: 1 addition & 1 deletion dockers/docker-snmp/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python3_wheels, copy_files %}
FROM docker-config-engine-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name
ARG image_version
Expand Down
21 changes: 12 additions & 9 deletions files/scripts/gbsyncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
. /usr/local/bin/syncd_common.sh

function startplatform() {
# Add gbsyncd to FEATURE table, if not in. It did have same config as syncd.
if [ -z $($SONIC_DB_CLI CONFIG_DB HGET 'FEATURE|gbsyncd' state) ]; then
local CMD="local r=redis.call('DUMP', KEYS[1]); redis.call('RESTORE', KEYS[2], 0, r)"
$SONIC_DB_CLI CONFIG_DB EVAL "$CMD" 2 'FEATURE|syncd' 'FEATURE|gbsyncd'
fi

declare -a DbCliArray=($SONIC_DB_CLI $SONIC_DB_NS_CLI)
for DB_CLI in ${DbCliArray[@]}; do
# Add gbsyncd to FEATURE table, if not in. It did have same config as syncd.
if [ -z $($DB_CLI CONFIG_DB HGET 'FEATURE|gbsyncd' state) ]; then
local CMD="local r=redis.call('DUMP', KEYS[1]); redis.call('RESTORE', KEYS[2], 0, r)"
$DB_CLI CONFIG_DB EVAL "$CMD" 2 'FEATURE|syncd' 'FEATURE|gbsyncd'
fi
done
}

function waitplatform() {
Expand All @@ -30,12 +34,11 @@ PEER="swss"
DEBUGLOG="/tmp/swss-$SERVICE-debug$DEV.log"
LOCKFILE="/tmp/swss-$SERVICE-lock$DEV"
NAMESPACE_PREFIX="asic"
SONIC_DB_CLI="sonic-db-cli"
SONIC_DB_NS_CLI="sonic-db-cli"
if [ "$DEV" ]; then
NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace
SONIC_DB_CLI="sonic-db-cli -n $NET_NS"
else
NET_NS=""
SONIC_DB_CLI="sonic-db-cli"
SONIC_DB_NS_CLI="sonic-db-cli -n $NET_NS"
fi

case "$1" in
Expand Down
2 changes: 1 addition & 1 deletion platform/broadcom/platform-modules-cel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export CEL_BELGITE_PLATFORM_MODULE_VERSION

CEL_DX010_PLATFORM_MODULE = platform-modules-dx010_$(CEL_DX010_PLATFORM_MODULE_VERSION)_amd64.deb
$(CEL_DX010_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-cel
$(CEL_DX010_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(CEL_DX010_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) $(PDDF_PLATFORM_MODULE_SYM)
$(CEL_DX010_PLATFORM_MODULE)_PLATFORM = x86_64-cel_seastone-r0
SONIC_DPKG_DEBS += $(CEL_DX010_PLATFORM_MODULE)

Expand Down
2 changes: 1 addition & 1 deletion platform/broadcom/saibcm-modules-dnx
11 changes: 4 additions & 7 deletions platform/broadcom/saibcm-modules/debian/opennsl-modules.init
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,14 @@ function create_devices()
function load_kernel_modules()
{
if [[ $is_ltsw_chip -eq 1 ]]; then
insmod /lib/modules/$(uname -r)/extra/psample.ko
modprobe psample
modprobe linux_ngbde
modprobe linux_ngknet
modprobe linux_ngknetcb
else
modprobe linux-kernel-bde dmasize=$dmasize maxpayload=128 debug=4 dma_debug=1 usemsi=$usemsi
modprobe linux-user-bde

# Using insmod with absolute path for psample to make sure bcm psample is loaded.
# There is a different psample.ko module getting created at net/psample/psample.ko
insmod /lib/modules/$(uname -r)/extra/psample.ko
modprobe psample

modprobe linux-bcm-knet use_rx_skb=1 rx_buffer_size=9238 debug=0x5020 default_mtu=9100
modprobe linux-knet-cb
Expand All @@ -69,9 +66,9 @@ function remove_kernel_modules()
rmmod linux_ngknetcb
rmmod linux_ngknet
rmmod linux_ngbde
rmmod psample.ko
rmmod psample
else
rmmod psample.ko
rmmod psample
rmmod linux-knet-cb
rmmod linux-bcm-knet
rmmod linux-user-bde
Expand Down
17 changes: 2 additions & 15 deletions platform/broadcom/saibcm-modules/sdklt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ export CROSS_COMPILE

override SDK := $(CURDIR)

ifeq ($(BUILD_PSAMPLE),1)
PSAMPLE=psample
PSAMPLE_SYMVERS=$(SDK)/linux/psample/Module.symvers
endif

kmod: bde knet knetcb $(PSAMPLE)
kmod: bde knet knetcb

bde:
$(MAKE) -C $(SDK)/linux/bde SDK=$(SDK) \
Expand All @@ -62,20 +57,12 @@ knet: bde
$(TARGET)
ln -sf $(SDK)/linux/knet/*.ko

knetcb: knet $(PSAMPLE)
knetcb: knet
$(MAKE) -C $(SDK)/linux/knetcb SDK=$(SDK) \
KBUILD_EXTRA_SYMBOLS=$(SDK)/linux/knet/Module.symvers \
KBUILD_EXTRA_SYMBOLS+=$(PSAMPLE_SYMVERS) \
$(TARGET)
ln -sf $(SDK)/linux/knetcb/*.ko

ifeq ($(BUILD_PSAMPLE),1)
$(PSAMPLE):
$(MAKE) -C $(SDK)/linux/psample SDK=$(SDK) \
$(TARGET)
ln -sf $(SDK)/linux/psample/*.ko
endif

clean:
$(MAKE) kmod TARGET=clean
rm -f *.ko
Expand Down
24 changes: 0 additions & 24 deletions platform/broadcom/saibcm-modules/sdklt/linux/include/net/psample.h

This file was deleted.

This file was deleted.

10 changes: 6 additions & 4 deletions platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ psample_task(struct work_struct *work)
unsigned long flags;
struct list_head *list_ptr, *list_next;
psample_pkt_t *pkt;
struct psample_metadata md = {0};

spin_lock_irqsave(&psample_work->lock, flags);
list_for_each_safe(list_ptr, list_next, &psample_work->pkt_list) {
Expand All @@ -267,12 +268,13 @@ psample_task(struct work_struct *work)
pkt->meta.trunc_size, pkt->meta.src_ifindex,
pkt->meta.dst_ifindex, pkt->meta.sample_rate);

md.trunc_size = pkt->meta.trunc_size;
md.in_ifindex = pkt->meta.src_ifindex;
md.out_ifindex = pkt->meta.dst_ifindex;
psample_sample_packet(pkt->group,
pkt->skb,
pkt->meta.trunc_size,
pkt->meta.src_ifindex,
pkt->meta.dst_ifindex,
pkt->meta.sample_rate);
pkt->meta.sample_rate,
&md);
g_psample_stats.pkts_f_psample_mod++;

dev_kfree_skb_any(pkt->skb);
Expand Down
18 changes: 0 additions & 18 deletions platform/broadcom/saibcm-modules/sdklt/linux/psample/Kbuild

This file was deleted.

21 changes: 0 additions & 21 deletions platform/broadcom/saibcm-modules/sdklt/linux/psample/Makefile

This file was deleted.

Loading

0 comments on commit dad01cb

Please sign in to comment.