Skip to content

Introduce qos_ft deviation to apply functional translator options to QoS counter queries#5187

Merged
RishabhAgarwal-2001 merged 3 commits intomainfrom
rishabh/ciscoxr-qos-ft
Mar 11, 2026
Merged

Introduce qos_ft deviation to apply functional translator options to QoS counter queries#5187
RishabhAgarwal-2001 merged 3 commits intomainfrom
rishabh/ciscoxr-qos-ft

Conversation

@RishabhAgarwal-2001
Copy link
Copy Markdown
Contributor

Primary Reviewer: @rohit-rp / @AmrNJ / @ram-mac

Description

The ciscoxr_qos_ft functional translator is used for translating native paths from CiscoXR devices to OC paths. Out of the 6 paths translated by this translator, our changes in this PR test that the following four paths are working when queried through the functional translator -

  • qos/interfaces/interface/output/queues/queue/state/dropped-octets
  • qos/interfaces/interface/output/queues/queue/state/dropped-pkts
  • qos/interfaces/interface/output/queues/queue/state/transmit-octets
  • qos/interfaces/interface/output/queues/queue/state/transmit-pkts

Testing

Ensured that the test passes successfully on the Cisco device. No testing was done for other vendors since for them changes here should be no-op.

@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 enhances the QoS testing framework by integrating functional translator capabilities for QoS counter queries. It introduces a mechanism to specify a functional translator via a deviation, ensuring that OpenConfig paths for QoS metrics are correctly translated to native device paths, particularly for CiscoXR devices. This change allows for accurate retrieval and validation of QoS counters like transmitted and dropped packets/octets, improving the robustness of QoS feature tests.

Highlights

  • Functional Translator Deviation: Introduced a new qos_ft deviation to specify the functional translator to be used for QoS counter queries, specifically ciscoxr-qos-ft for CiscoXR devices.
  • QoS Counter Query Updates: Modified QoS counter queries for TransmitPkts, TransmitOctets, DroppedPkts, and DroppedOctets in qos_basic_test.go to utilize the newly introduced functional translator options.
  • New Helper Function: Added a helper function getOptsForFunctionalTranslator to retrieve ygnmi.Option instances for a given functional translator name, streamlining the application of translator options to queries.
Changelog
  • feature/qos/otg_tests/qos_basic_test/metadata.textproto
    • Added qos_ft: "ciscoxr-qos-ft" to the platform deviations.
  • feature/qos/otg_tests/qos_basic_test/qos_basic_test.go
    • Imported the registrar package for functional translators.
    • Introduced getOptsForFunctionalTranslator function to create ygnmi options for functional translators.
    • Updated gnmi.Watch and gnmi.Get calls for QoS counter queries to use functional translator options.
    • Modified gnmiOpts function to incorporate functional translator options.
  • internal/deviations/deviations.go
    • Added QosFt function to retrieve the QoS functional translator deviation string.
  • proto/metadata.proto
    • Added a new qos_ft string field to the Metadata message for specifying QoS functional translators.
Activity
  • No human activity has been recorded on this pull request yet.
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.

@OpenConfigBot
Copy link
Copy Markdown

OpenConfigBot commented Mar 2, 2026

Pull Request Functional Test Report for #5187 / b71141c

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
DP-1.14: QoS basic test
dc3cbb3d Log
Cisco 8000E status
DP-1.14: QoS basic test
84736ff5 Log
Cisco XRd status
DP-1.14: QoS basic test
f2b61e67 Log
Juniper ncPTX status
DP-1.14: QoS basic test
d342c164 Log
Nokia SR Linux status
DP-1.14: QoS basic test
8e68e0f2 Log
Openconfig Lemming status
DP-1.14: QoS basic test
20cb77df Log

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
DP-1.14: QoS basic test
Cisco 8808 status
DP-1.14: QoS basic test
Juniper PTX10008 status
DP-1.14: QoS basic test
Nokia 7250 IXR-10e status
DP-1.14: QoS basic test

Help

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 introduces a qos_ft deviation to support functional translators for QoS counter queries, specifically for CiscoXR devices. The changes are well-implemented and correctly apply the functional translator options to gnmi.Watch and gnmi.Get calls. The suggestions to improve code quality by removing an unused parameter from a new helper function are valid and align with general Go best practices.

inputIntf attrs.Attributes
}

func getOptsForFunctionalTranslator(t *testing.T, dut *ondatra.DUTDevice, functionalTranslatorName string) []ygnmi.Option {
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 dut parameter is unused and can be removed to simplify the function signature.

Suggested change
func getOptsForFunctionalTranslator(t *testing.T, dut *ondatra.DUTDevice, functionalTranslatorName string) []ygnmi.Option {
func getOptsForFunctionalTranslator(t *testing.T, functionalTranslatorName string) []ygnmi.Option {
References
  1. Functions should not have unused parameters. This is a common Go best practice for clean and maintainable code, as highlighted in style guides like Effective Go. (link)

// Get QoS egress packet counters before the traffic.
const timeout = time.Minute
isPresent := func(val *ygnmi.Value[uint64]) bool { return val.IsPresent() }
opts := getOptsForFunctionalTranslator(t, dut, deviations.QosFt(dut))
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

Removing the unused dut parameter from the getOptsForFunctionalTranslator call to align with the suggested change to the function's signature.

Suggested change
opts := getOptsForFunctionalTranslator(t, dut, deviations.QosFt(dut))
opts := getOptsForFunctionalTranslator(t, deviations.QosFt(dut))

ygnmi.WithSubscriptionMode(gpb.SubscriptionMode_SAMPLE),
ygnmi.WithSampleInterval(interval),
)
opts := getOptsForFunctionalTranslator(t, dut, deviations.QosFt(dut))
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

Removing the unused dut parameter from the getOptsForFunctionalTranslator call to align with the suggested change to the function's signature.

Suggested change
opts := getOptsForFunctionalTranslator(t, dut, deviations.QosFt(dut))
opts := getOptsForFunctionalTranslator(t, deviations.QosFt(dut))

@RishabhAgarwal-2001 RishabhAgarwal-2001 merged commit 069fef9 into main Mar 11, 2026
17 of 18 checks passed
@RishabhAgarwal-2001 RishabhAgarwal-2001 deleted the rishabh/ciscoxr-qos-ft branch March 11, 2026 08:49
ampattan pushed a commit to nokia/featureprofiles that referenced this pull request Apr 1, 2026
…o QoS counter queries (openconfig#5187)

* feat: introduce `qos_ft` deviation to apply functional translator options to QoS counter queries.

* Add Vendor Bug
nsadhasivam pushed a commit to nsadhasivam/featureprofiles that referenced this pull request Apr 6, 2026
…o QoS counter queries (openconfig#5187)

* feat: introduce `qos_ft` deviation to apply functional translator options to QoS counter queries.

* Add Vendor Bug
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.

5 participants