[vs] Enable SAI_VS_USE_CONFIGURED_SPEED_AS_OPER_SPEED in VS platform sai.profile#25428
Conversation
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
fcf18f7 to
e105505
Compare
|
/azp run Azure.sonic-buildimage |
|
Updated to also add Previously the PR only patched Verified on a live VS VM: after adding this flag to the Force10-S6000 sai.profile and restarting syncd, all ports correctly report 40G instead of 4294967295 (0xFFFFFFFF). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Enables the VS SAI profile flag SAI_VS_USE_CONFIGURED_SPEED_AS_OPER_SPEED=true so VS reports operational port speed based on the configured speed (from SAI_PORT_ATTR_SPEED) instead of relying on broken sysfs link speed in virtio environments.
Changes:
- Add
SAI_VS_USE_CONFIGURED_SPEED_AS_OPER_SPEED=trueto the common VS SAI profile template. - Add the same flag to VS platform
sai.profilefiles for SONiC-VM, brcm_gearbox_vs, and MSFT multi-ASIC VS HWSKUs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/sonic-device-data/src/sai.vs_profile | Adds configured-speed-as-oper-speed behavior to the common VS SAI profile. |
| device/virtual/x86_64-kvm_x86_64-r0/SONiC-VM/sai.profile | Enables configured speed as oper speed for the default SONiC-VM VS HWSKU profile. |
| device/virtual/x86_64-kvm_x86_64-r0/brcm_gearbox_vs/sai.profile | Enables configured speed as oper speed for the gearbox VS HWSKU profile. |
| device/virtual/x86_64-kvm_x86_64_4_asic-r0/msft_four_asic_vs/0/sai.profile | Enables configured speed as oper speed for 4-ASIC VS (ASIC 0 profile). |
| device/virtual/x86_64-kvm_x86_64_6_asic-r0/msft_multi_asic_vs/0/sai.profile | Enables configured speed as oper speed for 6-ASIC VS (ASIC 0 profile). |
e105505 to
093273a
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
8bfd07d to
e053921
Compare
|
Updated to also add Good catch from the Copilot review — without this, the speed flag would be overwritten when start.sh runs on those platforms. |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
e053921 to
62be1e4
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
62be1e4 to
04c02f6
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
04c02f6 to
0e5f794
Compare
|
Azure Pipelines successfully started running 1 pipeline(s). |
0e5f794 to
a236ae6
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
a236ae6 to
634a8d7
Compare
yxieca
left a comment
There was a problem hiding this comment.
LGTM. AI agent on behalf of Ying.
yxieca
left a comment
There was a problem hiding this comment.
LGTM. AI agent on behalf of Ying.
yxieca
left a comment
There was a problem hiding this comment.
AI agent on behalf of Ying.
yxieca
left a comment
There was a problem hiding this comment.
AI agent on behalf of Ying. Quick review: [vs]. No issues found.
yxieca
left a comment
There was a problem hiding this comment.
AI agent on behalf of Ying. Quick review: [vs] Enable SAI_VS_USE_CONFIGURED_SPEED_AS_OPER_SPEED in VS platform sai.profile. No issues found.
634a8d7 to
cb2f960
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
cb2f960 to
41ef7aa
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
41ef7aa to
8287c6a
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
c910e6c to
fcb7214
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Virtual NICs (virtio) do not report valid link speed via sysfs (/sys/class/net/ethN/speed returns -1). This causes VS SAI to report 0xFFFFFFFF as the oper speed, displayed as '4294967.3G' in CLI. Enable SAI_VS_USE_CONFIGURED_SPEED_AS_OPER_SPEED=true in all VS platform sai.profile files so that VS SAI returns the configured speed (from CONFIG_DB) as the oper speed instead of querying sysfs. Updated profiles: - x86_64-kvm_x86_64-r0/SONiC-VM/sai.profile - x86_64-kvm_x86_64-r0/brcm_gearbox_vs/sai.profile - x86_64-kvm_x86_64_4_asic-r0/msft_four_asic_vs/0/sai.profile (+ symlinked 1-3) - x86_64-kvm_x86_64_6_asic-r0/msft_multi_asic_vs/0/sai.profile (+ symlinked 1-5) Signed-off-by: Rustiqly <rustiqly@users.noreply.github.com>
fcb7214 to
5d17d97
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
What I did
Enable
SAI_VS_USE_CONFIGURED_SPEED_AS_OPER_SPEED=truein all VS platformsai.profilefiles.Why I did it
Virtual NICs (virtio) do not report valid link speed via sysfs —
/sys/class/net/ethN/speedreturns-1. The VS SAI reads this value and interprets it as4294967295(0xFFFFFFFFunsigned), which causesshow interfaces statusto display4294967.3Gas the port speed for operationally up ports.The
SAI_VS_USE_CONFIGURED_SPEED_AS_OPER_SPEEDflag (added in sonic-sairedis) makes VS SAI return the configured speed fromSAI_PORT_ATTR_SPEED(CONFIG_DB) as the operational speed, bypassing the broken sysfs query entirely.This is the right default for all VS platforms since virtual switches never have real physical link speeds to report.
How I did it
Added
SAI_VS_USE_CONFIGURED_SPEED_AS_OPER_SPEED=trueto all VSsai.profilefiles:x86_64-kvm_x86_64-r0/SONiC-VM/sai.profilex86_64-kvm_x86_64-r0/brcm_gearbox_vs/sai.profilex86_64-kvm_x86_64_4_asic-r0/msft_four_asic_vs/0/sai.profile(1/2/3 are symlinks)x86_64-kvm_x86_64_6_asic-r0/msft_multi_asic_vs/0/sai.profile(1-5 are symlinks)How to verify it
show interfaces statusshows correct configured speed (e.g.40G) instead of4294967.3GCompanion PR: sonic-net/sonic-sairedis#1763 (fixes the code to also handle -1 gracefully as fallback)
Signed-off-by: Rustiqly rustiqly@users.noreply.github.com