[Accton][as9726-32d] Route SFP errors to syslog, drop unsupported-state logs#197
Merged
akenliu merged 1 commit intoJun 16, 2026
Conversation
…te logs
Inside onlpd, the AIM log handler is initialized with TO_STDOUT when
stdout is a TTY (interactive use of `onlpd -S`, etc.), so every fired
log line - regardless of level - is printed to stdout, polluting the
interactive output integrators consume. Customer feedback after
integration testing:
1. Unsupported-state log lines ("tx_disable not supported (flat-
memory module)", "Setting/Getting tx_disable... is not supported")
do not need to be logged at all - the function already returns
ONLP_STATUS_E_UNSUPPORTED with the right semantic meaning. They
are removed entirely (3 lines added in the previous capability
check change + 1 pre-existing advertising-bit-fail line in
control_set).
2. The remaining genuine error messages (I2C read/write failures,
sysfs file open/read failures, eeprom read failures, etc.) are
switched from AIM_LOG_ERROR to direct syslog(LOG_ERR, ...). This
bypasses the AIM stdout fan-out and routes errors to syslog only,
keeping `onlpd -S` interactive output clean while still recording
errors in syslog (LOG_DAEMON facility - onlpd has already called
openlog("onlpd", LOG_PID, LOG_DAEMON) at startup).
Trailing "\r\n" is dropped from each message since syslog() appends a
newline itself.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3493c8b to
5bdfc67
Compare
akenliu
approved these changes
Jun 16, 2026
eric271110
added a commit
to eric271110/OpenNetworkLinux_accton
that referenced
this pull request
Jul 3, 2026
…sary error logs merge from [Accton][as9726-32d] Route SFP errors to syslog, drop unsupported-state logs accton#197 platform: as7535-28xb as7926-40xfb as7946-30xb as7946-74xkb as9716_32d as9736-64d as9737-32db as9817-64-nb as9817-64 as9926-24d as9926-24db Changes: - Replace AIM_LOG_ERROR with syslog(LOG_ERR, ...) for consistent logging - Remove flat-memory module unsupported log messages - Remove tx_disable not supported log messages - Add #include <syslog.h> Signed-off-by: Eric Yang <eric_yang@accton.com>
eric271110
added a commit
to eric271110/OpenNetworkLinux_accton
that referenced
this pull request
Jul 3, 2026
…sary error logs merge from [Accton][as9726-32d] Route SFP errors to syslog, drop unsupported-state logs accton#197 platform: as7535-28xb as7926-40xfb as7946-30xb as7946-74xkb as9716_32d as9726-32d as9736-64d as9737-32db as9817-64-nb as9817-64 as9926-24d as9926-24db Changes: - Replace AIM_LOG_ERROR with syslog(LOG_ERR, ...) for consistent logging - Remove flat-memory module unsupported log messages - Remove tx_disable not supported log messages - Add #include <syslog.h> Signed-off-by: Eric Yang <eric_yang@accton.com>
eric271110
added a commit
to eric271110/OpenNetworkLinux_accton
that referenced
this pull request
Jul 3, 2026
…sary error logs merge from [Accton][as9726-32d] Route SFP errors to syslog, drop unsupported-state logs accton#197 platform: as7926-40xfb as9716_32d as9817-64-nb as9817-64 as9926-24d as9926-24db Changes: - Replace AIM_LOG_ERROR with syslog(LOG_ERR, ...) for consistent logging - Remove flat-memory module unsupported log messages - Remove tx_disable not supported log messages - Add #include <syslog.h> Signed-off-by: Eric Yang <eric_yang@accton.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #191 after customer integration testing. Two changes to the SFP log behaviour in
sfpi.c:ONLP_STATUS_E_UNSUPPORTEDreturn code; the extra log line just pollutedonlpd -Soutput. Removed:control_set("Setting tx_disable to port(%d) is not supported")AIM_LOG_ERRORcalls in this file (I2C/sysfs/eeprom failures, page-switch failures, restore failures, etc., 43 in total) are switched to directsyslog(LOG_ERR, ...). The AIM log handler in onlpd hasTO_STDOUTset whenever stdout is a TTY, and its stdout branch ignores log level entirely — so simply lowering the level (e.g.AIM_LOG_SYSLOG_NOTICE) does not keep the message off interactive output. Bypassing AIM with directsyslog()does. Errors continue to land in syslog as LOG_DAEMON sinceonlpdalready calledopenlog(\"onlpd\", LOG_PID, LOG_DAEMON)at startup.Trailing `\\r\\n` is removed from each message because
syslog()appends a newline itself.