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 Aug 17, 2022
2 parents 071eb58 + 5846cdd commit e8cc328
Show file tree
Hide file tree
Showing 43 changed files with 223 additions and 910 deletions.
2 changes: 2 additions & 0 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# * ENABLE_ZTP: Enables zero touch provisioning.
# * SHUTDOWN_BGP_ON_START: Sets admin-down state for all bgp peerings after restart.
# * INCLUDE_KUBERNETES: Allows including Kubernetes
# * INCLUDE_KUBERNETES_MASTER: Allows including Kubernetes master
# * INCLUDE_MUX: Include MUX feature/services for TOR switch.
# * ENABLE_PFCWD_ON_START: Enable PFC Watchdog (PFCWD) on server-facing ports
# * by default for TOR switch.
Expand Down Expand Up @@ -366,6 +367,7 @@ SONIC_BUILD_INSTRUCTION := make \
KUBERNETES_VERSION=$(KUBERNETES_VERSION) \
KUBERNETES_CNI_VERSION=$(KUBERNETES_CNI_VERSION) \
K8s_GCR_IO_PAUSE_VERSION=$(K8s_GCR_IO_PAUSE_VERSION) \
INCLUDE_KUBERNETES_MASTER=$(INCLUDE_KUBERNETES_MASTER) \
SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \
SONIC_ENABLE_SYNCD_RPC=$(ENABLE_SYNCD_RPC) \
SONIC_INSTALL_DEBUG_TOOLS=$(INSTALL_DEBUG_TOOLS) \
Expand Down
47 changes: 39 additions & 8 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,24 +253,55 @@ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install docker-ce=${DOCKER_VERSIO
# pip version of 'PyGObject' will be installed during installation of 'sonic-host-services'
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y remove software-properties-common gnupg2 python3-gi

if [ "$INCLUDE_KUBERNETES" == "y" ]
then
## Install Kubernetes
echo '[INFO] Install kubernetes'
install_kubernetes () {
local ver="$1"
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -fsSL \
https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
sudo LANG=C chroot $FILESYSTEM_ROOT apt-key add -
## Check out the sources list update matches current Debian version
sudo cp files/image_config/kubernetes/kubernetes.list $FILESYSTEM_ROOT/etc/apt/sources.list.d/
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get update
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubernetes-cni=${KUBERNETES_CNI_VERSION}-00
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubelet=${KUBERNETES_VERSION}-00
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubectl=${KUBERNETES_VERSION}-00
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubeadm=${KUBERNETES_VERSION}-00
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubelet=${ver}
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubectl=${ver}
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubeadm=${ver}
}

if [ "$INCLUDE_KUBERNETES" == "y" ]
then
## Install Kubernetes
echo '[INFO] Install kubernetes'
install_kubernetes ${KUBERNETES_VERSION}
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubernetes-cni=${KUBERNETES_CNI_VERSION}
else
echo '[INFO] Skipping Install kubernetes'
fi

if [ "$INCLUDE_KUBERNETES_MASTER" == "y" ]
then
## Install Kubernetes master
echo '[INFO] Install kubernetes master'
install_kubernetes ${MASTER_KUBERNETES_VERSION}

sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -fsSL \
https://packages.microsoft.com/keys/microsoft.asc | \
sudo LANG=C chroot $FILESYSTEM_ROOT apt-key add -
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -fsSL \
https://packages.microsoft.com/keys/msopentech.asc | \
sudo LANG=C chroot $FILESYSTEM_ROOT apt-key add -
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azurecore-debian $IMAGE_DISTRO main" | \
sudo tee $FILESYSTEM_ROOT/etc/apt/sources.list.d/azure.list
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get update
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install hyperv-daemons gnupg xmlstarlet
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install metricsext2
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y remove gnupg
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -o /tmp/cri-dockerd.deb -fsSL \
https://github.com/Mirantis/cri-dockerd/releases/download/v${MASTER_CRI_DOCKERD}/cri-dockerd_${MASTER_CRI_DOCKERD}.3-0.debian-${IMAGE_DISTRO}_amd64.deb
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install -f /tmp/cri-dockerd.deb
sudo LANG=C chroot $FILESYSTEM_ROOT rm -f /tmp/cri-dockerd.deb
else
echo '[INFO] Skipping Install kubernetes master'
fi

## Add docker config drop-in to specify dockerd command line
sudo mkdir -p $FILESYSTEM_ROOT/etc/systemd/system/docker.service.d/
## Note: $_ means last argument of last command
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
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@
},
"Ethernet504": {
"default_brkout_mode": "1x800G[400G,200G,100G,50G,40G,25G,10G]"
},
"Ethernet512": {
"default_brkout_mode": "1x25G[10G]"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,4 @@ Ethernet480 480,481,482,483,484,485,486,487 etp61 61
Ethernet488 488,489,490,491,492,493,494,495 etp62 62
Ethernet496 496,497,498,499,500,501,502,503 etp63 63
Ethernet504 504,505,506,507,508,509,510,511 etp64 64
Ethernet512 512 etp65 65
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<issu-enabled>1</issu-enabled>

<!-- Number of ports in the following port list -->
<number-of-physical-ports>64</number-of-physical-ports>
<number-of-physical-ports>65</number-of-physical-ports>

<!-- List of ports in the device -->
<ports-list>
Expand Down Expand Up @@ -306,7 +306,7 @@
<port-info>
<local-port>153</local-port>
<width>8</width>
<module>26</module>
<module>26</module>
<breakout-modes>3</breakout-modes>
<port-speed>1536</port-speed>
</port-info>
Expand Down Expand Up @@ -489,6 +489,13 @@
<breakout-modes>3</breakout-modes>
<port-speed>1536</port-speed>
</port-info>
<port-info>
<local-port>257</local-port>
<width>1</width>
<module>64</module>
<breakout-modes>0</breakout-modes>
<port-speed>64</port-speed>
</port-info>
</ports-list>
</platform_info>
</root>
Expand Down
7 changes: 7 additions & 0 deletions device/mellanox/x86_64-nvidia_sn5600_simx-r0/platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,13 @@
"4x200G[100G,50G,25G,10G]": ["etp64a", "etp64b", "etp64c", "etp64d"],
"8x100G[50G,25G,10G]": ["etp64a", "etp64b", "etp64c", "etp64d", "etp64e", "etp64f", "etp64g", "etp64h"]
}
},
"Ethernet512": {
"index": "65",
"lanes": "512",
"breakout_modes": {
"1x25G[10G]": ["etp65"]
}
}
}
}
21 changes: 21 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,27 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIV
echo "docker images pull complete"
{% endif %}

{% if include_kubernetes_master == "y" %}
# Pull in kubernetes master docker images
echo "pulling kubernetes master images ..."
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS pull k8s.gcr.io/pause:${MASTER_PAUSE_VERSION}
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS pull k8s.gcr.io/kube-apiserver:${MASTER_KUBERNETES_CONTAINER_IMAGE_VERSION}
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS pull k8s.gcr.io/kube-controller-manager:${MASTER_KUBERNETES_CONTAINER_IMAGE_VERSION}
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS pull k8s.gcr.io/kube-scheduler:${MASTER_KUBERNETES_CONTAINER_IMAGE_VERSION}
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS pull k8s.gcr.io/kube-proxy:${MASTER_KUBERNETES_CONTAINER_IMAGE_VERSION}
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS pull k8s.gcr.io/coredns/coredns:${MASTER_COREDNS_VERSION}
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS pull k8s.gcr.io/etcd:${MASTER_ETCD_VERSION}
echo "kubernetes master docker images pull complete"
# Install python package for mdm service usage
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install psutil
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install statsd
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable mdm.service
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable kubelet.service
# Add kubernetes master entrance
sudo cp files/image_config/kubernetes/kubernetes_master_entrance.sh $FILESYSTEM_ROOT/usr/sbin/
sudo sed -i '/^exit 0/i\bash /usr/sbin/kubernetes_master_entrance.sh' $FILESYSTEM_ROOT/etc/rc.local
{% endif %}

{% macro get_install_options(set_owner, enabled) -%}
{% set args = ["-y", "-v", "DEBUG"] -%}
{% if set_owner -%}
Expand Down
2 changes: 2 additions & 0 deletions files/image_config/kubernetes/kubernetes_master_entrance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This script is for kubernetes master image usage
# Will mount kubernetes master disk and execute kubernetes entrance script
6 changes: 5 additions & 1 deletion files/scripts/swss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ LOCKFILE="/tmp/swss-syncd-lock$DEV"
NAMESPACE_PREFIX="asic"
ETC_SONIC_PATH="/etc/sonic/"

DEPENDENT="radv bgp"
# DEPENDENT initially contains namespace independent services
# namespace specific services are added later in this script.
DEPENDENT="radv"
MULTI_INST_DEPENDENT="teamd"

. /usr/local/bin/asic_status.sh
Expand Down Expand Up @@ -309,9 +311,11 @@ function check_peer_gbsyncd()
if [ "$DEV" ]; then
NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace
SONIC_DB_CLI="sonic-db-cli -n $NET_NS"
DEPENDENT+=" bgp@${DEV}"
else
NET_NS=""
SONIC_DB_CLI="sonic-db-cli"
DEPENDENT+=" bgp"
fi

check_peer_gbsyncd
Expand Down
2 changes: 1 addition & 1 deletion files/scripts/syncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function startplatform() {
debug "Starting Firmware update procedure"
/usr/bin/mst start --with_i2cdev
/usr/bin/mlnx-fw-upgrade.sh
/etc/init.d/sxdkernel start
/etc/init.d/sxdkernel restart
debug "Firmware update procedure ended"
fi

Expand Down
4 changes: 2 additions & 2 deletions platform/broadcom/sai.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
LIBSAIBCM_XGS_VERSION = 7.1.0.0-9
LIBSAIBCM_DNX_VERSION = 7.1.0.0-9
LIBSAIBCM_XGS_VERSION = 7.1.7.1
LIBSAIBCM_DNX_VERSION = 7.1.7.1
LIBSAIBCM_BRANCH_NAME = REL_7.0
LIBSAIBCM_XGS_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_XGS_VERSION)"
LIBSAIBCM_DNX_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_DNX_VERSION)"
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
Loading

0 comments on commit e8cc328

Please sign in to comment.