Skip to content

[Accton][as9726-32d] Route SFP errors to syslog, drop unsupported-state logs#197

Merged
akenliu merged 1 commit into
accton:support_linux_6.1from
vincentchiang-ec:as9726-32d/sfp-tx-disable-log-syslog-only
Jun 16, 2026
Merged

[Accton][as9726-32d] Route SFP errors to syslog, drop unsupported-state logs#197
akenliu merged 1 commit into
accton:support_linux_6.1from
vincentchiang-ec:as9726-32d/sfp-tx-disable-log-syslog-only

Conversation

@vincentchiang-ec

@vincentchiang-ec vincentchiang-ec commented Jun 16, 2026

Copy link
Copy Markdown

Summary

Follow-up to #191 after customer integration testing. Two changes to the SFP log behaviour in sfpi.c:

  1. Drop unsupported-state logs entirely — "tx_disable not supported" / "(flat-memory module)" messages were already covered by the ONLP_STATUS_E_UNSUPPORTED return code; the extra log line just polluted onlpd -S output. Removed:
  2. Route remaining errors to syslog only — the other AIM_LOG_ERROR calls in this file (I2C/sysfs/eeprom failures, page-switch failures, restore failures, etc., 43 in total) are switched to direct syslog(LOG_ERR, ...). The AIM log handler in onlpd has TO_STDOUT set 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 direct syslog() does. Errors continue to land in syslog as LOG_DAEMON since onlpd already called openlog(\"onlpd\", LOG_PID, LOG_DAEMON) at startup.

Trailing `\\r\\n` is removed from each message because syslog() appends a newline itself.

…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>
@vincentchiang-ec vincentchiang-ec force-pushed the as9726-32d/sfp-tx-disable-log-syslog-only branch from 3493c8b to 5bdfc67 Compare June 16, 2026 06:02
@vincentchiang-ec vincentchiang-ec changed the title [Accton][as9726-32d] Route TX_DISABLE unsupported logs to syslog only [Accton][as9726-32d] Route SFP errors to syslog, drop unsupported-state logs Jun 16, 2026
@akenliu akenliu merged commit bbf35d0 into accton:support_linux_6.1 Jun 16, 2026
@vincentchiang-ec vincentchiang-ec deleted the as9726-32d/sfp-tx-disable-log-syslog-only branch June 24, 2026 09:41
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants