Skip to content

Commit

Permalink
Merge branch 'submodule_update' of https://github.com/vivekreddynv/so…
Browse files Browse the repository at this point in the history
…nic-buildimage into submodule_update
  • Loading branch information
vivekrnv committed Dec 6, 2021
2 parents 32c89b0 + 01444df commit 98fbebb
Show file tree
Hide file tree
Showing 17 changed files with 774 additions and 28 deletions.
5 changes: 4 additions & 1 deletion files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ function updateSyslogConf()
TARGET_IP=$(docker network inspect bridge --format={{ "'{{(index .IPAM.Config 0).Gateway}}'" }})
CONTAINER_NAME="$DOCKERNAME"
TMP_FILE="/tmp/rsyslog.$CONTAINER_NAME.conf"

{%- if docker_container_name == "database" %}
python -c "import jinja2, os; paths=['/usr/share/sonic/templates']; loader = jinja2.FileSystemLoader(paths); env = jinja2.Environment(loader=loader, trim_blocks=True); template_file='/usr/share/sonic/templates/rsyslog-container.conf.j2'; template = env.get_template(os.path.basename(template_file)); data=template.render({\"target_ip\":\"$TARGET_IP\",\"container_name\":\"$CONTAINER_NAME\"}); print(data)" > $TMP_FILE
{%- else %}
sonic-cfggen -t /usr/share/sonic/templates/rsyslog-container.conf.j2 -a "{\"target_ip\": \"$TARGET_IP\", \"container_name\": \"$CONTAINER_NAME\" }" > $TMP_FILE
{%- endif %}
docker cp $TMP_FILE ${DOCKERNAME}:/etc/rsyslog.conf
rm -rf $TMP_FILE
fi
Expand Down
16 changes: 10 additions & 6 deletions platform/broadcom/sai.mk
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
BRCM_SAI = libsaibcm_6.0.0.10-1_amd64.deb
$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/6.0/master/XGS/libsaibcm_6.0.0.10-1_amd64.deb?sv=2015-04-05&sr=b&sig=5fW6otWPCPrsSIXeomEcllS8sEDXMo0YOD8UhB370U0%3D&se=2035-07-22T20%3A50%3A51Z&sp=r"
BRCM_SAI_DEV = libsaibcm-dev_6.0.0.10-1_amd64.deb
LIBSAIBCM_VERSION = 6.0.0.10-1
LIBSAIBCM_BRANCH_NAME = REL_6.0
LIBSAIBCM_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_VERSION)"

BRCM_SAI = libsaibcm_$(LIBSAIBCM_VERSION)_amd64.deb
$(BRCM_SAI)_URL = "$(LIBSAIBCM_URL_PREFIX)/$(BRCM_SAI)"
BRCM_SAI_DEV = libsaibcm-dev_$(LIBSAIBCM_VERSION)_amd64.deb
$(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV)))
$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/6.0/master/XGS/libsaibcm-dev_6.0.0.10-1_amd64.deb?sv=2015-04-05&sr=b&sig=8h7bO9EizzMXduSOf%2Ffc3JH0EcHxcE8p51LyUw0CA6o%3D&se=2035-07-22T20%3A51%3A57Z&sp=r"
$(BRCM_SAI_DEV)_URL = "$(LIBSAIBCM_URL_PREFIX)/$(BRCM_SAI_DEV)"

# SAI module for DNX Asic family
BRCM_DNX_SAI = libsaibcm_dnx_6.0.0.10-1_amd64.deb
$(BRCM_DNX_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/6.0/master/DNX/libsaibcm_dnx_6.0.0.10-1_amd64.deb?sv=2015-04-05&sr=b&sig=J1lE1SI1Mtwrl0vZ2tAPvkNLKpkyz2XVgRe98DnPNfo%3D&se=2035-07-22T20%3A53%3A24Z&sp=r"
BRCM_DNX_SAI = libsaibcm_dnx_$(LIBSAIBCM_VERSION)_amd64.deb
$(BRCM_DNX_SAI)_URL = "$(LIBSAIBCM_URL_PREFIX)/$(BRCM_DNX_SAI)"

SONIC_ONLINE_DEBS += $(BRCM_SAI)
SONIC_ONLINE_DEBS += $(BRCM_DNX_SAI)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
except ImportError as err:
raise ImportError(str(err) + "- required module not found")

QSFP_DD_MODULE_ENC_OFFSET = 3
QSFP_DD_MODULE_ENC_WIDTH = 1
QSFP_INFO_OFFSET = 128
SFP_INFO_OFFSET = 0
QSFP_DD_PAGE0 = 0
Expand Down Expand Up @@ -205,11 +203,7 @@ def get_lpmode(self):
lpmode_state = False
try:
if self.sfp_type == 'QSFP_DD':
lpmode = self.read_eeprom(QSFP_DD_MODULE_ENC_OFFSET, QSFP_DD_MODULE_ENC_WIDTH)
if lpmode is not None:
if int(lpmode[0])>>1 == 1:
return True
return False
return SfpOptoeBase.get_lpmode(self)
else:
# Port offset starts with 0x4000
port_offset = 16384 + ((self.index-1) * 16)
Expand Down Expand Up @@ -265,12 +259,7 @@ def set_lpmode(self, lpmode):
"""
try:
if self.sfp_type == 'QSFP_DD':
if lpmode is True:
write_val = 0x10
else:
write_val = 0x0

self.write_eeprom(26, 1, bytearray([write_val]))
return SfpOptoeBase.set_lpmode(self, lpmode)
else:
# Port offset starts with 0x4000
port_offset = 16384 + ((self.index-1) * 16)
Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/hw-management.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
# Mellanox HW Management

MLNX_HW_MANAGEMENT_VERSION = 7i.0010.3330
MLNX_HW_MANAGEMENT_VERSION = 7.0010.3331

export MLNX_HW_MANAGEMENT_VERSION

Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/hw-management/hw-mgmt
2 changes: 2 additions & 0 deletions rules/swss-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ $(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(LIBSWSSCOMMON_DEV)))
ifeq ($(ENABLE_PY2_MODULES), y)
PYTHON_SWSSCOMMON = python-swsscommon_$(LIBSWSSCOMMON_VERSION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(PYTHON_SWSSCOMMON)))
else
$(LIBSWSSCOMMON)_BUILD_ENV += DEB_BUILD_PROFILES=nopython2
endif

PYTHON3_SWSSCOMMON = python3-swsscommon_$(LIBSWSSCOMMON_VERSION)_$(CONFIGURED_ARCH).deb
Expand Down
8 changes: 4 additions & 4 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1008,10 +1008,10 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
export lazy_installer_debs="$(foreach deb, $($*_LAZY_INSTALLS),$(foreach device, $($(deb)_PLATFORM),$(addprefix $(device)@, $(IMAGE_DISTRO_DEBS_PATH)/$(deb))))"
export lazy_build_installer_debs="$(foreach deb, $($*_LAZY_BUILD_INSTALLS), $(addprefix $($(deb)_MACHINE)|,$(deb)))"
export installer_images="$(foreach docker, $($*_DOCKERS),\
$(addprefix $($(docker)_PACKAGE_NAME)|,\
$(addprefix $($(docker)_PATH)|,\
$(addprefix $($(docker)_MACHINE)|,\
$(addprefix $(TARGET_PATH)/,$(addsuffix :$($(docker)_VERSION),$(docker)))))))"
$(addprefix $($(docker:-dbg.gz=.gz)_PACKAGE_NAME)|,\
$(addprefix $($(docker:-dbg.gz=.gz)_PATH)|,\
$(addprefix $($(docker:-dbg.gz=.gz)_MACHINE)|,\
$(addprefix $(TARGET_PATH)/,$(addsuffix :$($(docker:-dbg.gz=.gz)_VERSION),$(docker)))))))"
export sonic_packages="$(foreach package, $(SONIC_PACKAGES),\
$(addsuffix |$($(package)_DEFAULT_FEATURE_STATE_ENABLED),\
$(addsuffix |$($(package)_DEFAULT_FEATURE_OWNER),\
Expand Down
17 changes: 17 additions & 0 deletions src/sonic-build-hooks/scripts/buildinfo_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ POST_VERSION_PATH=$BUILDINFO_PATH/post-versions
VERSION_DEB_PREFERENCE=$BUILDINFO_PATH/versions/01-versions-deb
WEB_VERSION_FILE=$VERSION_PATH/versions-web
BUILD_WEB_VERSION_FILE=$BUILD_VERSION_PATH/versions-web
REPR_MIRROR_URL_PATTERN='http:\/\/packages.trafficmanager.net\/debian'

. $BUILDINFO_PATH/config/buildinfo.config

Expand Down Expand Up @@ -59,6 +60,22 @@ check_if_url_exist()
fi
}

# Enable or disable the reproducible mirrors
set_reproducible_mirrors()
{
# Remove the charater # in front of the line if matched
local expression="s/^#\(.*$REPR_MIRROR_URL_PATTERN\)/\1/"
if [ "$1" = "-d" ]; then
# Add the charater # in front of the line if match
expression="s/^deb.*$REPR_MIRROR_URL_PATTERN/#\0/"
fi

local mirrors="/etc/apt/sources.list $(ls /etc/apt/sources.list.d/)"
for mirror in $mirrors; do
sed -i "$expression" "$mirror"
done
}

download_packages()
{
local parameters=("$@")
Expand Down
1 change: 1 addition & 0 deletions src/sonic-build-hooks/scripts/post_run_buildinfo
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ rm -rf $BUILD_VERSION_PATH/*

# Disable the build hooks
symlink_build_hooks -d
set_reproducible_mirrors -d
1 change: 1 addition & 0 deletions src/sonic-build-hooks/scripts/pre_run_buildinfo
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mkdir -p $LOG_PATH
[ -d $PRE_VERSION_PATH ] && rm -rf $PRE_VERSION_PATH
collect_version_files $PRE_VERSION_PATH
symlink_build_hooks
set_reproducible_mirrors

chmod -R a+rw $BUILDINFO_PATH

Expand Down
2 changes: 1 addition & 1 deletion src/sonic-platform-common
2 changes: 1 addition & 1 deletion src/sonic-swss-common
1 change: 1 addition & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def run(self):
'./yang-models/sonic-mgmt_interface.yang',
'./yang-models/sonic-mgmt_port.yang',
'./yang-models/sonic-mgmt_vrf.yang',
'./yang-models/sonic-mirror-session.yang',
'./yang-models/sonic-ntp.yang',
'./yang-models/sonic-nat.yang',
'./yang-models/sonic-pbh.yang',
Expand Down
21 changes: 21 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,27 @@
"pfc_to_pg_map" : "pfc_prio_to_pg_map2",
"pfc_enable" : "3,4"
}
},

"MIRROR_SESSION": {
"erspan": {
"dscp": "10",
"dst_ip": "11.1.1.1",
"gre_type": "0x1234",
"queue": "0",
"src_ip": "10.1.1.1",
"ttl": "10",
"type": "ERSPAN"
},
"span": {
"direction": "RX",
"type": "SPAN",
"dst_port": "Ethernet2",
"src_port": [
"Ethernet3",
"Ethernet4"
]
}
}
},
"SAMPLE_CONFIG_DB_UNKNOWN": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"MIRROR_ERSPAN_ENTRY_WITH_VALID_VALUES": {
"desc": "Configuring ERSPAN entry with valid values."
},
"MIRROR_ERSPAN_ENTRY_WRONG_TYPE": {
"desc": "Configurinng ERSPAN entry with invalid type",
"eStrKey": "InvalidValue"
},
"MIRROR_ERSPAN_ENTRY_WRONG_DST_IP": {
"desc": "Configurinng ERSPAN entry with invalid dst_ip",
"eStrKey" : "Pattern"
},
"MIRROR_ERSPAN_ENTRY_WRONG_DST_IP_TYPE": {
"desc": "Configurinng ERSPAN entry with invalid dst_ip",
"eStrKey" : "When"
},
"MIRROR_ERSPAN_ENTRY_WRONG_SRC_IP": {
"desc": "Configurinng ERSPAN entry with invalid src_ip",
"eStrKey" : "Pattern"
},
"MIRROR_ERSPAN_ENTRY_WRONG_SRC_IP_TYPE": {
"desc": "Configurinng ERSPAN entry with invalid src_ip",
"eStrKey" : "When"
},
"MIRROR_ERSPAN_ENTRY_WRONG_GRE_TYPE": {
"desc": "Configurinng ERSPAN entry with invalid GRE type",
"eStrKey" : "Pattern"
},
"MIRROR_ERSPAN_ENTRY_GRE_WRONG_TYPE": {
"desc": "Configurinng ERSPAN entry with invalid GRE type",
"eStrKey" : "When"
},
"MIRROR_ERSPAN_ENTRY_WRONG_DSCP": {
"desc": "Configurinng ERSPAN entry with invalid dscp",
"eStr" : "Invalid dscp value"
},
"MIRROR_ERSPAN_ENTRY_WRONG_DSCP_TYPE": {
"desc": "Configurinng ERSPAN entry with invalid dscp",
"eStrKey" : "When"
},
"MIRROR_ERSPAN_ENTRY_WRONG_TTL": {
"desc": "Configurinng ERSPAN entry with invalid ttl",
"eStr": "Invalid TTL value"
},
"MIRROR_ERSPAN_ENTRY_WRONG_TTL_TYPE": {
"desc": "Configurinng ERSPAN entry with invalid ttl",
"eStrKey" : "When"
},
"MIRROR_ERSPAN_ENTRY_VALID_SRC_PORT": {
"desc": "Configurinng ERSPAN entry with valid source port"
},
"MIRROR_ERSPAN_ENTRY_VALID_SRC_PORTCHANNEL": {
"desc": "Configurinng ERSPAN entry with valid source portchannel"
},
"MIRROR_ERSPAN_ENTRY_INVALID_SRC_PORT": {
"desc": "Configurinng ERSPAN entry with invalid source port",
"eStrKey" : "InvalidValue"
},
"MIRROR_SPAN_ENTRY_WITH_VALID_VALUES": {
"desc": "Configurinng SPAN entry with valid source and destination ports"
},
"MIRROR_SPAN_ENTRY_INVALID_DST_PORT": {
"desc": "Configurinng SPAN entry with invalid destination ports",
"eStrKey" : "InvalidValue"
},
"MIRROR_SPAN_ENTRY_INVALID_DST_PORT_TYPE": {
"desc": "Configurinng SPAN entry with invalid destination ports",
"eStrKey" : "When"
},
"MIRROR_SPAN_ENTRY_VALID_DST_PORT_CPU": {
"desc": "Configurinng SPAN entry with valid destination port CPU"
},
"MIRROR_SPAN_ENTRY_INVALID_SRC_PORT": {
"desc": "Configurinng SPAN entry with invalid destination ports",
"eStrKey" : "InvalidValue"
},
"MIRROR_SPAN_ENTRY_INVALID_DIRECTION": {
"desc": "Configurinng SPAN entry with invalid direction",
"eStrKey": "InvalidValue"
}
}
Loading

0 comments on commit 98fbebb

Please sign in to comment.