Skip to content

Commit 4d795ec

Browse files
pavel-shirshovlguohan
authored andcommitted
Update 201803 branch with masters of sonic-swss, sonic-sairedis, sonic-swss-common, and sonic-utilities (sonic-net#1791)
1 parent 9d5913d commit 4d795ec

10 files changed

Lines changed: 26 additions & 9 deletions

File tree

device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/sai.profile.j2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@
1111
{%- endif %}
1212
{# Write the contents of sai_ profile_filename to sai.profile file #}
1313
{{ sai_profile_contents }}
14+
{# make linkscan interval time equal to 2.0 sec to make Fast-Reboot faster #}
15+
{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['fast_reboot'] is defined -%}
16+
{%- set fast_reboot = DEVICE_METADATA['localhost']['fast_reboot'] -%}
17+
{%- if fast_reboot %}
18+
{%- set sai_profile_contents = 'SAI_BCM_LINKSCAN_INTERVAL=2000000' -%}
19+
{%- else %}
20+
{%- set sai_profile_contents = '' -%}
21+
{%- endif %}
22+
{{ sai_profile_contents }}
23+
{%- endif %}

dockers/docker-lldp-sv2/lldpmgrd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class LldpManager(object):
126126
TABLE_SEPARATOR = "|"
127127

128128
# Retrieve all entires for this port from the Port table
129-
port_table = swsscommon.Table(self.config_db, swsscommon.CFG_PORT_TABLE_NAME, TABLE_SEPARATOR)
129+
port_table = swsscommon.Table(self.config_db, swsscommon.CFG_PORT_TABLE_NAME)
130130
(status, fvp) = port_table.get(port_name)
131131
if status:
132132
# Convert list of tuples to a dictionary
@@ -144,7 +144,7 @@ class LldpManager(object):
144144
lldpcli_cmd = "lldpcli configure ports {0} lldp portidsubtype local {1}".format(port_name, port_alias)
145145

146146
# Retrieve all entires for this port from the Device Neighbor table
147-
device_neighbor_table = swsscommon.Table(self.config_db, swsscommon.CFG_DEVICE_NEIGHBOR_TABLE_NAME, TABLE_SEPARATOR)
147+
device_neighbor_table = swsscommon.Table(self.config_db, swsscommon.CFG_DEVICE_NEIGHBOR_TABLE_NAME)
148148
(status, fvp) = device_neighbor_table.get(port_name)
149149
if status:
150150
# Convert list of tuples to a dictionary
@@ -216,7 +216,7 @@ class LldpManager(object):
216216

217217
# Listen indefinitely for changes to the PORT table in the State DB
218218
while True:
219-
(state, c, fd) = sel.select(SELECT_TIMEOUT_MS)
219+
(state, c) = sel.select(SELECT_TIMEOUT_MS)
220220

221221
if state == swsscommon.Select.OBJECT:
222222
(key, op, fvp) = sst.pop()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Change linkscan interval to 0.25 sec after 3 minutes after start on Dell S6100
2+
@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

platform/broadcom/docker-syncd-brcm/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mkdir -p /etc/sai.d/
1111

1212
# Create/Copy the sai.profile to /etc/sai.d/sai.profile
1313
if [ -f $HWSKU_DIR/sai.profile.j2 ]; then
14-
sonic-cfggen -d -t $HWSKU_DIR/sai.profile.j2 > /etc/sai.d/sai.profile
14+
sonic-cfggen -H -d -t $HWSKU_DIR/sai.profile.j2 > /etc/sai.d/sai.profile
1515
else
1616
if [ -f $HWSKU_DIR/sai.profile ]; then
1717
cp $HWSKU_DIR/sai.profile /etc/sai.d/sai.profile

src/sonic-config-engine/sonic-cfggen

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ from portconfig import get_port_config
3131
from sonic_platform import get_machine_info
3232
from sonic_platform import get_platform_info
3333
from sonic_platform import get_system_mac
34+
from sonic_platform import get_fast_reboot_status
3435
from swsssdk import ConfigDBConnector
3536
from collections import OrderedDict
3637
from natsort import natsorted
@@ -205,7 +206,8 @@ def main():
205206
if args.platform_info:
206207
hardware_data = {'DEVICE_METADATA': {'localhost': {
207208
'platform': platform,
208-
'mac': get_system_mac()
209+
'mac': get_system_mac(),
210+
'fast_reboot': get_fast_reboot_status()
209211
}}}
210212
deep_update(data, hardware_data)
211213

src/sonic-config-engine/sonic_platform.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ def get_system_mac():
5353
mac = mac[:-2] + aligned_last_byte
5454
return mac
5555

56+
def get_fast_reboot_status():
57+
with open('/proc/cmdline') as fp:
58+
return 'fast-reboot' in fp.read()

src/sonic-sairedis

src/sonic-swss

src/sonic-swss-common

src/sonic-utilities

0 commit comments

Comments
 (0)