Skip to content

[DPU] Add support for Flow bulk session get notifications#1769

Merged
lihuay merged 17 commits intosonic-net:masterfrom
vivekrnv:bulk_get_sess_notif
Mar 5, 2026
Merged

[DPU] Add support for Flow bulk session get notifications#1769
lihuay merged 17 commits intosonic-net:masterfrom
vivekrnv:bulk_get_sess_notif

Conversation

@vivekrnv
Copy link
Contributor

HLD: sonic-net/SONiC#2168

  1. Add support for Flow Bulk Session get notification
  2. Flow Dump events are directly written to a file from syncd and not relayed to orchgent
  3. Only FINISHED_EVENT's are relayed to orchagent
  4. Add UT's and verified by creating session events
Note: Google Test filter = *Flow*
[==========] Running 5 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 5 tests from NotificationFlowBulkGetSessionEvent
[ RUN      ] NotificationFlowBulkGetSessionEvent.ctr
[       OK ] NotificationFlowBulkGetSessionEvent.ctr (0 ms)
[ RUN      ] NotificationFlowBulkGetSessionEvent.getSwitchId
[       OK ] NotificationFlowBulkGetSessionEvent.getSwitchId (0 ms)
[ RUN      ] NotificationFlowBulkGetSessionEvent.getAnyObjectId
[       OK ] NotificationFlowBulkGetSessionEvent.getAnyObjectId (0 ms)
[ RUN      ] NotificationFlowBulkGetSessionEvent.processMetadata
[       OK ] NotificationFlowBulkGetSessionEvent.processMetadata (0 ms)
[ RUN      ] NotificationFlowBulkGetSessionEvent.executeCallback
[       OK ] NotificationFlowBulkGetSessionEvent.executeCallback (0 ms)
[----------] 5 tests from NotificationFlowBulkGetSessionEvent (0 ms total)

[----------] Global test environment tear-down
[==========] 5 tests from 1 test suite ran. (0 ms total)
[  PASSED  ] 5 tests.

vkarri@300929d3c803:/sonic/src/sonic-sairedis/unittest/syncd$ ./tests --gtest_filter="*Flow*"
Note: Google Test filter = *Flow*
[==========] Running 15 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 1 test from NotificationHandler
[ RUN      ] NotificationHandler.NotificationFlowBulkGetSessionEventTest
[       OK ] NotificationHandler.NotificationFlowBulkGetSessionEventTest (0 ms)
[----------] 1 test from NotificationHandler (0 ms total)

[----------] 14 tests from FlowDumpTest
[ RUN      ] FlowDumpTest.FlowDumpSerializer_SingleFlowEntry
[       OK ] FlowDumpTest.FlowDumpSerializer_SingleFlowEntry (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpSerializer_MultipleFlowEntries
[       OK ] FlowDumpTest.FlowDumpSerializer_MultipleFlowEntries (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpSerializer_FinishedEvent
[       OK ] FlowDumpTest.FlowDumpSerializer_FinishedEvent (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpSerializer_WithAttributes
[       OK ] FlowDumpTest.FlowDumpSerializer_WithAttributes (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpWriter_WriteAndRead
[       OK ] FlowDumpTest.FlowDumpWriter_WriteAndRead (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpWriter_FilePathGeneration
[       OK ] FlowDumpTest.FlowDumpWriter_FilePathGeneration (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpWriter_BasePathGetterSetter
[       OK ] FlowDumpTest.FlowDumpWriter_BasePathGetterSetter (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpWriter_NullData
[       OK ] FlowDumpTest.FlowDumpWriter_NullData (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpWriter_MultipleFlows
[       OK ] FlowDumpTest.FlowDumpWriter_MultipleFlows (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpWriter_WithAttributes
[       OK ] FlowDumpTest.FlowDumpWriter_WithAttributes (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpWriter_LogRotate
[       OK ] FlowDumpTest.FlowDumpWriter_LogRotate (201 ms)
[ RUN      ] FlowDumpTest.FlowDumpSerializer_AttributeValue_EnumTypes
[       OK ] FlowDumpTest.FlowDumpSerializer_AttributeValue_EnumTypes (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpSerializer_AttributeValue_U8List
[       OK ] FlowDumpTest.FlowDumpSerializer_AttributeValue_U8List (0 ms)
[ RUN      ] FlowDumpTest.FlowDumpSerializer_AttributeValue_ExceptionHandling
[       OK ] FlowDumpTest.FlowDumpSerializer_AttributeValue_ExceptionHandling (0 ms)
[----------] 14 tests from FlowDumpTest (203 ms total)

[----------] Global test environment tear-down
[==========] 15 tests from 2 test suites ran. (203 ms total)
[  PASSED  ] 15 tests.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vivekrnv vivekrnv marked this pull request as ready for review February 14, 2026 00:59
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
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

This pull request adds support for Flow Bulk Session get notifications in the DPU (Data Processing Unit) pipeline. The implementation introduces a new mechanism where flow dump events are written directly to compressed files from syncd, while only FINISHED events are relayed to orchagent for notification. This design improves performance by avoiding the overhead of serializing and transmitting large amounts of flow data through Redis.

Changes:

  • Added flow dump infrastructure with JSON serialization and gzip compression for efficient storage
  • Implemented notification filtering logic to write flow entries to disk while only forwarding FINISHED events
  • Extended notification queue to support auxiliary data (flow dump JSON lines) alongside standard notifications
  • Added comprehensive unit tests covering serialization, file I/O, log rotation, and notification handling

Reviewed changes

Copilot reviewed 42 out of 42 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
syncd/FlowDump.{h,cpp} Core flow dump serialization and file writing logic with log rotation
syncd/NotificationHandler.{h,cpp} Collects flow entry events and enqueues with auxiliary data
syncd/NotificationProcessor.{h,cpp} Processes flow notifications, writes dumps to disk, filters FINISHED events
syncd/NotificationQueue.{h,cpp} Extended to support auxiliary data alongside notifications
syncd/SwitchNotifications.{h,cpp} Added callback registration for flow bulk get session events
meta/NotificationFlowBulkGetSessionEvent.{h,cpp} Notification class for flow bulk get session events
meta/Meta.{h,cpp} Validation logic for flow bulk get session event notifications
meta/SaiSerialize.cpp Serialization/deserialization for flow bulk get session event notifications
vslib/SwitchStateBase.cpp Registered flow bulk get session event notification in virtual switch
unittest/syncd/TestFlowDump.cpp Comprehensive tests for serialization, file I/O, and log rotation
unittest/syncd/TestNotificationHandler.cpp Tests for notification handler with flow events
unittest/meta/TestSaiSerialize.cpp Tests for serialization/deserialization logic
proxylib/Proxy.{h,cpp} Proxy notification forwarding support
saiplayer/SaiPlayer.{h,cpp} Player notification handling support
pyext/pysairedis.{i,cpp} Python bindings for flow bulk get session events
*/Makefile.am Added -lz linker flag for zlib compression support

@vivekrnv vivekrnv force-pushed the bulk_get_sess_notif branch from 6cf5250 to 3aa0222 Compare February 14, 2026 08:29
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

yue-fred-gao and others added 5 commits February 18, 2026 04:18
why
currently vpp doesn't support binding multiple ACL tables. Each table is appended with default permit-all rules. With multiple tables, this may cause acl matched by such rules and skip the actual rule to make in the tables after this one.

what this PR does
remove the default permit-all rules for each table
If a table is empty, create a dummy rule that won't match any traffic because vpp doesn't allow empty table. The dummy rule matches dest-ip to 0.0.0.0/32
sort all the tables by priority in the table group. vpp doesn't support parallel matching
added catch-all acl group to the end. vpp default behavior of no match is drop but sonic is accept.
Fix sonic-vpp crashing due to race condition during stats pull. If the interface to get stats has been removed, stat_segment_ls_r returns null.

Signed-off-by: Yue Gao <[email protected]>
Signed-off-by: Vivek Reddy <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Vivek Reddy <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Vivek Reddy <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Vivek Reddy <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Vivek Reddy <[email protected]>
@vivekrnv vivekrnv force-pushed the bulk_get_sess_notif branch from ff1ea46 to 0aaee63 Compare February 18, 2026 02:18
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Vivek Reddy <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vivekrnv
Copy link
Contributor Author

/azpw run Azure.sonic-sairedis

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-sairedis

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny
Copy link
Contributor

prsunny commented Mar 2, 2026

@saiarcot895 , can you check and merge the PR?

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vivekrnv
Copy link
Contributor Author

vivekrnv commented Mar 5, 2026

@lihuay Can you merge the changes?

@lihuay lihuay merged commit 3679821 into sonic-net:master Mar 5, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.