[Monitor Link Group] Add STATE_DB table name macros#1181
Open
srodd-nexthop wants to merge 5 commits into
Open
Conversation
#### What I did Add two STATE_DB table name macros in common/schema.h: - STATE_MONITOR_LINK_GROUP_STATE_TABLE_NAME - STATE_MONITOR_LINK_GROUP_MEMBER_TABLE_NAME #### Why I did it The Monitor Link Group feature, implemented in sonic-swss (intfmgrd, portmgrd, teammgrd), publishes group state and per-member control state to STATE_DB. These table name macros are consumed by the swss daemons and need to be defined in schema.h. The corresponding CFG_MONITOR_LINK_GROUP_TABLE_NAME is intentionally not added here: CFG_* macros are auto-generated into common/cfg_schema.h by gen_cfg_schema.py from the YANG model (sonic-monitor-link-group.yang) at build time. #### How I did it Added the two #define lines under a new "MONITOR LINK GROUP TABLES" section header. #### How to verify it - Build sonic-swss-common successfully. - Build sonic-swss against it and confirm intfmgrd/portmgrd/teammgrd compile with references to the new symbols. Signed-off-by: Satishkumar Rodd <srodd@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Apr 27, 2026
Open
6 tasks
Note that MonitorLinkGroupMgr (intfmgrd) produces these tables and PortMgr/TeamMgr consume them, and that the corresponding CFG_* macro is auto-generated into cfg_schema.h by gen_cfg_schema.py from sonic-monitor-link-group.yang rather than added here. Signed-off-by: Satishkumar Rodd <srodd@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Satishkumar Rodd <srodd@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
srodd-nexthop
added a commit
to nexthop-ai/sonic-swss
that referenced
this pull request
May 14, 2026
…nsitional shim STATE_MONITOR_LINK_GROUP_STATE_TABLE_NAME and STATE_MONITOR_LINK_GROUP_MEMBER_TABLE_NAME are added to sonic-swss-common/common/schema.h by sonic-net/sonic-swss-common#1181. Until that PR merges and the swss-common artifact pulled by sonic-swss CI carries those macros, this PR's build fails with 'STATE_MONITOR_LINK_GROUP_MEMBER_TABLE_NAME not declared in scope' in cfgmgr/teammgr*, portmgr*, and intfmgrd. Add #ifndef-guarded fallback definitions in cfgmgr/monitorlinkgroupmgr.h and include that header from the four cfgmgr files that reference the macros (portmgr.cpp, portmgrd.cpp, teammgr.cpp, teammgrd.cpp; the MLG manager already includes its own header). Once sonic-swss-common#1181 merges and schema.h carries these macros, the #ifndef guards skip the fallback and the upstream definitions take over. The shim can then be removed as a cleanup, but the #include lines stay since the files legitimately consume MLG-MEMBER state. Signed-off-by: Satishkumar Rodd <srodd@nexthop.ai>
srodd-nexthop
added a commit
to nexthop-ai/sonic-swss
that referenced
this pull request
May 14, 2026
…nsitional shim STATE_MONITOR_LINK_GROUP_STATE_TABLE_NAME and STATE_MONITOR_LINK_GROUP_MEMBER_TABLE_NAME are added to sonic-swss-common/common/schema.h by sonic-net/sonic-swss-common#1181. Until that PR merges and the swss-common artifact pulled by sonic-swss CI carries those macros, this PR's build fails with 'STATE_MONITOR_LINK_GROUP_MEMBER_TABLE_NAME not declared in scope' in cfgmgr/teammgr*, portmgr*, and intfmgrd. Add #ifndef-guarded fallback definitions in cfgmgr/monitorlinkgroupmgr.h and include that header from the four cfgmgr files that reference the macros (portmgr.cpp, portmgrd.cpp, teammgr.cpp, teammgrd.cpp; the MLG manager already includes its own header). Once sonic-swss-common#1181 merges and schema.h carries these macros, the #ifndef guards skip the fallback and the upstream definitions take over. The shim can then be removed as a cleanup, but the #include lines stay since the files legitimately consume MLG-MEMBER state. Signed-off-by: Satishkumar Rodd <srodd@nexthop.ai>
Retrigger Test vstest: our PR's Build amd64 passes (master Build amd64 failure was on a different scenario at 2026-05-16); our PR's only red is Test vstest on the test_acl_mark.py OID flake, unrelated to this PR's 5-line schema.h change. Signed-off-by: Satishkumar Rodd <srodd@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Retrigger BuildSairedis amd64 stage: previous run hit FlexCounter.addRemoveDashMeterCounter flake (downstream sairedis unit test). PR diff is 5 #defines in common/schema.h, no flex counter code touched. Signed-off-by: Satishkumar Rodd <srodd@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw retry |
Collaborator
|
Retrying failed(or canceled) jobs... |
Collaborator
|
Retrying failed(or canceled) stages in build 1117701: ✅Stage Test:
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What I did
Add two STATE_DB table name macros to
common/schema.hfor the Monitor Link Group feature:STATE_MONITOR_LINK_GROUP_STATE_TABLE_NAME— group operational state, consumed byshow monitor-linkSTATE_MONITOR_LINK_GROUP_MEMBER_TABLE_NAME— per-interface force-down signal, consumed by portmgrd and teammgrdWhy I did it
The Monitor Link Group feature (implemented in sonic-swss) publishes state to STATE_DB. The table name macros need to be defined in sonic-swss-common so they are available to all consumers without hardcoding strings.
The corresponding
CFG_MONITOR_LINK_GROUP_TABLE_NAMEis not added here — CONFIG_DB CFG_* macros are auto-generated intocommon/cfg_schema.hbygen_cfg_schema.pyfrom the YANG model at build time.How I verified it
Companion PRs
show monitor-linkCLIHLD: sonic-net/SONiC#2308
Yang Changes: sonic-net/sonic-buildimage#27004
swss: sonic-net/sonic-swss#4523
Show: sonic-net/sonic-utilities#4497