[SmartSwitch] Restore DPU gNMI midplane connectivity#28564
Open
hdwhdw wants to merge 4 commits into
Open
Conversation
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Restores SmartSwitch NPU→DPU gNMI/gNOI (and legacy telemetry) reachability over the chassis midplane by binding the DPU services to the DPU’s midplane IPv4 address when running without certificates, while keeping non-DPU/no-cert devices bound to loopback.
Changes:
- Detect SmartSwitch DPU role via
DEVICE_METADATA.type=SmartSwitchDPUorswitch_type=dpuwhen no cert config is present. - Poll up to 30 seconds for
eth0-midplaneIPv4 and bind gNMI/telemetry to that address with explicit no-TLS link-local opt-in. - Fail closed (exit) when a SmartSwitch DPU has no midplane IPv4 address.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dockers/docker-sonic-telemetry/telemetry.sh | On no-cert SmartSwitch DPUs, bind legacy telemetry to midplane IPv4 instead of loopback; fail closed if missing. |
| dockers/docker-sonic-gnmi/gnmi-native.sh | On no-cert SmartSwitch DPUs, bind gNMI/gNOI to midplane IPv4 instead of loopback; fail closed if missing. |
| SWITCH_TYPE=$(sonic-db-cli CONFIG_DB hget "DEVICE_METADATA|localhost" "switch_type") | ||
| if [[ x"${DEVICE_TYPE}" == x"SmartSwitchDPU" || x"${SWITCH_TYPE}" == x"dpu" ]]; then | ||
| for _ in {1..30}; do | ||
| MIDPLANE_ADDRESS=$(ip -4 -o addr show dev eth0-midplane 2>/dev/null | awk '{sub(/\/.*/, "", $4); print $4; exit}') |
| SWITCH_TYPE=$(sonic-db-cli CONFIG_DB hget "DEVICE_METADATA|localhost" "switch_type") | ||
| if [[ x"${DEVICE_TYPE}" == x"SmartSwitchDPU" || x"${SWITCH_TYPE}" == x"dpu" ]]; then | ||
| for _ in {1..30}; do | ||
| MIDPLANE_ADDRESS=$(ip -4 -o addr show dev eth0-midplane 2>/dev/null | awk '{sub(/\/.*/, "", $4); print $4; exit}') |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
| "certs": {% if TELEMETRY is defined and "certs" in TELEMETRY %}{{ TELEMETRY["certs"] }}{% else %}""{% endif %}, | ||
| "gnmi" : {% if TELEMETRY is defined and "gnmi" in TELEMETRY %}{{ TELEMETRY["gnmi"] }}{% else %}""{% endif %}, | ||
| "x509" : {% if "x509" in DEVICE_METADATA.keys() %}{{ DEVICE_METADATA["x509"] }}{% else %}""{% endif %}, | ||
| "is_smart_switch_dpu": {{ (DEVICE_METADATA["localhost"].get("type") == "SmartSwitchDPU" or DEVICE_METADATA["localhost"].get("switch_type") == "dpu") | lower }} |
| "certs": {% if GNMI is defined and "certs" in GNMI %}{{ GNMI["certs"] }}{% else %}""{% endif %}, | ||
| "gnmi" : {% if GNMI is defined and "gnmi" in GNMI %}{{ GNMI["gnmi"] }}{% else %}""{% endif %}, | ||
| "x509" : {% if "x509" in DEVICE_METADATA.keys() %}{{ DEVICE_METADATA["x509"] }}{% else %}""{% endif %}, | ||
| "is_smart_switch_dpu": {{ (DEVICE_METADATA["localhost"].get("type") == "SmartSwitchDPU" or DEVICE_METADATA["localhost"].get("switch_type") == "dpu") | lower }} |
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
Author
|
/azpw ms_conflict |
1 similar comment
Contributor
Author
|
/azpw ms_conflict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
SmartSwitch DPUs normally run gNMI/gNOI without certificate configuration so
the NPU can proxy plaintext RPCs over the chassis-internal midplane. After
sonic-gnmi#712 and sonic-buildimage#28110, both DPU services bind only to
127.0.0.1, so the NPU gets connection refused at the DPU's IPv4 link-localaddress.
Fixes #28540.
Work item tracking
How I did it
DEVICE_METADATA.type=SmartSwitchDPUor
switch_type=dpuin the existing singlesonic-cfggentemplate render.--noTLS --no_tls_link_local_interface eth0-midplane.link-local address, including bounded address-readiness handling.
sonic-db-clicalls,ip/awkparsing, and polling in bothlaunch scripts.
How to verify it
Native arm64 SONiC build succeeded for the gNMI package and both affected
containers.
Physical SmartSwitch validation:
both DPU ports were refused and direct gNOI
System.Timefailed.ports
50052and8080.System.Timepassed on50052.x-sonic-ss-target-type=dpuand index metadatapassed through DPUProxy.
address or loopback.
reachable and the baseline direct RPC passed.
Which release branch to backport (provide reason below if selected)
Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): #28540
Failure type: regression
Tested branch
Test result
gNOI validation passed.
Description for the changelog
Restore SmartSwitch NPU-to-DPU gNMI/gNOI connectivity over the link-local midplane.
Link to config_db schema for YANG module changes
N/A