Skip to content

Commit

Permalink
Merge branch 'Azure:master' into support-get_port_or_cage_type
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenxs authored Jul 11, 2022
2 parents 17c5bf2 + e1f2516 commit 7143b5d
Show file tree
Hide file tree
Showing 70 changed files with 2,539 additions and 184 deletions.
6 changes: 6 additions & 0 deletions .azure-pipelines/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
BUILD_OPTIONS: ${{ parameters.buildOptions }}
DOCKER_DATA_ROOT_FOR_MULTIARCH: /data/march/docker
dbg_image: no
asan_image: no
swi_image: no
raw_image: no
docker_syncd_rpc_image: no
Expand All @@ -42,6 +43,7 @@ jobs:
- name: vs
variables:
dbg_image: yes
asan_image: yes

- name: barefoot
variables:
Expand Down Expand Up @@ -106,6 +108,10 @@ jobs:
make $BUILD_OPTIONS INSTALL_DEBUG_TOOLS=y target/sonic-vs.img.gz
mv target/sonic-vs.img.gz target/sonic-vs-dbg.img.gz
fi
if [ $(asan_image) == yes ]; then
make $BUILD_OPTIONS ENABLE_ASAN=y target/docker-sonic-vs.gz
mv target/docker-sonic-vs.gz target/docker-sonic-vs-asan.gz
fi
make $BUILD_OPTIONS target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz
if [ $(Build.Reason) != 'PullRequest' ];then
gzip -kd target/sonic-vs.img.gz
Expand Down
8 changes: 8 additions & 0 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
# * ENABLE_AUTO_TECH_SUPPORT: Enable the configuration for event-driven techsupport & coredump mgmt feature
# * Default: y
# * Values: y,n
# * INCLUDE_BOOTCHART: Install SONiC bootchart
# * Default: y
# * Values: y,n
# * ENABLE_BOOTCHART: Enable SONiC bootchart
# * Default: n
# * Values: y,n
#
###############################################################################

Expand Down Expand Up @@ -381,6 +387,8 @@ SONIC_BUILD_INSTRUCTION := make \
ENABLE_AUTO_TECH_SUPPORT=$(ENABLE_AUTO_TECH_SUPPORT) \
BUILD_MULTIASIC_KVM=$(BUILD_MULTIASIC_KVM) \
ENABLE_ASAN=$(ENABLE_ASAN) \
SONIC_INCLUDE_BOOTCHART=$(INCLUDE_BOOTCHART) \
SONIC_ENABLE_BOOTCHART=$(ENABLE_BOOTCHART) \
ENABLE_FIPS_FEATURE=$(ENABLE_FIPS_FEATURE) \
ENABLE_FIPS=$(ENABLE_FIPS) \
SONIC_SLAVE_DOCKER_DRIVER=$(SONIC_SLAVE_DOCKER_DRIVER) \
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,30 @@
[![P4](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/buildimage-p4-all/badge/icon?subject=P4)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/buildimage-p4-all)
[![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=master&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=master)

*202205 builds*:

[![Barefoot](https://dev.azure.com/mssonic/build/_apis/build/status/barefoot/Azure.sonic-buildimage.official.barefoot?branchName=202205&label=Barefoot)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=146&branchName=202205)
[![Broadcom](https://dev.azure.com/mssonic/build/_apis/build/status/broadcom/Azure.sonic-buildimage.official.broadcom?branchName=202205&label=Broadcom)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=138&branchName=202205)
[![Centec](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec?branchName=202205&label=Centec)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=143&branchName=202205)
[![Centec(arm64)](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec-arm64?branchName=202205&label=Centec-arm64)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=140&branchName=202205)
[![Innovium](https://dev.azure.com/mssonic/build/_apis/build/status/innovium/Azure.sonic-buildimage.official.innovium?branchName=202205&label=Innovium)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=148&branchName=202205)
[![Mellanox](https://dev.azure.com/mssonic/build/_apis/build/status/mellanox/Azure.sonic-buildimage.official.mellanox?branchName=202205&label=Mellanox)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=139&branchName=202205)
[![Marvell(armhf)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-armhf?branchName=202205&label=Marvell-armhf)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=141&branchName=202205)
[![Nephos](https://dev.azure.com/mssonic/build/_apis/build/status/nephos/Azure.sonic-buildimage.official.nephos?branchName=202205&label=Nephos)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=149&branchName=202205)
[![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=202205&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=202205)

*202111 builds*

[![Barefoot](https://dev.azure.com/mssonic/build/_apis/build/status/barefoot/Azure.sonic-buildimage.official.barefoot?branchName=202111&label=Barefoot)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=146&branchName=202111)
[![Broadcom](https://dev.azure.com/mssonic/build/_apis/build/status/broadcom/Azure.sonic-buildimage.official.broadcom?branchName=202111&label=Broadcom)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=138&branchName=202111)
[![Centec](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec?branchName=202111&label=Centec)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=143&branchName=202111)
[![Centec(arm64)](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec-arm64?branchName=202111&label=Centec-arm64)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=140&branchName=202111)
[![Innovium](https://dev.azure.com/mssonic/build/_apis/build/status/innovium/Azure.sonic-buildimage.official.innovium?branchName=202111&label=Innovium)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=148&branchName=202111)
[![Mellanox](https://dev.azure.com/mssonic/build/_apis/build/status/mellanox/Azure.sonic-buildimage.official.mellanox?branchName=202111&label=Mellanox)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=139&branchName=202111)
[![Marvell(armhf)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-armhf?branchName=202111&label=Marvell-armhf)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=141&branchName=202111)
[![Nephos](https://dev.azure.com/mssonic/build/_apis/build/status/nephos/Azure.sonic-buildimage.official.nephos?branchName=202111&label=Nephos)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=149&branchName=202111)
[![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=202111&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=202111)

*202012 builds*:

[![Barefoot](https://dev.azure.com/mssonic/build/_apis/build/status/barefoot/Azure.sonic-buildimage.official.barefoot?branchName=202012&label=Barefoot)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=146&branchName=202012)
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ stages:

- stage: Test
dependsOn: BuildVS
condition: and(ne(stageDependencies.BuildVS.outputs['vs.SetVar.SKIP_VSTEST'], 'YES'), succeeded())
condition: and(ne(stageDependencies.BuildVS.outputs['vs.SetVar.SKIP_VSTEST'], 'YES'), in(dependencies.BuildVS.result, 'Succeeded', 'SucceededWithIssues'))
variables:
- name: inventory
value: veos_vtb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/
l3_alpm_hit_skip=1
sai_adjust_acl_drop_in_rx_drop=1
sai_verify_incoming_chksum=0
{{ map_prio }}
host_as_route_disable=1
use_all_splithorizon_groups=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/
l3_alpm_hit_skip=1
sai_adjust_acl_drop_in_rx_drop=1
sai_verify_incoming_chksum=0
{{ map_prio }}
host_as_route_disable=1
use_all_splithorizon_groups=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ system_headers_mode=1
suppress_unknown_prop_warnings=1
l4_protocols_load_balancing_enable=1
fabric_logical_port_base=512
trunk_group_max_members=128
trunk_group_max_members=16
num_olp_tm_ports.BCM8869X=1

# nif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ pmf_sexem3_stage=IPMF2
# Jericho2-mode (description 0x1 used for Jericho 2 mode)
system_headers_mode=1

# HW mode to support 1024 16-member system wide LAGs
trunk_group_max_members=16

# Disable link-training
port_init_cl72=0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ pmf_sexem3_stage=IPMF2
# Jericho2-mode (description 0x1 used for Jericho 2 mode)
system_headers_mode=1

# HW mode to support 1024 16-member system wide LAGs
trunk_group_max_members=16

# Disable link-training
port_init_cl72=0

Expand Down
1 change: 1 addition & 0 deletions device/arista/x86_64-arista_7800r3a_36d2_lc/default_sku
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Arista-7800R3A-36D2-C72 t1
Empty file.
10 changes: 5 additions & 5 deletions dockers/docker-database/flush_unused_database
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/python3
import swsssdk
from swsscommon import swsscommon
import redis
import subprocess
import time
Expand All @@ -11,15 +11,15 @@ while(True):
break
time.sleep(1)

instlists = swsssdk.SonicDBConfig.get_instancelist()
instlists = swsscommon.SonicDBConfig.get_instancelist()
for instname, v in instlists.items():
insthost = v['hostname']
instsocket = v['unix_socket_path']

dblists = swsssdk.SonicDBConfig.get_dblist()
dblists = swsscommon.SonicDBConfig.get_dblist()
for dbname in dblists:
dbid = swsssdk.SonicDBConfig.get_dbid(dbname)
dbinst = swsssdk.SonicDBConfig.get_instancename(dbname)
dbid = swsscommon.SonicDBConfig.get_dbid(dbname)
dbinst = swsscommon.SonicDBConfig.get_instancename(dbname)

# this DB is on current instance, skip flush
if dbinst == instname:
Expand Down
6 changes: 3 additions & 3 deletions dockers/docker-orchagent/enable_counters.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

import time
import swsssdk
from swsscommon import swsscommon

# ALPHA defines the size of the window over which we calculate the average value. ALPHA is 2/(N+1) where N is the interval(window size)
# In this case we configure the window to be 10s. This way if we have a huge 1s spike in traffic,
Expand All @@ -23,7 +23,7 @@ def enable_counter_group(db, name):

def enable_rates():
# set the default interval for rates
counters_db = swsssdk.SonicV2Connector()
counters_db = swsscommon.SonicV2Connector()
counters_db.connect('COUNTERS_DB')
counters_db.set('COUNTERS_DB', 'RATES:PORT', 'PORT_SMOOTH_INTERVAL', DEFAULT_SMOOTH_INTERVAL)
counters_db.set('COUNTERS_DB', 'RATES:PORT', 'PORT_ALPHA', DEFAULT_ALPHA)
Expand All @@ -36,7 +36,7 @@ def enable_rates():


def enable_counters():
db = swsssdk.ConfigDBConnector()
db = swsscommon.ConfigDBConnector()
db.connect()
default_enabled_counters = ['PORT', 'RIF', 'QUEUE', 'PFCWD', 'PG_WATERMARK', 'PG_DROP',
'QUEUE_WATERMARK', 'BUFFER_POOL_WATERMARK', 'PORT_BUFFER_DROP', 'ACL']
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-orchagent/tunnel_packet_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from datetime import datetime
from ipaddress import ip_interface

from swsssdk import ConfigDBConnector, SonicV2Connector
from swsscommon.swsscommon import ConfigDBConnector, SonicV2Connector
from sonic_py_common import logger as log

from pyroute2 import IPRoute
Expand Down
4 changes: 2 additions & 2 deletions dockers/docker-sflow/port_index_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import traceback
from sonic_py_common.logger import Logger
from socket import if_nametoindex
from swsssdk import SonicV2Connector, port_util
from sonic_py_common import port_util
from swsscommon import swsscommon

SYSLOG_IDENTIFIER = 'port_index_mapper'
Expand All @@ -26,7 +26,7 @@ def __init__(self):
REDIS_TIMEOUT_MS,
True)

self.state_db = SonicV2Connector(host='127.0.0.1', decode_responses=True)
self.state_db = swsscommon.SonicV2Connector(host='127.0.0.1', decode_responses=True)
self.state_db.connect(self.state_db.STATE_DB, False)
self.sel = swsscommon.Select()
self.tbls = [swsscommon.SubscriberStateTable(self.appl_db, t)
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-snmp/snmp_yml_to_configdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import yaml
from sonic_py_common.logger import Logger
from swsssdk import ConfigDBConnector
from swsscommon.swsscommon import ConfigDBConnector

db = ConfigDBConnector()
db.connect()
Expand Down
8 changes: 4 additions & 4 deletions dockers/docker-sonic-mgmt/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN pip install cffi==1.10.0 \
ipython==5.4.1 \
ixnetwork-restpy==1.0.64 \
ixnetwork-open-traffic-generator==0.0.79 \
snappi[ixnetwork,convergence]==0.5.11 \
snappi[ixnetwork,convergence]==0.7.44 \
jinja2==2.7.2 \
jsonpatch \
lxml \
Expand Down Expand Up @@ -71,7 +71,7 @@ RUN pip install cffi==1.10.0 \
six \
tabulate \
statistics \
textfsm \
textfsm==1.1.2 \
virtualenv \
retry \
thrift==0.11.0 \
Expand Down Expand Up @@ -207,7 +207,7 @@ RUN python3 -m pip install setuptools-rust \
ipython==5.4.1 \
ixnetwork-restpy==1.0.64 \
ixnetwork-open-traffic-generator==0.0.79 \
snappi[ixnetwork,convergence]==0.5.11 \
snappi[ixnetwork,convergence]==0.7.44 \
jinja2==2.7.2 \
jsonpatch \
lxml \
Expand All @@ -233,7 +233,7 @@ RUN python3 -m pip install setuptools-rust \
rpyc \
six \
tabulate \
textfsm \
textfsm==1.1.2 \
virtualenv \
wheel==0.33.6 \
pysubnettree \
Expand Down
51 changes: 51 additions & 0 deletions files/build_templates/backend_acl.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{%- set vlan2ports = {} %}
{%- for vlan in VLAN %}
{% set portlist = [] %}
{%- for vlan_name, port in VLAN_MEMBER %}
{%- if vlan_name == vlan %}
{%- if portlist.append(port) %}{%- endif %}
{%- endif %}
{%- endfor %}
{%- set _ = vlan2ports.update({vlan: portlist| sort | join(',')}) %}
{%- endfor %}


{
"acl": {
"acl-sets": {
"acl-set": {
"DATAACL": {
"acl-entries": {
"acl-entry": {
{% for vlan, vlan_entries in VLAN.items() %}
"{{ loop.index }}": {
"config": {
"sequence-id": {{ loop.index }}
},
"actions": {
"config": {
"forwarding-action": "ACCEPT"
}
},
"l2": {
"config": {
"vlan_id": "{{ vlan_entries['vlanid'] }}"
}
},
"input_interface": {
"interface_ref": {
"config": {
"interface": "{{ vlan2ports[vlan] }}"
}
}
}

}{% if not loop.last %},{% endif %}
{% endfor -%}
}
}
}
}
}
}
}
15 changes: 15 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,18 @@ sudo chmod og-rw $FILESYSTEM_ROOT_ETC_SONIC/core_analyzer.rc.json

sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install libffi-dev libssl-dev

{% if include_bootchart == 'y' %}
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install systemd-bootchart
sudo tee $FILESYSTEM_ROOT_ETC/systemd/bootchart.conf > /dev/null <<EOF
[Bootchart]
Samples=4500
Frequency=25
EOF
{% if enable_bootchart == 'y' %}
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable systemd-bootchart
{% endif %}
{% endif %}

if [[ $CONFIGURED_ARCH == armhf ]]; then
# The azure-storage package depends on the cryptography package. Newer
# versions of cryptography require the rust compiler, the correct version
Expand Down Expand Up @@ -524,6 +536,9 @@ then
fi
{% endif %}

# Copy backend acl template
sudo cp $BUILD_TEMPLATES/backend_acl.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/

# Copy hostname configuration scripts
sudo cp $IMAGE_CONFIGS/hostname/hostname-config.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
echo "hostname-config.service" | sudo tee -a $GENERATED_SERVICE_FILE
Expand Down
2 changes: 1 addition & 1 deletion platform/centec-arm64/sai.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export CENTEC_SAI = libsai_$(CENTEC_SAI_VERSION)_$(PLATFORM_ARCH).deb
export CENTEC_SAI_DEV = libsai-dev_$(CENTEC_SAI_VERSION)_$(PLATFORM_ARCH).deb

$(CENTEC_SAI)_URL = https://github.com/CentecNetworks/sonic-binaries/raw/master/$(PLATFORM_ARCH)/sai/$(CENTEC_SAI)
$(CENTEC_SAI)_DEV_URL = https://github.com/CentecNetworks/sonic-binaries/raw/master/$(PLATFORM_ARCH)/sai/$(CENTEC_SAI_DEV)
$(CENTEC_SAI_DEV)_URL = https://github.com/CentecNetworks/sonic-binaries/raw/master/$(PLATFORM_ARCH)/sai/$(CENTEC_SAI_DEV)
$(eval $(call add_conflict_package,$(CENTEC_SAI_DEV),$(LIBSAIVS_DEV)))

SONIC_ONLINE_DEBS += $(CENTEC_SAI)
Expand Down
3 changes: 3 additions & 0 deletions platform/centec-arm64/tsingma-bsp/src/ctc-phy/mars.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,6 @@ static struct mdio_device_id __maybe_unused mars_tbl[] = {
};

MODULE_DEVICE_TABLE(mdio, mars_tbl);

MODULE_AUTHOR("Centec, Inc.");
MODULE_LICENSE("GPL");
5 changes: 5 additions & 0 deletions platform/centec-arm64/tsingma-bsp/src/i2c-ctc/i2c-ctc.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,11 @@ static int ctc_i2c_plat_probe(struct platform_device *pdev)
of_property_read_u32(pdev->dev.of_node, "clock-frequency", &clk_freq);

dev->clk_freq = clk_freq;

dev->functionality = I2C_FUNC_10BIT_ADDR | CTC_IC_DEFAULT_FUNCTIONALITY;
dev->master_cfg = CTC_IC_CON_MASTER | CTC_IC_CON_SLAVE_DISABLE |
CTC_IC_CON_RESTART_EN;

if (dev->clk_freq <= 100000)
dev->master_cfg |= CTC_IC_CON_SPEED_STD;
else if (dev->clk_freq <= 400000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def get_presence(self):

try:
with open(self.port_to_eeprom_mapping[self.port_num], mode='rb', buffering=0) as fd:
fd.read()
fd.read(256)
except IOError:
return False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def get_presence(self):

try:
with open(self.port_to_eeprom_mapping[self.port_num], mode='rb', buffering=0) as fd:
fd.read()
fd.read(256)
except IOError:
return False

Expand Down
Loading

0 comments on commit 7143b5d

Please sign in to comment.