RDKCOM-5619: RDKBNETWOR-99 Implement Dynamic L2/L3 Packet Marking Framework - #223
sherik-sensin wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new DSCPMark field to the WAN Interface Marking data model and attempts to load it from PSM during dynamic Marking table initialization, supporting the “dynamic L2/L3 packet marking framework” goal.
Changes:
- Added
DSCPMarkto the TR-181 Marking object (data model struct + XML parameter). - Implemented get/set/commit handling for
DSCPMarkin the DML interface layer. - Extended Marking init to read
DSCPMarkfrom PSM and skip entries where it’s missing.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.c | Reads DSCPMark from PSM during Marking init and skips invalid entries. |
| source/TR-181/middle_layer_src/wanmgr_dml_iface_apis.c | Exposes DSCPMark via TR-181 get/set and clears it on failed add. |
| source/TR-181/include/wanmgr_dml.h | Adds DSCPMark field to DML_MARKING. |
| source/TR-181/include/dmsb_tr181_psm_definitions.h | Introduces PSM key macro for DSCPMark (currently broken). |
| config/RdkWanManager.xml | Adds DSCPMark parameter to the Marking object definition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
04460b2 to
c9154a2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.c:1054
- The new DSCPMark PSM lookup treats a missing/empty DSCPMark as a hard failure: it removes the alias from the PSM Marking.List and skips creating the TR-181 table row. On upgrade, existing marking entries won’t have the new DSCPMark key yet, so this will incorrectly delete/skip otherwise valid marking entries.
else
{
WanMgr_RemoveMarkingEntryFromPSMList(acOldMarkingList, acTmpMarkingData, ulIfInstanceNumber);
CcspTraceInfo(("%s %d - PSM entry for DSCPMark Failed. Don't add Marking table Entry for token: (%s)\n", __FUNCTION__, __LINE__, token));
token = strtok( NULL, "-" );
source/TR-181/middle_layer_src/wanmgr_dml_iface_apis.c:3015
- DSCPMark is now writable via Marking_SetParamStringValue(), but it is never persisted to PSM by the marking commit path (DmlSetMarking/DmlAddMarking ultimately call DmlCheckAndProceedMarkingOperations in wanmgr_rdkbus_apis.c, which only writes Alias/SKBPort/SKBMark/EthernetPriorityMark). Since WanMgr_WanIfaceMarkingInit() now requires DSCPMark in PSM to recreate the table, DSCPMark updates will be lost across restart and can also cause marking entries to be skipped.
if (strcmp(ParamName, "DSCPMark") == 0)
{
AnscCopyString(p_Marking->DSCPMark, pString);
ret = TRUE;
}
c9154a2 to
114ed10
Compare
Reason for change: Marking table should be created dynamically based on the virtual interface marking entry from WanManager. Test Procedure: Performed WANManager Sanity test. Risks: None. Signed-off-by: Sherik Sensin A <sherik.a@telekom-digital.com>
114ed10 to
623cda6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.c:1047
- DSCPMark is read from PSM into p_Marking here, but it will not actually be reflected/persisted elsewhere: (1) DmlCheckAndProceedMarkingOperations() currently sets/deletes only Alias/SKBPort/SKBMark/EthernetPriorityMark PSM records and never writes/deletes PSM_MARKING_DSCPMARK, so DSCPMark changes via TR-181 won’t survive restart; (2) Marking_UpdateInitValue() copies only the older fields into the runtime DML list and doesn’t copy DSCPMark, so the value read here won’t be visible via Marking_GetParamStringValue(). This makes DSCPMark effectively unusable and can also cause existing tokens to be dropped if DSCPMark isn’t present in PSM.
snprintf( acPSMQuery, sizeof( acPSMQuery ), PSM_MARKING_DSCPMARK, ulIfInstanceNumber, acTmpMarkingData );
if ( ( CCSP_SUCCESS == DmlWanGetPSMRecordValue( acPSMQuery, acPSMValue ) ) && \
( strlen( acPSMValue ) > 0 ) )
{
snprintf( p_Marking->DSCPMark, sizeof( p_Marking->DSCPMark ), "%s", acPSMValue );
| if (strcmp(ParamName, "DSCPMark") == 0) | ||
| { | ||
| AnscCopyString(p_Marking->DSCPMark, pString); | ||
| ret = TRUE; | ||
| } |
Reason for change: Marking table should be created dynamically based on the virtual interface marking entry from WanManager.
Test Procedure: Performed WANManager Sanity test.
Risks: None.
Dependency:
rdkcentral/utopia#396
rdkcentral/vlan-manager#41