Skip to content

Update P4rt-5.3#5505

Draft
AmrNJ wants to merge 1 commit into
mainfrom
AmrNJ-patch-1
Draft

Update P4rt-5.3#5505
AmrNJ wants to merge 1 commit into
mainfrom
AmrNJ-patch-1

Conversation

@AmrNJ
Copy link
Copy Markdown
Contributor

@AmrNJ AmrNJ commented May 26, 2026

  1. Update logic for 400GFRPorts to be similar to the existing 100GFRPorts.
  2. Remove deviation deprecated_vlan_id

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 updates the test infrastructure to better support 400G-FR4 network interfaces. By aligning the configuration logic for 400G ports with the established patterns for 100G ports, the changes ensure consistent interface initialization and improved link stability during testing.

Highlights

  • 400G-FR4 Port Support: Updated the traceroute packet-in test to include support for 400G-FR4 ports, mirroring the existing logic for 100G-FR ports.
  • Link Configuration: Configured auto-negotiation settings specifically for 400G-FR4 ports to ensure stable link establishment and prevent clock-drift.
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 the 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 counterproductive. 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.

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.

Copy link
Copy Markdown
Contributor

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

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 adds support for 400G-FR4 ports in the traceroute packet-in test, including auto-negotiation and speed configurations. The reviewer recommended wrapping the duplex mode, auto-negotiate, and port speed configurations on the DUT with their respective portability deviations to ensure compatibility across different hardware platforms.

Comment on lines +393 to 403
if p.PMD() == ondatra.PMD100GBASEFR || p.PMD() == ondatra.PMD400GBASEFR4 {
e := i.GetOrCreateEthernet()
e.AutoNegotiate = ygot.Bool(false)
e.DuplexMode = oc.Ethernet_DuplexMode_FULL
e.PortSpeed = oc.IfEthernet_ETHERNET_SPEED_SPEED_100GB
if p.PMD() == ondatra.PMD100GBASEFR {
e.AutoNegotiate = ygot.Bool(true) // Enable autoneg on 100G Single-Lambda FR!
e.PortSpeed = oc.IfEthernet_ETHERNET_SPEED_SPEED_100GB
} else {
e.AutoNegotiate = ygot.Bool(false) // Keep disabled on 400G PAM4 to prevent clock-drift
e.PortSpeed = oc.IfEthernet_ETHERNET_SPEED_SPEED_400GB
}
}
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

To ensure portability across different hardware platforms and vendors, we should guard the configuration of DuplexMode, AutoNegotiate, and PortSpeed with their respective deviations: deviations.DuplexModeUnsupported(dut), deviations.AutoNegotiateUnsupported(dut), and deviations.PortSpeedUnsupported(dut).

Suggested change
if p.PMD() == ondatra.PMD100GBASEFR || p.PMD() == ondatra.PMD400GBASEFR4 {
e := i.GetOrCreateEthernet()
e.AutoNegotiate = ygot.Bool(false)
e.DuplexMode = oc.Ethernet_DuplexMode_FULL
e.PortSpeed = oc.IfEthernet_ETHERNET_SPEED_SPEED_100GB
if p.PMD() == ondatra.PMD100GBASEFR {
e.AutoNegotiate = ygot.Bool(true) // Enable autoneg on 100G Single-Lambda FR!
e.PortSpeed = oc.IfEthernet_ETHERNET_SPEED_SPEED_100GB
} else {
e.AutoNegotiate = ygot.Bool(false) // Keep disabled on 400G PAM4 to prevent clock-drift
e.PortSpeed = oc.IfEthernet_ETHERNET_SPEED_SPEED_400GB
}
}
if p.PMD() == ondatra.PMD100GBASEFR || p.PMD() == ondatra.PMD400GBASEFR4 {
e := i.GetOrCreateEthernet()
if !deviations.DuplexModeUnsupported(dut) {
e.DuplexMode = oc.Ethernet_DuplexMode_FULL
}
if !deviations.AutoNegotiateUnsupported(dut) {
if p.PMD() == ondatra.PMD100GBASEFR {
e.AutoNegotiate = ygot.Bool(true)
} else {
e.AutoNegotiate = ygot.Bool(false)
}
}
if !deviations.PortSpeedUnsupported(dut) {
if p.PMD() == ondatra.PMD100GBASEFR {
e.PortSpeed = oc.IfEthernet_ETHERNET_SPEED_SPEED_100GB
} else {
e.PortSpeed = oc.IfEthernet_ETHERNET_SPEED_SPEED_400GB
}
}
}
References
  1. Avoid using "dut.Vendor()" for vendor-specific logic or configurations in tests. Instead, use the "deviations" package to maintain test abstraction and portability across different vendors. (link)

@OpenConfigBot
Copy link
Copy Markdown

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