From ea5319eedbc02d22a2811fa8ebadd5b09652a178 Mon Sep 17 00:00:00 2001 From: Chih-Pei Chang Date: Thu, 1 Mar 2018 17:10:32 +0800 Subject: [PATCH 1/2] Fix LED activity behavior --- device/quanta/x86_64-quanta_ix1b_32x-r0/led_proc_init.soc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/device/quanta/x86_64-quanta_ix1b_32x-r0/led_proc_init.soc b/device/quanta/x86_64-quanta_ix1b_32x-r0/led_proc_init.soc index a53360de4ccb..831f74df7557 100755 --- a/device/quanta/x86_64-quanta_ix1b_32x-r0/led_proc_init.soc +++ b/device/quanta/x86_64-quanta_ix1b_32x-r0/led_proc_init.soc @@ -1,8 +1,8 @@ led 0 stop led 1 stop -led 0 prog 02 00 60 F3 67 1A 86 F3 06 F3 D2 40 74 04 12 F0 85 05 D2 0A 71 18 52 00 3A 80 28 60 F3 67 40 67 22 57 06 F3 12 A0 F8 15 1A 05 75 2E 77 38 06 F3 12 A0 F8 15 1A 04 75 4C 16 F0 DA 05 75 4C 77 54 06 F3 12 A0 F8 15 1A 00 75 4C 77 54 32 0F 87 57 32 0E 87 57 32 0E 87 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -led 1 prog 02 00 60 F3 67 1A 86 F3 06 F3 D2 40 74 04 12 F0 85 05 D2 0A 71 18 52 00 3A 80 28 60 F3 67 40 67 22 57 06 F3 12 A0 F8 15 1A 05 75 2E 77 38 06 F3 12 A0 F8 15 1A 04 75 4C 16 F0 DA 05 75 4C 77 54 06 F3 12 A0 F8 15 1A 00 75 4C 77 54 32 0F 87 57 32 0E 87 57 32 0E 87 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +led 0 prog 02 00 60 E2 D2 40 71 12 12 F0 85 05 D2 0A 71 19 52 00 67 1B 06 E2 80 77 02 3A 80 67 20 67 2E 57 06 E2 12 00 F0 80 F8 15 1A 00 75 4E 77 52 06 E2 F0 12 00 F8 15 1A 00 75 3B 77 46 06 E2 F0 12 00 F8 15 1A 01 75 4E 16 F0 DA 05 75 4E 77 52 32 0F 87 57 32 0E 87 57 00 00 00 00 00 00 00 00 00 00 +led 1 prog 02 00 60 E2 D2 40 71 12 12 F0 85 05 D2 0A 71 19 52 00 67 1B 06 E2 80 77 02 3A 80 67 20 67 2E 57 06 E2 12 00 F0 80 F8 15 1A 00 75 4E 77 52 06 E2 F0 12 00 F8 15 1A 00 75 3B 77 46 06 E2 F0 12 00 F8 15 1A 01 75 4E 16 F0 DA 05 75 4E 77 52 32 0F 87 57 32 0E 87 57 00 00 00 00 00 00 00 00 00 00 led 0 auto on led 1 auto on From 9146e896998da6f484119bd0baf5282460f87737 Mon Sep 17 00:00:00 2001 From: Chih-Pei Chang Date: Fri, 24 Aug 2018 09:33:54 +0000 Subject: [PATCH 2/2] Modify psuutil.py and config.bcm of IX1B --- .../th-ix1b-32x100G.config.bcm | 7 ++- .../plugins/psuutil.py | 57 +++++++++---------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/device/quanta/x86_64-quanta_ix1b_32x-r0/Quanta-IX1B-32X/th-ix1b-32x100G.config.bcm b/device/quanta/x86_64-quanta_ix1b_32x-r0/Quanta-IX1B-32X/th-ix1b-32x100G.config.bcm index f73d5be55cd4..051b8ed71e8e 100644 --- a/device/quanta/x86_64-quanta_ix1b_32x-r0/Quanta-IX1B-32X/th-ix1b-32x100G.config.bcm +++ b/device/quanta/x86_64-quanta_ix1b_32x-r0/Quanta-IX1B-32X/th-ix1b-32x100G.config.bcm @@ -12,8 +12,11 @@ parity_enable=1 # Control to disable parity correction parity_correction=1 -l2_mem_entries=<40960> -l3_mem_entries=<40960> +ipv6_lpm_128b_enable=1 +l3_alpm_enable=2 + +l2_mem_entries=40960 +l3_mem_entries=40960 portmap_1=1:100 portmap_2=5:100 diff --git a/device/quanta/x86_64-quanta_ix1b_32x-r0/plugins/psuutil.py b/device/quanta/x86_64-quanta_ix1b_32x-r0/plugins/psuutil.py index 5b12ba41c9ad..1986aa846c5e 100755 --- a/device/quanta/x86_64-quanta_ix1b_32x-r0/plugins/psuutil.py +++ b/device/quanta/x86_64-quanta_ix1b_32x-r0/plugins/psuutil.py @@ -5,7 +5,7 @@ import os.path -import commands +import subprocess import logging try: @@ -17,59 +17,58 @@ def show_log(txt): if DEBUG == True: - print "[IX1B]"+txt + print("[IX2]"+txt) return def exec_cmd(cmd, show): logging.info('Run :'+cmd) - status, output = commands.getstatusoutput(cmd) - show_log (cmd +"with result:" + str(status)) - show_log (" output:"+output) - if status: - logging.info('Failed :'+cmd) + try: + output = subprocess.check_output(cmd, shell=True) + show_log (cmd +"output:"+str(output)) + except subprocess.CalledProcessError as e: + logging.info("Failed :"+cmd) if show: - print('Failed :'+cmd) - return status, output + print("Failed :"+cmd +"returncode = {}, err msg: {}".format(e.returncode, e.output)) + return output def my_log(txt): if DEBUG == True: - print "[QUANTA DBG]: "+txt + print("[QUANTA DBG]: "+txt) return def log_os_system(cmd, show): logging.info('Run :'+cmd) status = 1 output = "" - status, output = commands.getstatusoutput(cmd) - my_log (cmd +"with result:" + str(status)) - my_log ("cmd:" + cmd) - my_log (" output:"+output) - if status: + try: + output = subprocess.check_output(cmd, shell=True) + my_log (cmd +"output:"+str(output)) + except subprocess.CalledProcessError as e: logging.info('Failed :'+cmd) if show: - print('Failed :'+cmd) - return status, output + print("Failed :"+cmd +"returncode = {}, err msg: {}".format(e.returncode, e.output)) + return output def gpio16_exist(): - ret, ls = log_os_system("ls /sys/class/gpio/ | grep gpio16", 0) + ls = log_os_system("ls /sys/class/gpio/ | grep gpio16", 0) logging.info('mods:'+ls) if len(ls) ==0: return False def gpio17_exist(): - ret, ls = log_os_system("ls /sys/class/gpio/ | grep gpio17", 0) + ls = log_os_system("ls /sys/class/gpio/ | grep gpio17", 0) logging.info('mods:'+ls) if len(ls) ==0: return False def gpio19_exist(): - ret, ls = log_os_system("ls /sys/class/gpio/ | grep gpio19", 0) + ls = log_os_system("ls /sys/class/gpio/ | grep gpio19", 0) logging.info('mods:'+ls) if len(ls) ==0: return False def gpio20_exist(): - ret, ls = log_os_system("ls /sys/class/gpio/ | grep gpio20", 0) + ls = log_os_system("ls /sys/class/gpio/ | grep gpio20", 0) logging.info('mods:'+ls) if len(ls) ==0: return False @@ -86,20 +85,20 @@ def __init__(self): PsuBase.__init__(self) if gpio16_exist() == False: - status, output = exec_cmd("echo 16 > /sys/class/gpio/export ", 1) - status, output = exec_cmd("echo in > /sys/class/gpio/gpio16/direction ", 1) + output = exec_cmd("echo 16 > /sys/class/gpio/export ", 1) + output = exec_cmd("echo in > /sys/class/gpio/gpio16/direction ", 1) if gpio17_exist() == False: - status, output = exec_cmd("echo 17 > /sys/class/gpio/export ", 1) - status, output = exec_cmd("echo in > /sys/class/gpio/gpio17/direction ", 1) + output = exec_cmd("echo 17 > /sys/class/gpio/export ", 1) + output = exec_cmd("echo in > /sys/class/gpio/gpio17/direction ", 1) if gpio19_exist() == False: - status, output = exec_cmd("echo 19 > /sys/class/gpio/export ", 1) - status, output = exec_cmd("echo in > /sys/class/gpio/gpio19/direction ", 1) + output = exec_cmd("echo 19 > /sys/class/gpio/export ", 1) + output = exec_cmd("echo in > /sys/class/gpio/gpio19/direction ", 1) if gpio20_exist() == False: - status, output = exec_cmd("echo 20 > /sys/class/gpio/export ", 1) - status, output = exec_cmd("echo in > /sys/class/gpio/gpio20/direction ", 1) + output = exec_cmd("echo 20 > /sys/class/gpio/export ", 1) + output = exec_cmd("echo in > /sys/class/gpio/gpio20/direction ", 1) # Get sysfs attribute def get_attr_value(self, attr_path):