Skip to content

fpmsyncd: Add RIB/FIB processing support#4419

Open
GaladrielZhao wants to merge 1 commit intosonic-net:masterfrom
GaladrielZhao:ribfib/nhg_full_processing
Open

fpmsyncd: Add RIB/FIB processing support#4419
GaladrielZhao wants to merge 1 commit intosonic-net:masterfrom
GaladrielZhao:ribfib/nhg_full_processing

Conversation

@GaladrielZhao
Copy link
Copy Markdown
Contributor

What I did
This commit introduces support for processing NextHopGroupFull messages with sonic-fib in fpmsyncd when RIB/FIB functionality is enabled.

The implementation adds a new device metadata configuration option "nhg_fib" which can be set to "enabled" to activate the RIB/FIB feature. When this option is enabled, fpmsyncd will handle the new netlink message types RTM_NEWNHGFIB and RTM_DELNHGFIB from zebra.

For decoding the NextHopGroupFull JSON data received from zebra, the code utilizes the sonic-fib library's from_json function to parse the JSON string and construct NextHopGroupFull objects. These objects are then forwarded to the NHG Manager for further processing.

The route handling logic has also been adapted to work correctly when RIB/FIB is enabled. When processing routes that reference next hop groups by ID, fpmsyncd now queries the NHG Manager's RIB NHG table to retrieve the corresponding RIBNHGEntry. This allows proper mapping between zebra's NHG IDs and SONiC's internal NHG IDs, and handles both single next-hop and multi-next-hop scenarios appropriately.

Why I did it
To support for processing NextHopGroupFull messages with sonic-fib in fpmsyncd when RIB/FIB functionality is enabled.

How I verified it

  • PhoenixWing test
  • UT will be added later

This commit introduces support for processing NextHopGroupFull messages
with sonic-fib in fpmsyncd when RIB/FIB functionality is enabled.

The implementation adds a new device metadata configuration option
"nhg_fib" which can be set to "enabled" to activate the RIB/FIB feature.
When this option is enabled, fpmsyncd will handle the new netlink message
types RTM_NEWNHGFIB and RTM_DELNHGFIB from zebra.

For decoding the NextHopGroupFull JSON data received from zebra, the
code utilizes the sonic-fib library's from_json function to parse the
JSON string and construct NextHopGroupFull objects. These objects are
then forwarded to the NHG Manager for further processing.

The route handling logic has also been adapted to work correctly when
RIB/FIB is enabled. When processing routes that reference next hop
groups by ID, fpmsyncd now queries the NHG Manager's RIB NHG table
to retrieve the corresponding RIBNHGEntry. This allows proper mapping
between zebra's NHG IDs and SONiC's internal NHG IDs, and handles both
single next-hop and multi-next-hop scenarios appropriately.

Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
@GaladrielZhao GaladrielZhao requested a review from prsunny as a code owner March 31, 2026 15:52
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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.

2 participants