Rebase - #341
Merged
Merged
Conversation
…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
| rc = Core::ERROR_NONE; | ||
| } | ||
| } | ||
| interfaceList.push_back(interface); |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Rebase