Commit 36c598c
Make fpmsyncd capable of handling route replace semantics (#3872)
* Make fpmsyncd capable of handling route replace semantics
The FRR's zebra has two dataplane providers. One of them programs routes
into the kernel, while the other one sends routes towards sonic. This
one sends routes to fpmsyncd. Currently, this sonic dataplane provider
does not make use of the route replace semantics. This means that any
change to an existing route is first sent as a delete and then a new add
notification is sent later. The ProducerStateTable mechanism is used by
fpmsyncd to update APPL DB. This coalesces the delete+update into a
single set operation and hence orchagent only sees a set.
This checkin makes code changes to fpmsyncd so that it can handle a
single set operation from the sonic dataplane provider. The crux of the
change is to reset any field that is not being set very explicitly. This
will have the effect of nullifying any previously set values in that
field.
A followup PR would add support for use-route-replace semantics in the
FRR's sonic dataplane provider.
* Skip kernel version check (#3877)
For CI pipeline purposes, loosen the requirement of needing an exact/matching kernel source for the currently-running kernel version.
* Make fpmsyncd capable of handling route replace semantics
ISSUE: sonic-net/sonic-buildimage#23940
Address review comments from eddieruan-alibaba.
Changed the code to make an atomic removal + re-add.
* fpmsyncd crashes during execution of sonic-mgmt script vxlan/test_vnet_bgp_route_precedence.py (#3879)
This is a revise of PR #3871
Problem:
Orchagent sends incorrectly formatted info via APPL_DB_ROUTE_TABLE_RESPONSE_CHANNEL to fpmsyncd process and fpmsyncd crashes.
Root cause:
The function RouteOrch::removeRoutePrefix() is called from vnetorch.cpp when a vnet route is added and we want to delete the corresponding bgp route from hardware (as vnet has higher precedence than bgp).
The function creates a fake RouteBulkContext entry to satisfy the API signature.
The issue is that it wrongly adds the table name at the beginning of the key field. This causes an issue when fib suppression is enabled as it uses the key field.
See the stacktrace below:
RouteOrch::publishRouteState()
RouteOrch::removeRoutePost()
RouteOrch::removeRoutePrefix()
VNetRouteOrch::doRouteTask()
VNetRouteOrch::handleTunnel()
VNetRouteOrch::addOperation()
What I did
Set the RouteBulkContext key to just the prefix, instead of the original "ROUTE_TABLE:" + prefix.
Why I did it
it was set wrongly.
How I verified it
Re-run vxlan/test_vnet_bgp_route_precedence.py script and it passed.
Details if related
The issue is seen when running the
sonic-mgmt vxlan/test_vnet_bgp_route_precedence.py script on a testbed with "suppress-fib-pending": "enabled"
Here is an example of a bad entry from redis MONITOR
1757021230.758233 [14 unix:/var/run/redis/redis.sock] "PUBLISH" "APPL_DB_ROUTE_TABLE_RESPONSE_CHANNEL" "["SWSS_RC_SUCCESS","ROUTE_TABLE:20.1.0.0/24","err_str","SWSS_RC_SUCCESS"]"
Here is a good one:
1757021219.090477 [14 unix:/var/run/redis/redis.sock] "PUBLISH" "APPL_DB_ROUTE_TABLE_RESPONSE_CHANNEL" "["SWSS_RC_SUCCESS","22.1.0.0/24","err_str","SWSS_RC_SUCCESS"]"
* [ssw][ha] add `ha_term` field to ha_scope_state_db (#3851)
What I did
Take flow_version field from ha scope event and write it into dpu_state_db entry ha_term per HLD.
https://github.com/opencomputeproject/SAI/blob/b925fc0f0fc8c620eea7d9dead7fc99e33b7b44e/experimental/saiswitchextensions.h#L113
Why I did it
Otherwise hamgrd won't be able to deserialize the state db table (due to missing fields).
How I verified it
UTs.
* Avoid setting buffer profile attribute twice (#3873)
Signed-off-by: Stephen Sun <stephens@nvidia.com>
* [fixbug]: Fix orchagent crashed issue due to empty counters or stats in HFTorch (#3865)
What I did
This pull request improves the robustness of the high frequency telemetry (HFT) group creation logic and adds a new test to cover edge cases with empty fields. The main changes ensure that empty object_names and object_counters are handled correctly, and that the system behaves as expected when the profile is disabled.
Updated HFTelOrch::groupTableSet in hftelorch.cpp to only process object_names and object_counters if they are present and non-empty, preventing unnecessary splitting and processing of empty strings.
Why I did it
If the counters or objects is empty, the orchagent will get crashed. Because the boost::split will still generate an empty item in the vector from the empty string.
How I verified it
Added a new test test_hft_empty_fields_with_disabled_status in test_hft.py to verify that no counter subscriptions are created when both object_names and object_counters are empty and the profile is disabled, ensuring correct behavior in edge cases.
Signed-off-by: Ze Gan <ganze718@gmail.com>
* [countersyncd]: Init counter syncd module (#3796)
What I did
This pull request introduces a new Rust-based application, countersyncd, designed for high-frequency telemetry data processing in SONiC environments. It also includes updates to the build pipeline to support the new application. The key changes are grouped into two themes: application implementation and build pipeline updates.
Application Implementation:
New Rust Application (countersyncd):
Added countersyncd as a new Rust application for processing telemetry data, including its main entry point (countersyncd/src/main.rs) and library modules for actors and messaging (countersyncd/src/lib.rs).
Defined actors (NetlinkActor, SwssActor, IpfixActor, and StatsReporterActor) and their communication channels for telemetry data processing.
Introduced command-line argument parsing using clap and logging configuration with env_logger.
Actor and Messaging Modules:
Added actor modules (netlink, ipfix, stats_reporter, and swss) for handling specific telemetry tasks.
Implemented messaging structures for inter-actor communication, including SocketBufferMessage, IPFixTemplatesMessage, and NetlinkCommand.
Build Pipeline Updates:
Pipeline Modifications:
Updated .azure-pipelines/build-template.yml to install and configure Redis for the build environment.
Added a step to run unit tests for countersyncd using cargo test.
Dependencies for countersyncd:
Defined dependencies in countersyncd/Cargo.toml, including libraries for async runtime (tokio), YAML parsing (yaml-rust), and logging (log, env_logger).
These changes collectively enable the development and integration of countersyncd into the SONiC platform while ensuring proper build and test support.
Why I did it
This module is required by the document: https://github.com/sonic-net/SONiC/blob/master/doc/high-frequency-telemetry/high-frequency-telemetry-hld.md
How I verified it
This PR includes the unittest for countersyncd, Check Azp status
Signed-off-by: Ze Gan <ganze718@gmail.com>
* [swss] Install yang related deb to align with latest libswsscommon requirement (#3888)
What I did
Install the yang related deb to make it align with the latest libswsscommon deb file.
Why I did it
The vstest will fail if not update with requirement yang file
How I verified it
Verify with vs test
signed-off-by: jianquanye@microsoft.com
* Cleanup the delete functions by simplifying it.
* Address review comments from dgsudharsan
Address review comments in #3872 (comment)
---------
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Ze Gan <ganze718@gmail.com>
Signed-off-by: jianquanye@microsoft.com
Co-authored-by: Saikrishna Arcot <sarcot@microsoft.com>
Co-authored-by: ShiyanWangMS <shiyanwang@microsoft.com>
Co-authored-by: Jing Zhang <zhangjing@microsoft.com>
Co-authored-by: Stephen Sun <5379172+stephenxs@users.noreply.github.com>
Co-authored-by: Ze Gan <ganze718@gmail.com>
Co-authored-by: jingwenxie <jingwenxie@microsoft.com>1 parent 5600c4c commit 36c598c
4 files changed
Lines changed: 407 additions & 132 deletions
0 commit comments