RDKB-65989: Move MAP-T ratio calculation to WanManager from DHCPManager - #142
RDKB-65989: Move MAP-T ratio calculation to WanManager from DHCPManager#142sivaraj-comcast wants to merge 3 commits into
Conversation
RDKB-65989: Move MAP-T ratio calculation to WanManager from DHCPManager Reason for change: Remove duplicated ratio computation from DHCPManager. DHCPManager now sends ratio=0 in the rbus event; WanManager derives ratio from eaLen/v4Len/psidLen as the single authoritative owner. Test Procedure: 1. Verify SYSEVENT_MAPT_RATIO and Device.MAP.Domain.1.Rule.1.X_RDKCENTRAL-COM_Ratio / Device.DHCPv6.Client.1.X_RDKCENTRAL-COM_RcvOption.MapRatio is correctly set by WanManager after MAPT lease. Risks: Low Priority: P1
There was a problem hiding this comment.
Pull request overview
This PR aligns MAP-T ratio ownership with the stated design: DHCPManager stops computing MAP-T ratio during DHCP option parsing, and instead leaves the ratio value unset (effectively 0) so WanManager can derive it from PSID length as the single authoritative source.
Changes:
- Removed MAP-T ratio calculation from DHCPManager’s MAP option parsing logic.
- Removed associated MAP-T ratio trace logging from the DHCP parsing path.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
source/DHCPMgrUtils/dhcpmgr_map_apis.c:209
WanManageris expected to derive MAP-T ratio frompsidLen, but when the S46 Port Params suboption is absent (bytesLeftOut == 0) this parser never sets a defaultg_stMapData.PsidLen(it stays 0 from the earliermemset). With this PR also forcingRatio = 0, downstream components will have neither a ratio nor a reliablepsidLento derive it from. Consider deriving/validating a defaultPsidLenfromEaLenandRuleIPv4PrefixLenper RFC (and still keepRatio = 0so DHCPManager is not computing it).
g_stMapData.Ratio = 0;
g_stMapData.PsidOffset = 6;
MAP_LOG_INFO("<<<TRACE>>> bytesLeftOut : %u", bytesLeftOut);
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
source/DHCPMgrUtils/dhcpmgr_map_apis.c:462
- DhcpMgr_MapParseOptResponse no longer sets map->ratio, but the RBUS path still reads mapt->ratio to populate MapRatio (e.g., dhcpmgr_rbus_apis.c:216). That makes the published ratio depend on the caller having zero-initialized the ipc_map_data_t. To keep this API deterministic and aligned with the new design (DHCPManager publishes ratio=0 and WanManager derives the real ratio), explicitly set map->ratio = 0 here.
map->v4Len = g_stMapData.RuleIPv4PrefixLen;
map->psidOffset = g_stMapData.PsidOffset;
map->psidLen = g_stMapData.PsidLen;
map->psid = g_stMapData.Psid;
map->iapdPrefixLen = g_stMapData.PdIPv6PrefixLen;
RDKB-65989: Move MAP-T ratio calculation to WanManager from DHCPManager
Reason for change: Remove duplicated ratio computation from DHCPManager. DHCPManager now sends ratio=0 in the rbus event; WanManager derives ratio from psidLen as the single authoritative owner.
Test Procedure: Verify "sysevent get mapt_ratio" and Device.MAP.Domain.1.Rule.1.X_RDKCENTRAL-COM_Ratio / Device.DHCPv6.Client.1.X_RDKCENTRAL-COM_RcvOption.MapRatio is correctly set by WanManager after MAPT is configured.
Risks: Low
Priority: P1
Signed-off-by: Sivaraj_Sivalingam@comcast.com