RDKCOM-5565: RDKBDEV-3410 Add open virtual switch agent Documentation#19
Conversation
8a83505 to
1c3a572
Compare
There was a problem hiding this comment.
Pull request overview
Adds comprehensive top-level documentation for the Open Virtual Switch Agent (OvsAgent) component to describe its purpose, architecture, dependencies, and runtime flows.
Changes:
- Introduces a new repository
README.mddescribing OvsAgent responsibilities and integration points - Adds Mermaid diagrams for component architecture, state/sequence flows, and IPC patterns
- Documents build-time flags, runtime dependencies, and key implementation references
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| MeshAgent -->|"Unix Socket\nJSON-RPC"| OvsDbServer | ||
| OvsAgent -->|"Unix Socket /var/run/openvswitch/db.sock\nJSON-RPC OVSDB Protocol"| OvsDbServer | ||
| OvsAgent -->|"R-BUS"| CcspCR | ||
| OvsAgent -->|"Reads /tmp/psm_initialized"| CcspPsm |
There was a problem hiding this comment.
In the Mermaid diagram this implies the OvsAgent process reads /tmp/psm_initialized, but in this repo it’s used by systemd as a startup gate (ConditionPathExists=/tmp/psm_initialized in systemd_units/OvsAgent.service). Please adjust the diagram label to reflect systemd/path-unit gating rather than a runtime read by OvsAgent.
| OvsAgent -->|"Reads /tmp/psm_initialized"| CcspPsm | |
| OvsAgent -->|"systemd gate\nConditionPathExists=/tmp/psm_initialized"| CcspPsm |
There was a problem hiding this comment.
Modified README as suggested.
| OvsAgent -->|"syscfg_get\nmesh_ovs_enable, lan_ipaddr"| Syscfg | ||
| OvsAgent -->|"getenv MODEL_NUM\nOneWiFiEnabled"| DeviceProps | ||
| OvsAgent -->|"v_secure_system"| OvsTools | ||
| OvsAgent -->|"v_secure_system\n(non-OVS bridges)"| LinuxNet |
There was a problem hiding this comment.
This section says OvsAgent performs syscfg_get for mesh_ovs_enable, but the code only uses syscfg for lan_ipaddr (and mesh_ovs_enable is checked by scripts/syscfg_check.sh / systemd env SYSCFG_OVS). Please update the diagram/text so responsibility for reading mesh_ovs_enable is attributed to the startup script/service rather than the C binary.
There was a problem hiding this comment.
Modified README.
| - **Dual-mode Networking Backend**: Selects between OVS-managed (`ovs-vsctl`) and Linux-native (`brctl`/`ifconfig`) bridge operations at runtime based on the bridge name. To meet Xfinity WiFi requirements, specific bridges (`brlan2`–`brlan5`, `brpublic`, `bropen6g`, `brsecure6g`) are managed using Linux bridge utilities. | ||
| - **Feedback Reporting**: After applying each configuration, inserts a `Feedback` record into the OVSDB `Feedback` table containing the request UUID and the operation status, allowing the originating component to confirm the outcome. | ||
| - **OpenFlow Flow Configuration**: Sets up OpenFlow flows on OVS bridges for specific Wi-Fi hardware models and Mesh fast-roaming scenarios using `ovs-ofctl` commands after bridge configuration. | ||
| - **Conditional Startup via syscfg**: Reads the `mesh_ovs_enable` syscfg key at startup. If the key is not set to `true` and neither `OneWiFiEnabled` nor `/etc/WFO_enabled` is present, the agent skips execution and touches `/tmp/ovsagent_initialized` to signal readiness without launching the main process. |
There was a problem hiding this comment.
The conditional-startup description states the agent reads mesh_ovs_enable at startup, but in this repo that decision is made in scripts/syscfg_check.sh (invoked by systemd_units/OvsAgent.service) before launching /usr/bin/OvsAgent. Please reword to avoid implying the binary reads mesh_ovs_enable itself.
| - **Conditional Startup via syscfg**: Reads the `mesh_ovs_enable` syscfg key at startup. If the key is not set to `true` and neither `OneWiFiEnabled` nor `/etc/WFO_enabled` is present, the agent skips execution and touches `/tmp/ovsagent_initialized` to signal readiness without launching the main process. | |
| - **Conditional Startup via syscfg**: The service startup path checks the `mesh_ovs_enable` syscfg key before launching `/usr/bin/OvsAgent`. If the key is not set to `true` and neither `OneWiFiEnabled` nor `/etc/WFO_enabled` is present, startup is skipped and `/tmp/ovsagent_initialized` is touched to signal readiness without starting the main process. |
There was a problem hiding this comment.
Modified README as suggested.
| - **Build Dependencies**: `libjansson` (JSON parsing for OVSDB protocol), `libdbus-1 >= 1.6.18` (R-BUS), `libsyscfg` (syscfg get/init), `libccsp_common` (CCSP base interfaces), `liblog4c` (RDK logging), `libsystemd` (systemd notify integration) | ||
| - **RDK-B Components**: Component Registry (must be reachable on R-BUS at startup), `CcspPsm` (PSM must have written `/tmp/psm_initialized` before OvsAgent starts) | ||
| - **Systemd Services**: `OvsAgent.service` requires `OvsAgent_ovsdb-server.service`. `OvsAgent.path` triggers service start when `/tmp/psm_initialized` is created. |
There was a problem hiding this comment.
This lists libsystemd as a build dependency for “systemd notify integration”, but there’s no sd_notify usage and no libsystemd check/linkage in configure.ac/Makefiles. Please remove libsystemd from the dependency list or clarify if it’s only required in an external integration layer not present in this repo.
| - **Build Dependencies**: `libjansson` (JSON parsing for OVSDB protocol), `libdbus-1 >= 1.6.18` (R-BUS), `libsyscfg` (syscfg get/init), `libccsp_common` (CCSP base interfaces), `liblog4c` (RDK logging), `libsystemd` (systemd notify integration) | |
| - **RDK-B Components**: Component Registry (must be reachable on R-BUS at startup), `CcspPsm` (PSM must have written `/tmp/psm_initialized` before OvsAgent starts) | |
| - **Systemd Services**: `OvsAgent.service` requires `OvsAgent_ovsdb-server.service`. `OvsAgent.path` triggers service start when `/tmp/psm_initialized` is created. | |
| - **Build Dependencies**: `libjansson` (JSON parsing for OVSDB protocol), `libdbus-1 >= 1.6.18` (R-BUS), `libsyscfg` (syscfg get/init), `libccsp_common` (CCSP base interfaces), `liblog4c` (RDK logging) | |
| - **RDK-B Components**: Component Registry (must be reachable on R-BUS at startup), `CcspPsm` (PSM must have written `/tmp/psm_initialized` before OvsAgent starts) | |
| - **Systemd Services**: Deployment may use `OvsAgent.service` with `OvsAgent_ovsdb-server.service` ordering, and `OvsAgent.path` may trigger service start when `/tmp/psm_initialized` is created. This is runtime/unit-file integration and not an in-repo `libsystemd` build dependency. |
There was a problem hiding this comment.
Modified README as suggested.
|
|
||
| ### Key Implementation Logic | ||
|
|
||
| - **Bridge Backend Selection**: In `ovs_modifyParentBridge()` ([ovs_action.c](open-virtual-switch-agent/source/OvsAction/ovs_action.c#L1178-L1186)), the bridge name is checked against a hard-coded list (`brlan2`–`brlan5`, `brpublic`, `bropen6g`, `brsecure6g`) to meet Xfinity WiFi requirements. These bridges use Linux bridge utilities. All other bridges use `ovs-vsctl`. |
There was a problem hiding this comment.
This source link is likely broken in this repo because it includes an extra open-virtual-switch-agent/ path segment. Using a relative link like source/OvsAction/ovs_action.c#L1178-L1186 should work when viewing the README in this repository.
| - **Bridge Backend Selection**: In `ovs_modifyParentBridge()` ([ovs_action.c](open-virtual-switch-agent/source/OvsAction/ovs_action.c#L1178-L1186)), the bridge name is checked against a hard-coded list (`brlan2`–`brlan5`, `brpublic`, `bropen6g`, `brsecure6g`) to meet Xfinity WiFi requirements. These bridges use Linux bridge utilities. All other bridges use `ovs-vsctl`. | |
| - **Bridge Backend Selection**: In `ovs_modifyParentBridge()` ([ovs_action.c](source/OvsAction/ovs_action.c#L1178-L1186)), the bridge name is checked against a hard-coded list (`brlan2`–`brlan5`, `brpublic`, `bropen6g`, `brsecure6g`) to meet Xfinity WiFi requirements. These bridges use Linux bridge utilities. All other bridges use `ovs-vsctl`. |
There was a problem hiding this comment.
Modified README as suggested.
GoutamD2905
left a comment
There was a problem hiding this comment.
@Ashrafbhanu-k Please address all Copilot review comments.
Hi @GoutamD2905 |
RDKBDEV-3410
Reason for Change:
To add Component Documentation for open virtual switch agent
Fix:
Added the README documentation
Test Procedure:
None
Signed-off-by: Ashrafbhanu-k [Ashraf_bhanu@comcast.com]