Update P4rt-5.3#5505
Conversation
AmrNJ
commented
May 26, 2026
- Update logic for 400GFRPorts to be similar to the existing 100GFRPorts.
- Remove deviation deprecated_vlan_id
Summary of ChangesHello, 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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
| 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 | ||
| } | ||
| } |
There was a problem hiding this comment.
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).
| 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
- 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)
Pull Request Functional Test Report for #5505 / 92a2f6dVirtual Devices
Hardware Devices
|