Skip to content

RDKCOM-5565: RDKBDEV-3410 Add open virtual switch agent Documentation#19

Merged
GoutamD2905 merged 5 commits intordkcentral:developfrom
Ashrafbhanu-k:feature/RDKBDEV-3410
Apr 30, 2026
Merged

RDKCOM-5565: RDKBDEV-3410 Add open virtual switch agent Documentation#19
GoutamD2905 merged 5 commits intordkcentral:developfrom
Ashrafbhanu-k:feature/RDKBDEV-3410

Conversation

@Ashrafbhanu-k
Copy link
Copy Markdown
Contributor

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]

@Ashrafbhanu-k Ashrafbhanu-k requested review from a team as code owners March 26, 2026 12:27
@pradeeptakdas pradeeptakdas changed the title RDKBDEV-3410:Add open virtual switch agent Documentation RDKCOM-5565: RDKBDEV-3410 Add open virtual switch agent Documentation Mar 26, 2026
@AkhilaReddyK7 AkhilaReddyK7 added community-contribution Contribution from community documentation Improvements or additions to documentation labels Apr 1, 2026
@Ashrafbhanu-k Ashrafbhanu-k force-pushed the feature/RDKBDEV-3410 branch from 8a83505 to 1c3a572 Compare April 8, 2026 10:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md describing 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.

Comment thread README.md Outdated
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
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
OvsAgent -->|"Reads /tmp/psm_initialized"| CcspPsm
OvsAgent -->|"systemd gate\nConditionPathExists=/tmp/psm_initialized"| CcspPsm

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified README as suggested.

Comment thread README.md Outdated
Comment on lines +35 to +38
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
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified README.

Comment thread README.md Outdated
- **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.
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- **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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified README as suggested.

Comment thread README.md Outdated
Comment on lines +164 to +166
- **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.
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- **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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified README as suggested.

Comment thread README.md Outdated

### 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`.
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- **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`.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified README as suggested.

Copy link
Copy Markdown
Contributor

@GoutamD2905 GoutamD2905 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ashrafbhanu-k Please address all Copilot review comments.

@Ashrafbhanu-k
Copy link
Copy Markdown
Contributor Author

@Ashrafbhanu-k Please address all Copilot review comments.

Hi @GoutamD2905
Modified README as suggested and verified against source code. Could you please check and merge this PR?

@GoutamD2905 GoutamD2905 merged commit fd2d0fd into rdkcentral:develop Apr 30, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community-contribution Contribution from community documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants