Skip to content

[device]: Add platform fallback to deduplicate pg_profile_lookup.ini#25737

Draft
Bojun-Feng wants to merge 2 commits intosonic-net:masterfrom
Bojun-Feng:enh/shared-pg-profile-lookup
Draft

[device]: Add platform fallback to deduplicate pg_profile_lookup.ini#25737
Bojun-Feng wants to merge 2 commits intosonic-net:masterfrom
Bojun-Feng:enh/shared-pg-profile-lookup

Conversation

@Bojun-Feng
Copy link
Contributor

@Bojun-Feng Bojun-Feng commented Feb 27, 2026

Why I did it

Related to #25716

Currently, pg_profile_lookup.ini is duplicated in every HWSKU directory, even when the file content is identical across all HWSKUs on a platform. The repo contains 258 copies of this file. This makes maintenance error-prone — any buffer tuning update requires editing N copies per platform.

How I did it

For platforms where ALL HWSKUs have byte-identical pg_profile_lookup.ini, moved the file to the platform directory and removed HWSKU-level copies. Platforms with HWSKU-specific differences were left untouched. Affected vendors: Arista, Celestica, Dell, FS, Mellanox/Nvidia, Nokia, Virtual, Wistron

Modified the two buffermgrd.sh launch scripts to implement a fallback lookup order for pg_profile_lookup.ini.

The platform directory (/usr/share/sonic/platform) is already mounted into all containers via docker_image_ctl.j2, so no infrastructure changes are needed.

How to verify it

  1. New fallback (deduped platforms): On a deduped platform (e.g., x86_64-arista_7060_cx32s), verify buffermgrd starts successfully.

  2. VS platform test: Run VS image tests — the virtual platform's files were also deduped.

  3. Verify no regression on MIXED platforms: Platforms like x86_64-arista_7060x6_64pe (which have differing files per HWSKU) are untouched and continue to use HWSKU-level files.

Description for the changelog

Add platform-level fallback for pg_profile_lookup.ini and deduplicate identical copies across platforms, removed 53 duplicate files.

* Add HWSKU-first, platform-fallback logic to buffermgrd.sh
* If pg_profile_lookup.ini is not found in HWSKU directory,
  fall back to the platform directory (/usr/share/sonic/platform/)
* Preserve original HWSKU path as final fallback for error logging

Signed-off-by: Bojun Feng <[email protected]>
* For 25 platforms where all HWSKUs have identical pg_profile_lookup.ini,
  move the file to the platform directory and remove HWSKU-level copies
* Platforms with HWSKU-specific differences are left untouched
* This works with the buffermgrd.sh fallback added in the previous commit:
  HWSKU dir -> platform dir -> original HWSKU path (error)
* Net reduction: 53 duplicate files removed (258 -> 205)

Affected vendors: Arista, Celestica, Dell, FS, Mellanox/Nvidia, Nokia,
Virtual, Wistron

Signed-off-by: Bojun Feng <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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