-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[poed]Merging new poed init flow and error handling rules #19
Conversation
leonchiang
commented
Dec 29, 2021
•
edited
Loading
edited
- Merging new poed init flow and error handling rules
- For poecli add config related commands
- Fix some I2C communication issues.
- Fix exclusive lock flow
…vironment 1. Change service file permission (-x) 2. Add PYTHONUNBUFFERED=1 environment, for quicker dump stdout output. Signed-off-by: leon.chiang <[email protected]>
1. Modify exclusive lock with 5 times retry(delay 0.1s), set lock flag if lock successful, then check lock flag to execute wrapped function. 2. Move some const define in poed to poe_common.py. Signed-off-by: leon.chiang <[email protected]>
1. Add new sub command "poecli cfg" for manipulate config files. 2. Add busy flag between poed and poecli to prevent incorrect setting when the poed still initialization. 3. Change poecli command: 3.1. save->savechip 3.2. restore->restore_poe_system 4. Fix reconstruct flow if presistant config file loss. 5. Stop auto save presistent 30s loop. Signed-off-by: leon.chiang <[email protected]>
1. Remove Enable All ports in init function, 2. Remove save_system_settings in platform init function. Signed-off-by: leon.chiang <[email protected]>
1. Add I2C bus clear delay in TX/RX retry loop. 2. Add reset chip delay 300ms defines. 3. Print retry package content for debug. 4. Remove some space in lines (Refine code). 5. Add delay 30ms between command reports and next command(Key=0x00). Signed-off-by: leon.chiang <[email protected]>
…o stderr 1.Fix poecli exit code passing issue. Ex: root@localhost:~# poecli set -p 0 -e 1 > /dev/null usage: poecli.py set [-h] -p <val> [-e <val>] [-l <val>] [-o <val>] poecli.py set: error: argument -p/--ports: Invalid port inputs: '0'. root@localhost:~# echo $? 2 root@localhost:~# poecli set -p 1 -e 1 > /dev/null root@localhost:~# echo $? 0 2. Redirect all Exception print to stderr. Signed-off-by: leon.chiang <[email protected]>
1. Change platform init flow in poe agent and all supported platform. 2. On startup, clear read buffer for resolve protocol KEY mismatch during initialization platform. 3. Fast compare current active matrix with platform default matrix, skip set/program active matrix if matched. 4. Add driver support read active matrix function(Parser/Return value). Signed-off-by: leon.chiang <[email protected]>
Add failsafe mode when load/apply cfg setting fail, will disable all ports. Signed-off-by: leon.chiang <[email protected]>
1. Add return code if set commands. 2. Add return code structure parsing in init_poe flow (all platform will return the detail results). 3. Modify ports setting checking rules (set_all_params). 4. Add traceback function to identify detail exceptions. Signed-off-by: leon.chiang <[email protected]>
1. Fix communication retry echo byte regenerate. 2. Read 15 bytes when I2C bus initialized in all platform, avoid read mismatch package. 3. Suppress log message when exclusive lock success. 4. Skip powerlimit result checking in 802.3BT mode. Signed-off-by: leon.chiang <[email protected]>
1. Skip read all port enDis state for BT type Chip (not support). 2. Print recv buffer when retry _communication. Signed-off-by: leon.chiang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this locally on an Accton BT-capable system and the results look good. We do need additional reviewers, though, specifically from Accton.
There are many commits. Does it mean these commits can fix the issues#9~#18? |
Hi @leonchiang, Some questions: [ OK ] Stopped DentOS POE Agent. [ OK ] Started DentOS POE Agent. [ OK ] Stopped DentOS POE Agent. [ OK ] Started DentOS POE Agent. [ OK ] Stopped DentOS POE Agent. [ OK ] Started DentOS POE Agent. [ OK ] Stopped DentOS POE Agent. [ OK ] Started DentOS POE Agent. [ OK ] Stopped DentOS POE Agent. [FAILED] Failed to start DentOS POE Agent. See 'systemctl status poed.service' for details. DENT OS DENTOS-HEAD, 2021-10-14.16:01-3d75b42 localhost login: root Password: Last login: Thu Nov 3 17:17:27 UTC 2016 on ttyS0 Linux localhost 5.10.4 #1 SMP PREEMPT Thu Oct 14 16:09:41 UTC 2021 aarch64 root@localhost:~# ^C root@localhost:~# systemctl status poed.service > poed_service.log root@localhost:~# cat poed_service.log ♂ poed.service - DentOS POE Agent Loaded: loaded (/lib/systemd/system/poed.service; enabled; vendor preset: enabled) Active: failed (Result: start-limit-hit) since Thu 2016-11-03 17:16:47 UTC; 9min ago Process: 893 ExecStart=/usr/sbin/poed (code=exited, status=0/SUCCESS) Main PID: 893 (code=exited, status=0/SUCCESS) Nov 03 17:16:47 localhost systemd[1]: poed.service: Service hold-off time over, scheduling restart. Nov 03 17:16:47 localhost systemd[1]: Stopped DentOS POE Agent. Nov 03 17:16:47 localhost systemd[1]: poed.service: Start request repeated too quickly. Nov 03 17:16:47 localhost systemd[1]: Failed to start DentOS POE Agent. Nov 03 17:16:47 localhost systemd[1]: poed.service: Unit entered failed state. Nov 03 17:16:47 localhost systemd[1]: poed.service: Failed with result 'start-limit-hit'. Q2: Can you provide user guide and test log for "poecli cfg" releated command. And then, we can test other DUT according to user guide from you |
A2: We do have help command in "poecli cfg -h":
|
Hi Leo, We never see "/run/poe_runtime_cfg.json". And My "poe_perm_cfg.json" content is empty.
Hi Leo, We never see "/run/poe_runtime_cfg.json". And My "poe_perm_cfg.json" content is empty. |
Hi @WillyLiu-EC : 1. systemctl stop poed (If service still started)2. rm /etc/poe_agent/poe_perm_cfg.json3. systemctl start poed4. sleep 5 (Wait service up about 5s)5. poecli cfg -s (save current chip configs)6. ls -la /etc/poe_agent/poe_perm_cfg.json (Wait save step completed)Additional commit: Modify exit function for better debugging and get correct return code:
|
1d4ddfb
to
f24abd7
Compare
1. Add exitcode printing for reason of exit 2. Change exit function usage. Signed-off-by: leon.chiang <[email protected]>
Hi @leonchiang We follow these commands and cat /etc/poe_agent/poe_perm_cfg.json. It is seems save completed. About this poe_perm_cfg.json, do we need commit it ? where should we put the json file ? Best regards, |
Hi @WillyLiu-EC |
hi @leonchiang How do the users know that need to create the poe_perm_cfg.json ? are there any user guide ? |
Hi @WillyLiu-EC:
Normal production flow example:
You can create your production flow or boot script depend on your requirements by combine |
Hi @leonchiang We both know that the procedure of "Normal production flow example:" you mention to fixed the failed message. Best regard, |
We can add a in-code basic user guide and troubleshooting document for Administrator/Operator to control POE function if need, and create sub-command like "poecli guide" for printing out the user guide in console. About troubleshooting guide (same document), we can add some resolvable case to this part for non-AMZ users reference. Best Regards. |
Add userguide in code for Administrator/Operator to control POE function Usage: ~# poecli guide Signed-off-by: leon.chiang <[email protected]>
Hi @leonchiang Best regards, |
Hi @rothcar: Best Regards. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the modified codes and user guide are fine for Accton/Edge-core.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks