[Link Event Damping] Add RedisInterface plumbing for damping config#1935
[Link Event Damping] Add RedisInterface plumbing for damping config#1935DendroLabs wants to merge 2 commits into
Conversation
Supersedes sonic-net#1331 by @Ashish1805. Adds the Redis communication layer to carry link event damping configuration from orchagent to syncd. Addresses @kcudnik review feedback from sonic-net#1331: - setLinkEventDampingConfig always synchronous (never checks m_syncMode) - sendLinkEventDampingConfigResponse always sends (no m_enableSyncMode guard) - isRedisPortAttribute simplified to single boolean expression lib/ changes: - sairediscommon.h: DAMPING_CONFIG_SET / DAMPING_CONFIG_RESPONSE commands - RedisRemoteSaiInterface: isRedisPortAttribute(), setRedisPortExtensionAttribute(), setLinkEventDampingConfig() with unconditional wait(), waitForLinkEventDampingConfigResponse() - ClientSai::set(): block port extension attrs in CLIENT mode - Sai::set(): route port extension attrs directly, bypass metadata validation syncd/ changes: - Syncd: dispatch DAMPING_CONFIG_SET in processSingleEvent() - processLinkEventDampingConfigSet(): stub returning NOT_IMPLEMENTED - sendLinkEventDampingConfigResponse(): always sends response syncd handler is a stub -- actual algorithm in sonic-net#1334 supersede. Signed-off-by: DendroLabs <info@dendrolabs.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@kcudnik @mikeberesford — this is the second PR in the link event damping series, following #1798 (SelectablesTracker, merged last week). It adds the Redis communication plumbing, superseding #1331. All three review comments from #1331 are addressed — the key fix is making the damping config API always synchronous, matching the pattern used by Would appreciate your review when you get a chance. The next PR (#1334 supersede, the actual damping algorithm) depends on this one. |
Replace development-facing "stub" wording in the processLinkEventDampingConfigSet NOTICE log with a professional message suitable for operator syslog. Signed-off-by: DendroLabs <info@dendrolabs.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@DendroLabs , please review this PR - #1906. You can close #1935 in favor of 1906 |
|
Closing in favor of #1906 per @prsunny's suggestion. @sivat6's PR covers this scope and more (full Syncd wiring + damping algorithm + stats). Our #1798 (SelectablesTracker) is already merged and provides the foundation both approaches build on. Happy to help review #1906 and get it across the finish line — we've done extensive testing of the damping algorithm and can offer some findings. The CLI (sonic-net/sonic-utilities#4367) and YANG model (sonic-net/sonic-buildimage#26231) PRs remain open as they're independent of the sairedis implementation approach. |
Summary
Supersedes #1331, originally authored by @Ashish1805. The original PR has been inactive for ~2 years and has merge conflicts against current master.
This PR adds the Redis communication layer for link event damping configuration:
lib/ (orchagent -> Redis):
sairediscommon.h: New command stringslink_event_damping_config_set/link_event_damping_config_responseRedisRemoteSaiInterface: NewisRedisPortAttribute()(port analog toisRedisAttribute()),setRedisPortExtensionAttribute()dispatch, andsetLinkEventDampingConfig()which is always synchronous (per @kcudnik review)ClientSai::set(): Blocks port extension attrs in CLIENT modeSai::set(): Routes port extension attrs directly, bypassing metadata validationsyncd/ (Redis -> syncd handler):
Syncd: Dispatcheslink_event_damping_config_settoprocessLinkEventDampingConfigSet()stubsendLinkEventDampingConfigResponse()always sends a response (nom_enableSyncModeguard), since the lib always waitsFixes from @kcudnik's review of #1331
Always synchronous:
setLinkEventDampingConfigunconditionally callsm_communicationChannel->wait(). The original code skipped the wait in async mode, which @kcudnik said was wrong: "make this api always synchronous, async mode is just for create/remove/set operations all other apis should be synchronous."Simplified
isRedisPortAttribute: Single boolean expression using reversed condition, per @kcudnik: "you can turn this to 1 single line by reversing condition."Syncd always sends response:
sendLinkEventDampingConfigResponseomits them_enableSyncModeguard, since the lib side always waits unconditionally.Relation to other PRs
This is part of the Link Event Damping feature:
processLinkEventDampingConfigSetwith actual damping algorithm (next)Test plan
unittest/lib/TestClientServerSai.cpp(client mode rejection, null pointer rejection, invalid attribute rejection)syncd/tests/TestSyncdLinkEventDamping.cpp(full lib->Redis->syncd round trip for algorithm and AIED config, assertingNOT_IMPLEMENTEDresponse from stub)SAI_PORT_ATTR_CUSTOM_RANGE_START(0x10000000)Credits: Original implementation by @Ashish1805 (PR #1331).