Skip to content

[Cisco] Support SAMPLE_PACKET in show hw-object - #1516

Closed
asrouji wants to merge 1 commit into
facebook:mainfrom
asrouji:asrouji/show-sample-packet-hw-object
Closed

asrouji wants to merge 1 commit into
facebook:mainfrom
asrouji:asrouji/show-sample-packet-hw-object

Conversation

@asrouji

@asrouji asrouji commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

fboss2 show hw-object SAMPLE_PACKET fails during argument parsing because SAMPLE_PACKET is missing from HwObjectType, even though FBOSS already creates and programs SAI sample-packet objects.

Add SAMPLE_PACKET to HwObjectType and map it to SAI_OBJECT_TYPE_SAMPLEPACKET in SaiSwitch::listObjects(). This enables both cached and uncached queries to display the sample-packet attributes, including the programmed sample rate. Also include the new type in the CLI help and argument parser coverage.

Test Plan

  • Ran pre-commit run --from-ref upstream/main --to-ref HEAD; all applicable checks passed.
  • Rebuilt the FBOSS forwarding stack with this change, zero failures.
  • Tested the updated fboss2 and SAI hardware agent binaries on a live Cisco C8501 (MORGAN800CC) and configured an ingress sFlow sample rate of 90,000. Both cached and uncached queries returned the programmed sample rate:
$ fboss2 show hw-object SAMPLE_PACKET
Object type: sample-packet
SamplePacketSaiId(540431955284459521): (SampleRate: 90000, Type: 0, Mode: 0)

$ fboss2 show hw-object SAMPLE_PACKET uncached
Object type: sample-packet
SamplePacketSaiId(540431955284459521): (SampleRate: 90000, Type: 0, Mode: 0)

@meta-cla meta-cla Bot added the CLA Signed label Aug 13, 2026
@github-actions github-actions Bot added the cisco label Aug 13, 2026
@asrouji
asrouji force-pushed the asrouji/show-sample-packet-hw-object branch from 27c2192 to b4a4f56 Compare August 13, 2026 19:04
@asrouji
asrouji marked this pull request as ready for review August 13, 2026 19:18
@asrouji
asrouji requested review from a team as code owners August 13, 2026 19:18
@srikrishnagopu

Copy link
Copy Markdown
Contributor

Please update the test plan with the test result of the sample object dump.

@srikrishnagopu
srikrishnagopu self-requested a review August 13, 2026 20:59
@asrouji

asrouji commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @srikrishnagopu, I added the command and output from the test to the PR description.

@srikrishnagopu

Copy link
Copy Markdown
Contributor

Can you please rebase ? This has conflicts.

Add SAMPLE_PACKET to HwObjectType and map it to the corresponding SAI
object type in SaiSwitch::listObjects(). This lets cached and uncached
show hw-object queries display programmed sample rates.

Include it in the CLI help and cover the fboss2 argument parsing path.
@asrouji
asrouji force-pushed the asrouji/show-sample-packet-hw-object branch from b4a4f56 to 08e3605 Compare August 16, 2026 18:34
@facebook-github-tools

Copy link
Copy Markdown

@asrouji has updated the pull request. You must reimport the pull request before landing.

@asrouji

asrouji commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

@srikrishnagopu rebase done.

I also added NEXT_HOP_GROUP_MEMBER to the show hw-object description string, it was missing there. Happy to split that out if you'd rather carry it separately.

@meta-codesync

meta-codesync Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

@srikrishnagopu has imported this pull request. If you are a Meta employee, you can view this in D116223234.

@meta-codesync meta-codesync Bot closed this in b8feccc Aug 27, 2026
@meta-codesync meta-codesync Bot added the Merged label Aug 27, 2026
@meta-codesync

meta-codesync Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

@srikrishnagopu merged this pull request in b8feccc.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants