Update 201803 branch with masters of sonic-swss, sonic-sairedis, sonic-swss-common, and sonic-utilities (#1791)

This commit is contained in:
pavel-shirshov 2018-06-15 11:49:10 -07:00 committed by lguohan
parent 9d5913d199
commit 4d795ec995
10 changed files with 26 additions and 9 deletions

View File

@ -11,3 +11,13 @@
{%- endif %}
{# Write the contents of sai_ profile_filename to sai.profile file #}
{{ sai_profile_contents }}
{# make linkscan interval time equal to 2.0 sec to make Fast-Reboot faster #}
{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['fast_reboot'] is defined -%}
{%- set fast_reboot = DEVICE_METADATA['localhost']['fast_reboot'] -%}
{%- if fast_reboot %}
{%- set sai_profile_contents = 'SAI_BCM_LINKSCAN_INTERVAL=2000000' -%}
{%- else %}
{%- set sai_profile_contents = '' -%}
{%- endif %}
{{ sai_profile_contents }}
{%- endif %}

View File

@ -126,7 +126,7 @@ class LldpManager(object):
TABLE_SEPARATOR = "|"
# Retrieve all entires for this port from the Port table
port_table = swsscommon.Table(self.config_db, swsscommon.CFG_PORT_TABLE_NAME, TABLE_SEPARATOR)
port_table = swsscommon.Table(self.config_db, swsscommon.CFG_PORT_TABLE_NAME)
(status, fvp) = port_table.get(port_name)
if status:
# Convert list of tuples to a dictionary
@ -144,7 +144,7 @@ class LldpManager(object):
lldpcli_cmd = "lldpcli configure ports {0} lldp portidsubtype local {1}".format(port_name, port_alias)
# Retrieve all entires for this port from the Device Neighbor table
device_neighbor_table = swsscommon.Table(self.config_db, swsscommon.CFG_DEVICE_NEIGHBOR_TABLE_NAME, TABLE_SEPARATOR)
device_neighbor_table = swsscommon.Table(self.config_db, swsscommon.CFG_DEVICE_NEIGHBOR_TABLE_NAME)
(status, fvp) = device_neighbor_table.get(port_name)
if status:
# Convert list of tuples to a dictionary
@ -216,7 +216,7 @@ class LldpManager(object):
# Listen indefinitely for changes to the PORT table in the State DB
while True:
(state, c, fd) = sel.select(SELECT_TIMEOUT_MS)
(state, c) = sel.select(SELECT_TIMEOUT_MS)
if state == swsscommon.Select.OBJECT:
(key, op, fvp) = sst.pop()

View File

@ -0,0 +1,2 @@
# Change linkscan interval to 0.25 sec after 3 minutes after start on Dell S6100
@reboot root sleep 180 && [ $(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) = 'x86_64-dell_s6100_c2538-r0' ] && [ $(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.fast_reboot) = 'True' ] && /usr/bin/docker exec -i syncd bcmcmd 'linkscan i=250000' > /dev/null 2>&1

View File

@ -11,7 +11,7 @@ mkdir -p /etc/sai.d/
# Create/Copy the sai.profile to /etc/sai.d/sai.profile
if [ -f $HWSKU_DIR/sai.profile.j2 ]; then
sonic-cfggen -d -t $HWSKU_DIR/sai.profile.j2 > /etc/sai.d/sai.profile
sonic-cfggen -H -d -t $HWSKU_DIR/sai.profile.j2 > /etc/sai.d/sai.profile
else
if [ -f $HWSKU_DIR/sai.profile ]; then
cp $HWSKU_DIR/sai.profile /etc/sai.d/sai.profile

View File

@ -31,6 +31,7 @@ from portconfig import get_port_config
from sonic_platform import get_machine_info
from sonic_platform import get_platform_info
from sonic_platform import get_system_mac
from sonic_platform import get_fast_reboot_status
from swsssdk import ConfigDBConnector
from collections import OrderedDict
from natsort import natsorted
@ -205,7 +206,8 @@ def main():
if args.platform_info:
hardware_data = {'DEVICE_METADATA': {'localhost': {
'platform': platform,
'mac': get_system_mac()
'mac': get_system_mac(),
'fast_reboot': get_fast_reboot_status()
}}}
deep_update(data, hardware_data)

View File

@ -53,3 +53,6 @@ def get_system_mac():
mac = mac[:-2] + aligned_last_byte
return mac
def get_fast_reboot_status():
with open('/proc/cmdline') as fp:
return 'fast-reboot' in fp.read()

@ -1 +1 @@
Subproject commit 524685a2b5a129986887c9808834f853e1a478b9
Subproject commit ce6abfa3acc4ffc376844d46d051a1e5647945e0

@ -1 +1 @@
Subproject commit a1b6fa323c693fe3e21cc0aebf2e29fce18aa5b3
Subproject commit 7a9f49b7be2d2ecfa971c38ec0c5ff5da8187893

@ -1 +1 @@
Subproject commit 14ca39fa0670b0e9b34d0ab63b12348bcba652ac
Subproject commit f907e9463bd9eb81d5cfb6d632774de41a100f93

@ -1 +1 @@
Subproject commit 951633b02606768b458b7dc88f6c6f8ca736db4e
Subproject commit c641d2b3eec5684182eb56ee71ac3843dbf3b0d0