Skip to content

Commit

Permalink
Update 201803 branch with masters of sonic-swss, sonic-sairedis, soni…
Browse files Browse the repository at this point in the history
…c-swss-common, and sonic-utilities (sonic-net#1791)
  • Loading branch information
pavel-shirshov authored and lguohan committed Jun 15, 2018
1 parent 9d5913d commit 4d795ec
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
6 changes: 3 additions & 3 deletions dockers/docker-lldp-sv2/lldpmgrd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions files/image_config/cron.d/s6100-fast-reboot
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion platform/broadcom/docker-syncd-brcm/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/sonic-config-engine/sonic-cfggen
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions src/sonic-config-engine/sonic_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion src/sonic-sairedis
2 changes: 1 addition & 1 deletion src/sonic-swss
2 changes: 1 addition & 1 deletion src/sonic-swss-common
2 changes: 1 addition & 1 deletion src/sonic-utilities

0 comments on commit 4d795ec

Please sign in to comment.