From 90d428c937d70b42a5246f219e3dd83e77293e59 Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Wed, 13 Jun 2018 13:49:23 -0700 Subject: [PATCH] Update 201803 branch with masters of sonic-swss, sonic-sairedis, sonic-swss-common, and sonic-utilities --- .../Force10-S6100/sai.profile.j2 | 10 ++++++++++ dockers/docker-lldp-sv2/lldpmgrd | 6 +++--- files/image_config/cron.d/s6100-fast-reboot | 2 ++ platform/broadcom/docker-syncd-brcm/start.sh | 2 +- src/sonic-config-engine/sonic-cfggen | 4 +++- src/sonic-config-engine/sonic_platform.py | 3 +++ src/sonic-sairedis | 2 +- src/sonic-swss | 2 +- src/sonic-swss-common | 2 +- src/sonic-utilities | 2 +- 10 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 files/image_config/cron.d/s6100-fast-reboot diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/sai.profile.j2 b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/sai.profile.j2 index 92cda77668f6..265d93a5aaca 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/sai.profile.j2 +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/sai.profile.j2 @@ -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 %} \ No newline at end of file diff --git a/dockers/docker-lldp-sv2/lldpmgrd b/dockers/docker-lldp-sv2/lldpmgrd index 65f624dfd1dc..c572967d3e48 100755 --- a/dockers/docker-lldp-sv2/lldpmgrd +++ b/dockers/docker-lldp-sv2/lldpmgrd @@ -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() diff --git a/files/image_config/cron.d/s6100-fast-reboot b/files/image_config/cron.d/s6100-fast-reboot new file mode 100644 index 000000000000..aa3217e61fd0 --- /dev/null +++ b/files/image_config/cron.d/s6100-fast-reboot @@ -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 diff --git a/platform/broadcom/docker-syncd-brcm/start.sh b/platform/broadcom/docker-syncd-brcm/start.sh index d2180bce1ed7..3ed445ded691 100755 --- a/platform/broadcom/docker-syncd-brcm/start.sh +++ b/platform/broadcom/docker-syncd-brcm/start.sh @@ -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 diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index 42f64884200d..11399926bc11 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -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) diff --git a/src/sonic-config-engine/sonic_platform.py b/src/sonic-config-engine/sonic_platform.py index f573d6a6575d..9715b4b3e0e3 100644 --- a/src/sonic-config-engine/sonic_platform.py +++ b/src/sonic-config-engine/sonic_platform.py @@ -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() diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 524685a2b5a1..ce6abfa3acc4 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 524685a2b5a129986887c9808834f853e1a478b9 +Subproject commit ce6abfa3acc4ffc376844d46d051a1e5647945e0 diff --git a/src/sonic-swss b/src/sonic-swss index a1b6fa323c69..7a9f49b7be2d 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit a1b6fa323c693fe3e21cc0aebf2e29fce18aa5b3 +Subproject commit 7a9f49b7be2d2ecfa971c38ec0c5ff5da8187893 diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 14ca39fa0670..f907e9463bd9 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 14ca39fa0670b0e9b34d0ab63b12348bcba652ac +Subproject commit f907e9463bd9eb81d5cfb6d632774de41a100f93 diff --git a/src/sonic-utilities b/src/sonic-utilities index 951633b02606..c641d2b3eec5 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 951633b02606768b458b7dc88f6c6f8ca736db4e +Subproject commit c641d2b3eec5684182eb56ee71ac3843dbf3b0d0