Skip to content

Rebase - #341

Merged
me-ha-p merged 2 commits into
feature/wifiStateMutexfrom
develop
Aug 24, 2026
Merged

Rebase#341
me-ha-p merged 2 commits into
feature/wifiStateMutexfrom
develop

Conversation

@me-ha-p

@me-ha-p me-ha-p commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Rebase

tukken-comcast and others added 2 commits August 21, 2026 20:20
…faceState (#337)

* RDK-62042: Improve performance of GetAvailableInterfaces and GetInterfaceState

Serve interface-state reads from an event-maintained cache.

GetAvailableInterfaces and GetInterfaceState on the Gnome backend created a
throwaway NMClient per call (nm_client_new), which synchronously dumps
NetworkManager's entire object model and cost ~300ms-1.4s, blowing the 100ms
SLA for GetAvailableInterfaces.

Serve both reads from a gnome-owned cache of raw NMDeviceState (plus MAC),
maintained solely by the event monitor:
- Record state on the startup device walk, device-added, and every
  notify::state transition; drop the entry on device-removed.
- Capture the MAC and keep it in sync whenever NM reports a new HW address.
- Derive enabled/connected at read time from a single canonical definition,
  removing the prior >= vs > drift between the two APIs.
- Make the reads pure: drop their side-effect writes to the shared
  connected/enabled atomics (the event path is now the sole writer).
- Treat an interface absent from the cache as omitted, and an empty
  interface list as a valid (successful) result rather than an error.

The cache holds a libnm type, so it lives in the Gnome backend; the
backend-agnostic NetworkManagerImplementation header stays libnm-free.

Add microsecond-resolution [PERF] instrumentation for both reads across the
JSON-RPC and impl layers. It is logged at DEBUG level so it stays silent in
normal operation and can be enabled on demand for diagnostics. When either
COM-RPC read takes one second or more, also emit a WARN so pathological
latencies surface without enabling DEBUG.

Gate the log level check ahead of message formatting in
NetworkManagerLogger::logPrint. Previously vsnprintf ran unconditionally and
the level was only checked afterward, so every disabled log still paid the
formatting cost. This affects all logging: disabled logs (at any level) now
short-circuit before formatting. The RDK-logger build gates on
rdk_logger_is_logLevel_enabled and the native build on the configured level,
so filtering stays authoritative for each variant.

Rework the libnm L1 tests to drive GetAvailableInterfaces and GetInterfaceState
through the event-state cache (the sole public writer) instead of mocking the
per-call NMClient device enumeration, and reset the process-global cache in
test setup for order-independent runs.

* Updated include Function Name

Updated include Function Name

---------

Co-authored-by: Karunakaran A <48997923+karuna2git@users.noreply.github.com>
Release of 3.7.0
@me-ha-p
me-ha-p requested a review from a team as a code owner August 24, 2026 03:46
Copilot AI lite review requested due to automatic review settings August 24, 2026 03:46
rc = Core::ERROR_NONE;
}
}
interfaceList.push_back(interface);
@me-ha-p
me-ha-p merged commit 1a6488f into feature/wifiStateMutex Aug 24, 2026
12 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants