Skip to content

Aft 1.1 fix - #4950

Open
manan-patel wants to merge 15 commits into
openconfig:mainfrom
manan-patel:AFT-1.1_fix
Open

manan-patel wants to merge 15 commits into
openconfig:mainfrom
manan-patel:AFT-1.1_fix

Conversation

@manan-patel

Copy link
Copy Markdown
Contributor

No description provided.

@manan-patel
manan-patel requested review from a team as code owners December 21, 2025 22:29
@OpenConfigBot

OpenConfigBot commented Dec 21, 2025 •

Copy link
Copy Markdown

Pull Request Functional Test Report for #4950 / e6ef7b2

Virtual Devices

Device Test Status Test Documentation Job Raw Log
Arista cEOS status
AFT-1.1: pending authorization
AFT-1.1: AFTs Base
Cisco 8000E status
AFT-1.1: pending authorization
AFT-1.1: AFTs Base
Cisco XRd status
AFT-1.1: pending authorization
AFT-1.1: AFTs Base
Juniper ncPTX status
AFT-1.1: pending authorization
AFT-1.1: AFTs Base
Nokia SR Linux status
AFT-1.1: pending authorization
AFT-1.1: AFTs Base
Openconfig Lemming status
AFT-1.1: pending authorization
AFT-1.1: AFTs Base

Hardware Devices

Device Test Status Test Documentation Raw Log
Arista status
AFT-1.1: pending authorization
AFT-1.1: AFTs Base
Cisco status
AFT-1.1: pending authorization
AFT-1.1: AFTs Base
Juniper status
AFT-1.1: pending authorization
AFT-1.1: AFTs Base
Nokia status
AFT-1.1: pending authorization
AFT-1.1: AFTs Base

Help

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @manan-patel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces several key improvements to AFT (Address Family Table) tests. It enhances test flexibility by allowing dynamic IPv6 subnet mask adjustments based on device deviations, refines interface state manipulation for more reliable churn simulations, and corrects a bug in the AFT cache to ensure accurate next-hop group data. These changes collectively aim to improve the stability and correctness of network device testing, particularly for BGP and AFT convergence scenarios.

Highlights

  • IPv6 Subnet Mask Flexibility: Introduced a new deviation subnet_mask_change to allow dynamic adjustment of IPv6 subnet mask length (from /128 to /64) in BGP tests, accommodating devices with different subnet mask requirements.
  • Enhanced Interface Churn Simulation: Switched the method for controlling interface states (up/down) during churn tests from tc.otgInterfaceState to gnmi.Replace, providing a more robust way to simulate interface changes.
  • AFT Cache Next-Hop Deduplication: Fixed a bug in the AFT cache parsing logic to ensure that next-hop IDs are unique, preventing duplicates from being added to the NHIDs list and improving the accuracy of next-hop group representation.
  • AFT Convergence Time Adjustment: Increased the aftConvergenceTime constant from 20 minutes to 30 minutes, potentially allowing more time for AFT convergence in tests.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new deviation, SubnetMaskChange, to allow for different IPv6 prefix lengths in the AFT base test. The changes include adding new constants for different prefix lengths, modifying the test logic to select the prefix length based on the deviation, and defining the new deviation in the proto and Go files. Additionally, there's a fix in aft_cache.go to handle duplicate next-hop IDs.

My review has identified a critical bug in afts_base_test.go where interfaces are incorrectly disabled instead of being enabled, which will cause test failures. I've also pointed out several medium-severity issues, including a redundant else block, and a failure to adhere to the repository style guide for deviation definitions by omitting a required issue tracker URL. There are also opportunities to improve comment clarity for the new deviation.

Comment thread feature/afts/otg_tests/afts_base/afts_base_test.go
Comment thread feature/afts/otg_tests/afts_base/afts_base_test.go
Comment thread feature/afts/otg_tests/afts_base/afts_base_test.go Outdated
Comment thread internal/deviations/deviations.go Outdated
Comment on lines +1806 to +1809
// SetSubnetMaskChange returns true if device requires changing subnet mask length
func SubnetMaskChange(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetSubnetMaskChange()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the repository style guide, deviation accessor functions must include a comment with a URL to an issue tracker. This helps in tracking the removal of the deviation. Please add the issue tracker URL.

Additionally, the function comment // SetSubnetMaskChange... is slightly misleading as the function name is SubnetMaskChange. It's better to keep them consistent for clarity.

Suggested change
// SetSubnetMaskChange returns true if device requires changing subnet mask length
func SubnetMaskChange(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetSubnetMaskChange()
}
// SubnetMaskChange returns true if device requires changing subnet mask length.
// https://issuetracker.google.com/issues/xxxxx
func SubnetMaskChange(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetSubnetMaskChange()
}
References
  1. The repository style guide requires that accessor functions for deviations include a comment with a URL to an issue tracker. This is specified in lines 83-86 of the guide. (link)

Comment thread proto/metadata.proto Outdated
Comment on lines +1072 to +1073
// SetSubnetMaskChange returns true if it needs to be changed
bool subnet_mask_change = 358;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment // SetSubnetMaskChange returns true if it needs to be changed is inconsistent with the field name subnet_mask_change and is a bit vague. A more descriptive comment would improve clarity for developers using this deviation.

Suggested change
// SetSubnetMaskChange returns true if it needs to be changed
bool subnet_mask_change = 358;
// SubnetMaskChange indicates whether the IPv6 subnet mask length needs to be changed for the test.
bool subnet_mask_change = 358;

@coveralls

coveralls commented Dec 21, 2025 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 21276411438

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 7 (0.0%) changed or added relevant lines in 1 file are covered.
  • 766 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.006%) to 9.907%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/telemetry/aftcache/aft_cache.go 0 7 0.0%
Files with Coverage Reduction New Missed Lines %
internal/deviations/deviations.go 7 0.0%
internal/cfgplugins/bgp.go 43 0.0%
proto/metadata_go_proto/metadata.pb.go 716 0.0%
Totals Coverage Status
Change from base Build 21269668258: -0.006%
Covered Lines: 2227
Relevant Lines: 22479

💛 - Coveralls

Comment thread proto/metadata.proto Outdated
bool config_acl_oc_unsupported = 357;

// SetSubnetMaskChange returns true if it needs to be changed
bool subnet_mask_change = 358;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manan-patel, Can you kindly elaborate why is this deviation is needed and also create bug with the details so that we can review and track the changes if needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we have /128 subnet mask for Ipv6, we use CEM resources. With case BGP v6 routes, those resources are getting exhausted.

  • cmd to validate the status
    show controllers npu debugshell 0 "script resource_usage" location 0/7/CPU0 | i CENTRAL_EM

with /64 (not entire ip match) LPM resources are used

show controllers npu debugshell 0 "script resource_usage" location 0/7/CPU0 | i LPM

We can control the allocation across CEM and LPM using hw-module CLIs; however, there are inherent limitations, and these CLIs must be configured with the appropriate profile in mind

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make 900K 64 and 100K /128 routes then.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Param, we have validated locally 900k /64 and 100k /128 routes. Should we uplift the FNT to cover the combination?

Comment thread feature/afts/otg_tests/afts_base/metadata.textproto
@ksgireesha

Copy link
Copy Markdown

Hi @manan-patel, could you please resolve the merge conflicts and rebase the branch so the checks turn green?

@ashishpawar-google

Copy link
Copy Markdown
Contributor

Hi @manan-patel , Please rebase / squash the commits so the commit history remains clean and only includes test changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants